]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Standardize crc32_stub
authorMatheus Castanho <msc@linux.ibm.com>
Wed, 16 Jun 2021 17:36:24 +0000 (14:36 -0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 12 Aug 2021 07:09:02 +0000 (09:09 +0200)
Reorganize statements inside crc32_stub() to match more closely the format
used for other function stubs in functable.c.

functable.c

index 17544feb9ee362d3b88606f4b3f47d32ddd79552..e1c8577f0e82ebafb9560da726b6c02cb2b30897 100644 (file)
@@ -467,6 +467,7 @@ Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t
            "crc32_z takes size_t but internally we have a uint64_t len");
     /* return a function pointer for optimized arches here after a capability test */
 
+    functable.crc32 = &crc32_generic;
     cpu_check_features();
 
     if (use_byfour) {
@@ -485,8 +486,6 @@ Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t
 #else
 #  error No endian defined
 #endif
-    } else {
-        functable.crc32 = crc32_generic;
     }
 
     return functable.crc32(crc, buf, len);