diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-04 08:44:24 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-04 08:44:24 +0000 |
commit | 1c73a32c0f597f0df272c9e31bc56e0f43e57aeb (patch) | |
tree | 24ac8fe2449880ef85ab7034a20ee82aff631f7e | |
parent | 704b06e544d327a86a275b8454a221fbf1d7a3dd (diff) |
texk/dvipng [WIN64]: Better handling of casts from pointer to integer
git-svn-id: svn://tug.org/texlive/trunk@36432 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/dvipng/dvipng-1.15-PATCHES/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/dvipng/dvipng-1.15-PATCHES/patch-07-w64-ptr | 52 | ||||
-rw-r--r-- | Build/source/texk/dvipng/dvipng-1.15/pk.c | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipng/dvipng-1.15/tfm.c | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipng/dvipng-1.15/vf.c | 15 |
5 files changed, 23 insertions, 62 deletions
diff --git a/Build/source/texk/dvipng/dvipng-1.15-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.15-PATCHES/ChangeLog index 1765ed9d1c5..64d6ffe16c1 100644 --- a/Build/source/texk/dvipng/dvipng-1.15-PATCHES/ChangeLog +++ b/Build/source/texk/dvipng/dvipng-1.15-PATCHES/ChangeLog @@ -1,3 +1,7 @@ +2015-03-04 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-07-w64-ptr: Better handling of WIN64 ptr->long. + 2015-03-03 Peter Breitenlohner <peb@mppmu.mpg.de> * Imported release 1.15 from savannah.nongnu.org. diff --git a/Build/source/texk/dvipng/dvipng-1.15-PATCHES/patch-07-w64-ptr b/Build/source/texk/dvipng/dvipng-1.15-PATCHES/patch-07-w64-ptr index 186df2638a8..4c4ff5b6064 100644 --- a/Build/source/texk/dvipng/dvipng-1.15-PATCHES/patch-07-w64-ptr +++ b/Build/source/texk/dvipng/dvipng-1.15-PATCHES/patch-07-w64-ptr @@ -1,17 +1,12 @@ diff -ur dvipng-1.15.orig/pk.c dvipng-1.15/pk.c --- dvipng-1.15.orig/pk.c 2015-03-02 20:33:56.000000000 +0100 -+++ dvipng-1.15/pk.c 2015-03-03 13:09:32.000000000 +0100 -@@ -346,8 +346,13 @@ - /* Read char definitions */ ++++ dvipng-1.15/pk.c 2015-03-04 08:26:11.000000000 +0100 +@@ -347,7 +347,7 @@ position = skip_specials(position); while (*position != PK_POST) { -+#ifdef _WIN64 -+ DEBUG_PRINT(DEBUG_PK,("\n @%I64d PK CHAR:\t%d", -+ (__int64)position - (__int64)tfontp->fmmap.data, *position)); -+#else DEBUG_PRINT(DEBUG_PK,("\n @%ld PK CHAR:\t%d", - (long)position - (long)tfontp->fmmap.data, *position)); -+#endif +- (long)position - (long)tfontp->fmmap.data, *position)); ++ (long)((char *)position - tfontp->fmmap.data), *position)); if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL) Fatal("cannot allocate space for char_entry"); tcharptr->flag_byte = *position; @@ -29,51 +24,34 @@ diff -ur dvipng-1.15.orig/special.c dvipng-1.15/special.c (option_flags & NO_GSSAFER) ? "-": "-dSAFER", diff -ur dvipng-1.15.orig/tfm.c dvipng-1.15/tfm.c --- dvipng-1.15.orig/tfm.c 2015-03-02 20:33:56.000000000 +0100 -+++ dvipng-1.15/tfm.c 2015-03-03 13:29:02.000000000 +0100 -@@ -55,8 +55,13 @@ - c=bc; ++++ dvipng-1.15/tfm.c 2015-03-04 08:27:58.000000000 +0100 +@@ -56,7 +56,7 @@ position=(unsigned char*)fmmap.data+24+lh*4; while(c <= ec) { -+#ifdef _WIN64 -+ DEBUG_PRINT(DEBUG_TFM,("\n@%I64d TFM METRICS:\t", -+ (__int64)position - (__int64)fmmap.data)); -+#else DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", - (long)position - (long)fmmap.data)); -+#endif +- (long)position - (long)fmmap.data)); ++ (long)((char *)position - fmmap.data))); if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) Fatal("cannot allocate memory for TFM char entry"); tcharptr->data=NULL; diff -ur dvipng-1.15.orig/vf.c dvipng-1.15/vf.c --- dvipng-1.15.orig/vf.c 2015-03-02 20:33:56.000000000 +0100 -+++ dvipng-1.15/vf.c 2015-03-03 13:28:26.000000000 +0100 -@@ -79,9 +79,15 @@ - /* Read font definitions */ ++++ dvipng-1.15/vf.c 2015-03-04 08:29:50.000000000 +0100 +@@ -80,7 +80,7 @@ position += 8; while(*position >= FNT_DEF1 && *position <= FNT_DEF4) { -+#ifdef _WIN64 -+ DEBUG_PRINT(DEBUG_VF,("\n @%I64d VF:\t%s", -+ (__int64)position - (__int64)tfontp->fmmap.data, -+ dvi_commands[*position])); -+#else DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", - (long)position - (long)tfontp->fmmap.data, +- (long)position - (long)tfontp->fmmap.data, ++ (long)((char *)position - tfontp->fmmap.data), dvi_commands[*position])); -+#endif FontDef(position,tfontp); length = dvi_commandlength[*position]; - position += length + *(position + length-1) + *(position+length-2); -@@ -94,8 +100,13 @@ - tfontp->defaultfont=tfontnump->k; +@@ -95,7 +95,7 @@ /* Read char definitions */ while(*position < FNT_DEF1) { -+#ifdef _WIN64 -+ DEBUG_PRINT(DEBUG_VF,("\n@%I64d VF CHAR:\t", -+ (__int64)position - (__int64)tfontp->fmmap.data)); -+#else DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", - (long)position - (long)tfontp->fmmap.data)); -+#endif +- (long)position - (long)tfontp->fmmap.data)); ++ (long)((char *)position - tfontp->fmmap.data))); if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) Fatal("cannot allocate memory for VF char entry"); switch (*position) { diff --git a/Build/source/texk/dvipng/dvipng-1.15/pk.c b/Build/source/texk/dvipng/dvipng-1.15/pk.c index 2691e402d3c..e814513c7e4 100644 --- a/Build/source/texk/dvipng/dvipng-1.15/pk.c +++ b/Build/source/texk/dvipng/dvipng-1.15/pk.c @@ -346,13 +346,8 @@ void InitPK(struct font_entry * tfontp) /* Read char definitions */ position = skip_specials(position); while (*position != PK_POST) { -#ifdef _WIN64 - DEBUG_PRINT(DEBUG_PK,("\n @%I64d PK CHAR:\t%d", - (__int64)position - (__int64)tfontp->fmmap.data, *position)); -#else DEBUG_PRINT(DEBUG_PK,("\n @%ld PK CHAR:\t%d", - (long)position - (long)tfontp->fmmap.data, *position)); -#endif + (long)((char *)position - tfontp->fmmap.data), *position)); if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL) Fatal("cannot allocate space for char_entry"); tcharptr->flag_byte = *position; diff --git a/Build/source/texk/dvipng/dvipng-1.15/tfm.c b/Build/source/texk/dvipng/dvipng-1.15/tfm.c index 045ffd2de2e..05c4b8a5d8b 100644 --- a/Build/source/texk/dvipng/dvipng-1.15/tfm.c +++ b/Build/source/texk/dvipng/dvipng-1.15/tfm.c @@ -55,13 +55,8 @@ bool ReadTFM(struct font_entry * tfontp, char* tfmname) c=bc; position=(unsigned char*)fmmap.data+24+lh*4; while(c <= ec) { -#ifdef _WIN64 - DEBUG_PRINT(DEBUG_TFM,("\n@%I64d TFM METRICS:\t", - (__int64)position - (__int64)fmmap.data)); -#else DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", - (long)position - (long)fmmap.data)); -#endif + (long)((char *)position - fmmap.data))); if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) Fatal("cannot allocate memory for TFM char entry"); tcharptr->data=NULL; diff --git a/Build/source/texk/dvipng/dvipng-1.15/vf.c b/Build/source/texk/dvipng/dvipng-1.15/vf.c index 164ae4b4934..28e429eb264 100644 --- a/Build/source/texk/dvipng/dvipng-1.15/vf.c +++ b/Build/source/texk/dvipng/dvipng-1.15/vf.c @@ -79,15 +79,9 @@ void InitVF(struct font_entry * tfontp) /* Read font definitions */ position += 8; while(*position >= FNT_DEF1 && *position <= FNT_DEF4) { -#ifdef _WIN64 - DEBUG_PRINT(DEBUG_VF,("\n @%I64d VF:\t%s", - (__int64)position - (__int64)tfontp->fmmap.data, - dvi_commands[*position])); -#else DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", - (long)position - (long)tfontp->fmmap.data, + (long)((char *)position - tfontp->fmmap.data), dvi_commands[*position])); -#endif FontDef(position,tfontp); length = dvi_commandlength[*position]; position += length + *(position + length-1) + *(position+length-2); @@ -100,13 +94,8 @@ void InitVF(struct font_entry * tfontp) tfontp->defaultfont=tfontnump->k; /* Read char definitions */ while(*position < FNT_DEF1) { -#ifdef _WIN64 - DEBUG_PRINT(DEBUG_VF,("\n@%I64d VF CHAR:\t", - (__int64)position - (__int64)tfontp->fmmap.data)); -#else DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", - (long)position - (long)tfontp->fmmap.data)); -#endif + (long)((char *)position - tfontp->fmmap.data))); if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) Fatal("cannot allocate memory for VF char entry"); switch (*position) { |