From ededb6f2c806361369685dfd48e2239a8ade5b41 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 14 Jan 2017 05:06:15 +0100 Subject: [PATCH] fix crc32 compile error, fixes #2039 --- src/borg/_crc32/slice_by_8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/borg/_crc32/slice_by_8.c b/src/borg/_crc32/slice_by_8.c index d58be1943..f1efbb37f 100644 --- a/src/borg/_crc32/slice_by_8.c +++ b/src/borg/_crc32/slice_by_8.c @@ -350,6 +350,7 @@ uint32_t crc32_slice_by_8(const void* data, size_t length, uint32_t previousCrc3 // enabling optimization (at least -O2) automatically unrolls the inner for-loop const size_t Unroll = 4; const size_t BytesAtOnce = 8 * Unroll; + const uint8_t* currentChar; // process 4x eight bytes at once (Slicing-by-8) while (length >= BytesAtOnce) @@ -386,7 +387,7 @@ uint32_t crc32_slice_by_8(const void* data, size_t length, uint32_t previousCrc3 length -= BytesAtOnce; } - const uint8_t* currentChar = (const uint8_t*) current; + currentChar = (const uint8_t*) current; // remaining 1 to 31 bytes (standard algorithm) while (length-- != 0) crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *currentChar++];