summaryrefslogtreecommitdiff
path: root/Build/source/libs/zziplib
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/source/libs/zziplib
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/source/libs/zziplib')
-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
3 files changed, 39 insertions, 4 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;
}