mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-27 20:13:56 +00:00
hash.c - Avoid naming local variables 'crc32'
This commit is contained in:
parent
dbb5f02e9d
commit
2138a57efb
10
hash.c
10
hash.c
@ -257,18 +257,18 @@ static const uint32_t crc32_table[256] = {
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
uint32_t crc32_adjust(uint32_t crc32, uint8_t input)
|
||||
uint32_t crc32_adjust(uint32_t checksum, uint8_t input)
|
||||
{
|
||||
return ((crc32 >> 8) & 0x00ffffff) ^ crc32_table[(crc32 ^ input) & 0xff];
|
||||
return ((checksum >> 8) & 0x00ffffff) ^ crc32_table[(checksum ^ input) & 0xff];
|
||||
}
|
||||
|
||||
uint32_t crc32_calculate(const uint8_t *data, size_t length)
|
||||
{
|
||||
size_t i;
|
||||
uint32_t crc32 = ~0;
|
||||
uint32_t checksum = ~0;
|
||||
for (i = 0; i < length; i++)
|
||||
crc32 = crc32_adjust(crc32, data[i]);
|
||||
return ~crc32;
|
||||
checksum = crc32_adjust(checksum, data[i]);
|
||||
return ~checksum;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user