From 4fcb413802e4e3f7e88cd822d6eb38fd53a0886b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 27 Nov 2017 01:01:34 +0100 Subject: [PATCH] crc32-slice-by-8.c: fix for C90 compilers crc32_slice_by_8.c:344:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] (cherry picked from commit 23a1d62b2580f9462c02524eb23af99c04ca65d0) --- src/borg/algorithms/crc32_slice_by_8.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/borg/algorithms/crc32_slice_by_8.c b/src/borg/algorithms/crc32_slice_by_8.c index b289fbb87..3ab0c8409 100644 --- a/src/borg/algorithms/crc32_slice_by_8.c +++ b/src/borg/algorithms/crc32_slice_by_8.c @@ -332,14 +332,12 @@ uint32_t crc32_slice_by_8(const void* data, size_t length, uint32_t previousCrc3 uint32_t crc = ~previousCrc32; // same as previousCrc32 ^ 0xFFFFFFFF const uint32_t* current; - const uint8_t* currentChar; + const uint8_t* currentChar = (const uint8_t*) data; // enabling optimization (at least -O2) automatically unrolls the inner for-loop const size_t Unroll = 4; const size_t BytesAtOnce = 8 * Unroll; - currentChar = (const uint8_t*) data; - // wanted: 32 bit / 4 Byte alignment, compute leading, unaligned bytes length uintptr_t unaligned_length = (4 - (((uintptr_t) currentChar) & 3)) & 3; // process unaligned bytes, if any (standard algorithm)