mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix CRC32 calculation on big endian CPU
Fix regresion from 2.02.75 speedup - so currently crc32 is a little bit more complicated on big-endian CPU as the uint32_t needs to be shifted on here.
This commit is contained in:
parent
0ea1e5c109
commit
2fdd451b19
@ -1,5 +1,6 @@
|
||||
Version 2.02.84 -
|
||||
===================================
|
||||
Fix CRC32 calculation on big endian CPU (2.02.75).
|
||||
|
||||
Version 2.02.83 - 4th February 2011
|
||||
===================================
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "lib.h"
|
||||
|
||||
#include "crc.h"
|
||||
#include "xlate.h"
|
||||
|
||||
/* Calculate an endian-independent CRC of supplied buffer */
|
||||
#ifndef DEBUG_CRC32
|
||||
@ -65,7 +66,7 @@ static uint32_t _calc_crc_new(uint32_t initial, const uint8_t *buf, uint32_t siz
|
||||
|
||||
/* Process 4 bytes per iteration */
|
||||
while (start < end) {
|
||||
crc = crc ^ *start++;
|
||||
crc = crc ^ xlate32(*start++);
|
||||
crc = crctab[crc & 0xff] ^ crc >> 8;
|
||||
crc = crctab[crc & 0xff] ^ crc >> 8;
|
||||
crc = crctab[crc & 0xff] ^ crc >> 8;
|
||||
|
Loading…
Reference in New Issue
Block a user