]> 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>
Fri, 24 Dec 2021 11:52:14 +0000 (12:52 +0100)
Reorganize statements inside crc32_stub() to match more closely the format
used for other function stubs in functable.c.

functable.c

index 32ab90ed3aecccc6206f2d4f50a9570bc6bf33dd..807f7aed455df4a7cf56f72c138769acc55e054b 100644 (file)
@@ -378,6 +378,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) {
@@ -392,8 +393,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);