summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crc32.c6
-rw-r--r--zutil.h8
2 files changed, 3 insertions, 11 deletions
diff --git a/crc32.c b/crc32.c
index 9580440..e72636a 100644
--- a/crc32.c
+++ b/crc32.c
@@ -212,7 +212,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
212#endif /* DYNAMIC_CRC_TABLE */ 212#endif /* DYNAMIC_CRC_TABLE */
213 213
214#ifdef BYFOUR 214#ifdef BYFOUR
215 if (sizeof(void *) == sizeof(ptrdiff_t)) { 215 if (sizeof(void *) == sizeof(z_size_t)) {
216 z_crc_t endian; 216 z_crc_t endian;
217 217
218 endian = 1; 218 endian = 1;
@@ -273,7 +273,7 @@ local unsigned long crc32_little(crc, buf, len)
273 273
274 c = (z_crc_t)crc; 274 c = (z_crc_t)crc;
275 c = ~c; 275 c = ~c;
276 while (len && ((ptrdiff_t)buf & 3)) { 276 while (len && ((z_size_t)buf & 3)) {
277 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); 277 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
278 len--; 278 len--;
279 } 279 }
@@ -313,7 +313,7 @@ local unsigned long crc32_big(crc, buf, len)
313 313
314 c = ZSWAP32((z_crc_t)crc); 314 c = ZSWAP32((z_crc_t)crc);
315 c = ~c; 315 c = ~c;
316 while (len && ((ptrdiff_t)buf & 3)) { 316 while (len && ((z_size_t)buf & 3)) {
317 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); 317 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
318 len--; 318 len--;
319 } 319 }
diff --git a/zutil.h b/zutil.h
index b079ea6..60a0bca 100644
--- a/zutil.h
+++ b/zutil.h
@@ -29,10 +29,6 @@
29# include <stdlib.h> 29# include <stdlib.h>
30#endif 30#endif
31 31
32#ifdef Z_SOLO
33 typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
34#endif
35
36#ifndef local 32#ifndef local
37# define local static 33# define local static
38#endif 34#endif
@@ -170,10 +166,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
170#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX 166#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
171# if defined(_WIN32_WCE) 167# if defined(_WIN32_WCE)
172# define fdopen(fd,mode) NULL /* No fdopen() */ 168# define fdopen(fd,mode) NULL /* No fdopen() */
173# ifndef _PTRDIFF_T_DEFINED
174 typedef int ptrdiff_t;
175# define _PTRDIFF_T_DEFINED
176# endif
177# else 169# else
178# define fdopen(fd,type) _fdopen(fd,type) 170# define fdopen(fd,type) _fdopen(fd,type)
179# endif 171# endif