Browse Source

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)
Thomas Waldmann 7 years ago
parent
commit
4fcb413802
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/borg/algorithms/crc32_slice_by_8.c

+ 1 - 3
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)