]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Remove use_byfour compile time detection of the existence of four byte integer types...
authorNathan Moinvaziri <nathan@nathanm.com>
Tue, 4 Jan 2022 16:30:39 +0000 (08:30 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 8 Jan 2022 12:56:43 +0000 (13:56 +0100)
functable.c

index 0118dc5b7406a1774fd9e46e9a58f90c6e69f6ee..5d0005a9857c34d7dfa1afbb33ca8333a28790e1 100644 (file)
@@ -519,22 +519,16 @@ Z_INTERNAL uint8_t* chunkmemset_safe_stub(uint8_t *out, unsigned dist, unsigned
 }
 
 Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t len) {
-    int32_t use_byfour = sizeof(void *) == sizeof(ptrdiff_t);
-
     Assert(sizeof(uint64_t) >= sizeof(size_t),
            "crc32_z takes size_t but internally we have a uint64_t len");
 
-    if (use_byfour) {
 #if BYTE_ORDER == LITTLE_ENDIAN
-        functable.crc32 = crc32_little;
+    functable.crc32 = crc32_little;
 #elif BYTE_ORDER == BIG_ENDIAN
-        functable.crc32 = crc32_big;
+    functable.crc32 = crc32_big;
 #else
-#  error No endian defined
+    functable.crc32 = &crc32_generic;
 #endif
-    } else {
-        functable.crc32 = &crc32_generic;
-    }
     cpu_check_features();
 #ifdef ARM_ACLE_CRC_HASH
     if (arm_cpu_has_crc32)