]> git.lizzy.rs Git - zlib.git/blobdiff - crc32.c
Avoid the use of ptrdiff_t.
[zlib.git] / crc32.c
diff --git a/crc32.c b/crc32.c
index 9580440c0e6b673c43e57daab03274ebdca8f77e..e72636a505b31a499f2fb0121d3c0e011d246f66 100644 (file)
--- a/crc32.c
+++ b/crc32.c
@@ -212,7 +212,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
 #endif /* DYNAMIC_CRC_TABLE */
 
 #ifdef BYFOUR
-    if (sizeof(void *) == sizeof(ptrdiff_t)) {
+    if (sizeof(void *) == sizeof(z_size_t)) {
         z_crc_t endian;
 
         endian = 1;
@@ -273,7 +273,7 @@ local unsigned long crc32_little(crc, buf, len)
 
     c = (z_crc_t)crc;
     c = ~c;
-    while (len && ((ptrdiff_t)buf & 3)) {
+    while (len && ((z_size_t)buf & 3)) {
         c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
         len--;
     }
@@ -313,7 +313,7 @@ local unsigned long crc32_big(crc, buf, len)
 
     c = ZSWAP32((z_crc_t)crc);
     c = ~c;
-    while (len && ((ptrdiff_t)buf & 3)) {
+    while (len && ((z_size_t)buf & 3)) {
         c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
         len--;
     }