summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/crc32.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/shared/crc32.c b/src/shared/crc32.c
index 098615f..c3e566f 100644
--- a/src/shared/crc32.c
+++ b/src/shared/crc32.c
@@ -682,19 +682,20 @@ uint32_t crc32(crc, buf, len)
c = crc32pclmul(c, buf, len & ~PCLMUL_ALIGN_MASK);
buf += len & ~PCLMUL_ALIGN_MASK;
len &= PCLMUL_ALIGN_MASK;
- }
-#else
- const uint32_t *buf4 = (const uint32_t *)(const void *)buf;
- while (len >= 32) {
- DOLIT32;
- len -= 32;
- }
- while (len >= 4) {
- DOLIT4;
- len -= 4;
- }
- buf = (const uint8_t *)buf4;
+ } else
#endif
+ do {
+ const uint32_t *buf4 = (const uint32_t *)(const void *)buf;
+ while (len >= 32) {
+ DOLIT32;
+ len -= 32;
+ }
+ while (len >= 4) {
+ DOLIT4;
+ len -= 4;
+ }
+ buf = (const uint8_t *)buf4;
+ } while (0);
if (len) do {
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);