Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/zlib/google.patch

Issue 1384773002: Fix VC++ 2015 64-bit truncation warning in zlib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 diff -ru zlib-1.2.5/crc_folding.c zlib/crc_folding.c
2 --- zlib-1.2.5/crc_folding.c
3 +++ zlib/crc_folding.c
4 @@ -283,7 +283,9 @@
5 goto partial;
6 }
7
8 - algn_diff = 0 - (unsigned long)src & 0xF;
9 + // Double cast to avoid truncation errors in 64-bit builds by making the
10 + // truncation explicit.
11 + algn_diff = 0 - (unsigned long)(size_t)src & 0xF;
12 if (algn_diff) {
13 xmm_crc_part = _mm_loadu_si128((__m128i *)src);
14 _mm_storeu_si128((__m128i *)dst, xmm_crc_part);
1 diff -ru zlib-1.2.5/gzlib.c zlib/gzlib.c 15 diff -ru zlib-1.2.5/gzlib.c zlib/gzlib.c
2 --- zlib-1.2.5/gzlib.c 16 --- zlib-1.2.5/gzlib.c
3 +++ zlib/gzlib.c 17 +++ zlib/gzlib.c
4 @@ -5,7 +5,9 @@ 18 @@ -5,7 +5,9 @@
5 19
6 #include "gzguts.h" 20 #include "gzguts.h"
7 21
8 -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 22 -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
9 +#if defined(_WIN32) 23 +#if defined(_WIN32)
10 +# define LSEEK (z_off64_t)_lseeki64 24 +# define LSEEK (z_off64_t)_lseeki64
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 +# ifdef adler32_combine 245 +# ifdef adler32_combine
232 +# undef adler32_combine 246 +# undef adler32_combine
233 +# endif 247 +# endif
234 # define adler32_combine adler32_combine64 248 # define adler32_combine adler32_combine64
235 +# ifdef crc32_combine 249 +# ifdef crc32_combine
236 +# undef crc32_combine 250 +# undef crc32_combine
237 +# endif 251 +# endif
238 # define crc32_combine crc32_combine64 252 # define crc32_combine crc32_combine64
239 # ifdef _LARGEFILE64_SOURCE 253 # ifdef _LARGEFILE64_SOURCE
240 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 254 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
OLDNEW
« third_party/zlib/crc_folding.c ('K') | « third_party/zlib/crc_folding.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698