summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-07-15 07:06:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-07-15 07:06:38 +0000
commit15a3c5c0dc3253647bbf40b2826fbbbb8474fab3 (patch)
tree710e89852ecf9dd53be67344408954ca21ca4a72 /Build
parent12488878f1c86fcf3f6be3364da9761036213135 (diff)
Avoid cast from pointer to integer of different size on 64-bit Windows
git-svn-id: svn://tug.org/texlive/trunk@34615 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/ChangeLog4
-rw-r--r--Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/patch-03-w64-ptr27
-rw-r--r--Build/source/libs/zziplib/zziplib-0.13.62/zzip/zip.c12
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfm-x/cmap_read.c18
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog4
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-07-w64-ptr79
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14/pk.c5
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14/special.c2
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14/tfm.c5
-rw-r--r--Build/source/texk/dvipng/dvipng-1.14/vf.c11
11 files changed, 158 insertions, 14 deletions
diff --git a/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/ChangeLog b/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/ChangeLog
index 72ad27ac1a0..934f50c32e6 100644
--- a/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/ChangeLog
+++ b/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-03-w64-ptr: Avoid WIN64 warning due to different size.
+
2014-07-14 Peter Breitenlohner <peb@mppmu.mpg.de>
* patch-02-bugfix (new): Fix mmap for WIN32/WIN64, from Akira.
diff --git a/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/patch-03-w64-ptr b/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/patch-03-w64-ptr
new file mode 100644
index 00000000000..f11ec7e4819
--- /dev/null
+++ b/Build/source/libs/zziplib/zziplib-0.13.62-PATCHES/patch-03-w64-ptr
@@ -0,0 +1,27 @@
+diff -ur zziplib-0.13.62.orig/zzip/zip.c zziplib-0.13.62/zzip/zip.c
+--- zziplib-0.13.62.orig/zzip/zip.c 2010-12-29 17:22:29.000000000 +0100
++++ zziplib-0.13.62/zzip/zip.c 2014-07-14 17:05:48.000000000 +0200
+@@ -374,15 +374,19 @@
+ * making pointer alignments to values that can be handled as structures
+ * is tricky. We assume here that an align(4) is sufficient even for
+ * 64 bit machines. Note that binary operations are not usually allowed
+- * to pointer types but we do need only the lower bits in this implementation,
+- * so we can just cast the value to a long value.
++ * to pointer types but we can cast the value to a suitably sized integer.
+ */
+ _zzip_inline static char *
+ __zzip_aligned4(char *p)
+ {
+ #define aligned4 __zzip_aligned4
+- p += ((long) p) & 1; /* warnings about truncation of a "pointer" */
+- p += ((long) p) & 2; /* to a "long int" may be safely ignored :) */
++#ifdef _WIN64
++ p += ((__int64) p) & 1;
++ p += ((__int64) p) & 2;
++#else
++ p += ((long) p) & 1;
++ p += ((long) p) & 2;
++#endif
+ return p;
+ }
+
diff --git a/Build/source/libs/zziplib/zziplib-0.13.62/zzip/zip.c b/Build/source/libs/zziplib/zziplib-0.13.62/zzip/zip.c
index a574b24be18..a4b06b47189 100644
--- a/Build/source/libs/zziplib/zziplib-0.13.62/zzip/zip.c
+++ b/Build/source/libs/zziplib/zziplib-0.13.62/zzip/zip.c
@@ -374,15 +374,19 @@ __zzip_fetch_disk_trailer(int fd, zzip_off_t filesize,
* making pointer alignments to values that can be handled as structures
* is tricky. We assume here that an align(4) is sufficient even for
* 64 bit machines. Note that binary operations are not usually allowed
- * to pointer types but we do need only the lower bits in this implementation,
- * so we can just cast the value to a long value.
+ * to pointer types but we can cast the value to a suitably sized integer.
*/
_zzip_inline static char *
__zzip_aligned4(char *p)
{
#define aligned4 __zzip_aligned4
- p += ((long) p) & 1; /* warnings about truncation of a "pointer" */
- p += ((long) p) & 2; /* to a "long int" may be safely ignored :) */
+#ifdef _WIN64
+ p += ((__int64) p) & 1;
+ p += ((__int64) p) & 2;
+#else
+ p += ((long) p) & 1;
+ p += ((long) p) & 2;
+#endif
return p;
}
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index db69870aee2..90bfdf34b6d 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * cmap_read.c: Avoid cast from pointer to integer of different
+ size on 64-bit Windows.
+
2014-06-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* spc_dvips.c: Use rungs instead of gswin32c in order to support
diff --git a/Build/source/texk/dvipdfm-x/cmap_read.c b/Build/source/texk/dvipdfm-x/cmap_read.c
index 35be2629f33..f6c8d4c36c5 100644
--- a/Build/source/texk/dvipdfm-x/cmap_read.c
+++ b/Build/source/texk/dvipdfm-x/cmap_read.c
@@ -53,17 +53,17 @@ typedef struct {
unsigned char *endptr;
unsigned char *buf;
- long max;
+ size_t max;
FILE *fp;
- long unread;
+ size_t unread;
} ifreader;
-static ifreader *ifreader_create (FILE *fp, long remain, long bufsize);
-static long ifreader_read (ifreader *reader, long size);
+static ifreader *ifreader_create (FILE *fp, size_t remain, size_t bufsize);
+static size_t ifreader_read (ifreader *reader, size_t size);
static void ifreader_destroy (ifreader *reader);
static ifreader *
-ifreader_create (FILE *fp, long size, long bufsize)
+ifreader_create (FILE *fp, size_t size, size_t bufsize)
{
ifreader *reader;
@@ -89,13 +89,13 @@ ifreader_destroy (ifreader *reader)
}
-static long
-ifreader_read (ifreader *reader, long size)
+static size_t
+ifreader_read (ifreader *reader, size_t size)
{
- long bytesread = 0, bytesrem = 0;
+ size_t bytesread = 0, bytesrem = 0;
ASSERT(reader);
- bytesrem = (long) reader->endptr - (long) reader->cursor;
+ bytesrem = (size_t) reader->endptr - (size_t) reader->cursor;
if (size > reader->max) {
if (__verbose)
MESG("\nExtending buffer (%ld bytes)...\n", size);
diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog
index 07e405b4cd7..1e057bcdd1c 100644
--- a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog
+++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-07-w64-ptr: Avoid WIN64 warning due to different size.
+
2013-07-09 Peter Breitenlohner <peb@mppmu.mpg.de>
* COPYING.gd (new): From libgd-2.1.0/COPYING, with '@' => '@@'.
diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-07-w64-ptr b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-07-w64-ptr
new file mode 100644
index 00000000000..585e1d91288
--- /dev/null
+++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-07-w64-ptr
@@ -0,0 +1,79 @@
+diff -ur -x COPYING.gd dvipng-1.14.orig/pk.c dvipng-1.14/pk.c
+--- dvipng-1.14.orig/pk.c 2010-02-11 15:09:10.000000000 +0100
++++ dvipng-1.14/pk.c 2014-07-14 19:59:20.000000000 +0200
+@@ -345,8 +345,13 @@
+ /* 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
+ if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL)
+ Fatal("cannot malloc space for char_entry");
+ tcharptr->flag_byte = *position;
+diff -ur -x COPYING.gd dvipng-1.14.orig/special.c dvipng-1.14/special.c
+--- dvipng-1.14.orig/special.c 2012-08-25 21:36:09.000000000 +0200
++++ dvipng-1.14/special.c 2014-07-14 17:29:34.000000000 +0200
+@@ -214,7 +214,7 @@
+ savestdout = _dup(fileno(stdout));
+ _dup2(pngpipe[WRITE_END], fileno(stdout));
+ if ((hchild=
+- (HANDLE)spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution,
++ (HANDLE)_spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution,
+ "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-",
+ "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4",
+ (option_flags & NO_GSSAFER) ? "-": "-dSAFER",
+diff -ur -x COPYING.gd dvipng-1.14.orig/tfm.c dvipng-1.14/tfm.c
+--- dvipng-1.14.orig/tfm.c 2009-03-26 23:14:01.000000000 +0100
++++ dvipng-1.14/tfm.c 2014-07-14 20:02:32.000000000 +0200
+@@ -54,8 +54,13 @@
+ 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
+ tcharptr=xmalloc(sizeof(struct char_entry));
+ tcharptr->data=NULL;
+ tcharptr->tfmw=width[*position];
+diff -ur -x COPYING.gd dvipng-1.14.orig/vf.c dvipng-1.14/vf.c
+--- dvipng-1.14.orig/vf.c 2010-03-17 14:02:35.000000000 +0100
++++ dvipng-1.14/vf.c 2014-07-14 20:02:33.000000000 +0200
+@@ -79,9 +79,15 @@
+ /* 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,
+ dvi_commands[*position]));
++#endif
+ FontDef(position,tfontp);
+ length = dvi_commandlength[*position];
+ position += length + *(position + length-1) + *(position+length-2);
+@@ -95,8 +101,13 @@
+
+ /* 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
+ tcharptr=xmalloc(sizeof(struct char_entry));
+ switch (*position) {
+ case LONG_CHAR:
diff --git a/Build/source/texk/dvipng/dvipng-1.14/pk.c b/Build/source/texk/dvipng/dvipng-1.14/pk.c
index 446dc7ed2ee..303db8f5132 100644
--- a/Build/source/texk/dvipng/dvipng-1.14/pk.c
+++ b/Build/source/texk/dvipng/dvipng-1.14/pk.c
@@ -345,8 +345,13 @@ 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
if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL)
Fatal("cannot malloc space for char_entry");
tcharptr->flag_byte = *position;
diff --git a/Build/source/texk/dvipng/dvipng-1.14/special.c b/Build/source/texk/dvipng/dvipng-1.14/special.c
index b8db90ce5ff..9d5ef1b06e8 100644
--- a/Build/source/texk/dvipng/dvipng-1.14/special.c
+++ b/Build/source/texk/dvipng/dvipng-1.14/special.c
@@ -214,7 +214,7 @@ ps2png(struct pscode* pscodep, const char *device, int hresolution, int vresolut
savestdout = _dup(fileno(stdout));
_dup2(pngpipe[WRITE_END], fileno(stdout));
if ((hchild=
- (HANDLE)spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution,
+ (HANDLE)_spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution,
"-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-",
"-dTextAlphaBits=4", "-dGraphicsAlphaBits=4",
(option_flags & NO_GSSAFER) ? "-": "-dSAFER",
diff --git a/Build/source/texk/dvipng/dvipng-1.14/tfm.c b/Build/source/texk/dvipng/dvipng-1.14/tfm.c
index a8a829cc932..178460166d4 100644
--- a/Build/source/texk/dvipng/dvipng-1.14/tfm.c
+++ b/Build/source/texk/dvipng/dvipng-1.14/tfm.c
@@ -54,8 +54,13 @@ 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
tcharptr=xmalloc(sizeof(struct char_entry));
tcharptr->data=NULL;
tcharptr->tfmw=width[*position];
diff --git a/Build/source/texk/dvipng/dvipng-1.14/vf.c b/Build/source/texk/dvipng/dvipng-1.14/vf.c
index d1d33fe6d7e..9f66e5fcf62 100644
--- a/Build/source/texk/dvipng/dvipng-1.14/vf.c
+++ b/Build/source/texk/dvipng/dvipng-1.14/vf.c
@@ -79,9 +79,15 @@ 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,
dvi_commands[*position]));
+#endif
FontDef(position,tfontp);
length = dvi_commandlength[*position];
position += length + *(position + length-1) + *(position+length-2);
@@ -95,8 +101,13 @@ void InitVF(struct font_entry * tfontp)
/* 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
tcharptr=xmalloc(sizeof(struct char_entry));
switch (*position) {
case LONG_CHAR: