mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 01:37:20 +00:00
fix crc32 compile error, fixes #2039
This commit is contained in:
parent
9575edc446
commit
ededb6f2c8
1 changed files with 2 additions and 1 deletions
|
@ -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
|
// enabling optimization (at least -O2) automatically unrolls the inner for-loop
|
||||||
const size_t Unroll = 4;
|
const size_t Unroll = 4;
|
||||||
const size_t BytesAtOnce = 8 * Unroll;
|
const size_t BytesAtOnce = 8 * Unroll;
|
||||||
|
const uint8_t* currentChar;
|
||||||
|
|
||||||
// process 4x eight bytes at once (Slicing-by-8)
|
// process 4x eight bytes at once (Slicing-by-8)
|
||||||
while (length >= BytesAtOnce)
|
while (length >= BytesAtOnce)
|
||||||
|
@ -386,7 +387,7 @@ uint32_t crc32_slice_by_8(const void* data, size_t length, uint32_t previousCrc3
|
||||||
length -= BytesAtOnce;
|
length -= BytesAtOnce;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t* currentChar = (const uint8_t*) current;
|
currentChar = (const uint8_t*) current;
|
||||||
// remaining 1 to 31 bytes (standard algorithm)
|
// remaining 1 to 31 bytes (standard algorithm)
|
||||||
while (length-- != 0)
|
while (length-- != 0)
|
||||||
crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *currentChar++];
|
crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *currentChar++];
|
||||||
|
|
Loading…
Reference in a new issue