was missing a couple breaks - she's fixed

This commit is contained in:
DarthArgus
2016-09-30 05:54:59 +00:00
parent e044e4dc83
commit 856fd396ba
2 changed files with 7 additions and 4 deletions
@@ -50,19 +50,19 @@ constexpr static const uint32 crctable[256] =
0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
};
// ======================================================================
constexpr uint32 CRC_INIT = 0xFFFFFFFF;
constexpr const uint32 constcrc(const char *string)
{
uint32 crc = 0xFFFFFFFF;
uint32 crc = 0;
if (!string)
return 0;
for (; *string; ++string)
for (crc = CRC_INIT; *string; ++string)
crc = crctable[((crc>>24) ^ static_cast<byte>(*string)) & 0xFF] ^ (crc << 8);
return (crc ^ 0xFFFFFFFF);
return (crc ^ CRC_INIT);
}
// ======================================================================