Update for latest nazarautils

This commit is contained in:
SirLynix
2023-09-08 09:10:22 +02:00
parent aef8b01f15
commit 1009b296a1
13 changed files with 174 additions and 189 deletions

View File

@@ -105,12 +105,9 @@ namespace Nz
ByteArray CRC32Hasher::End()
{
m_crc ^= 0xFFFFFFFF;
#ifdef NAZARA_LITTLE_ENDIAN
m_crc = SwapBytes(m_crc);
#endif
#ifdef NAZARA_BIG_ENDIAN
m_crc = ByteSwap(m_crc ^ 0xFFFFFFFF);
#endif
return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 4);
}

View File

@@ -93,10 +93,9 @@ namespace Nz
ByteArray CRC64Hasher::End()
{
#ifdef NAZARA_LITTLE_ENDIAN
SwapBytes(&m_crc, sizeof(UInt64));
#endif
#ifdef NAZARA_BIG_ENDIAN
m_crc = ByteSwap(m_crc);
#endif
return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 8);
}

View File

@@ -40,9 +40,9 @@ namespace Nz
UInt16 fletcher = (m_sum2 << 8) | m_sum1;
#ifdef NAZARA_LITTLE_ENDIAN
fletcher = SwapBytes(fletcher);
#endif
#ifdef NAZARA_BIG_ENDIAN
fletcher = ByteSwap(fletcher);
#endif
return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2);
}