Fix a shitloads of warnings on VS

Former-commit-id: fca61118f4e0530ed2eaaf9ff96de29806aa5aa8
This commit is contained in:
Lynix
2015-11-25 18:19:26 +01:00
parent c6d16c0128
commit bbe8a776e8
42 changed files with 406 additions and 437 deletions

View File

@@ -98,7 +98,7 @@ namespace Nz
delete m_state;
}
void HashCRC32::Append(const UInt8* data, unsigned int len)
void HashCRC32::Append(const UInt8* data, std::size_t len)
{
while (len--)
m_state->crc = m_state->table[(m_state->crc ^ *data++) & 0xFF] ^ (m_state->crc >> 8);
@@ -120,7 +120,7 @@ namespace Nz
return ByteArray(reinterpret_cast<UInt8*>(&m_state->crc), 4);
}
unsigned int HashCRC32::GetDigestLength() const
std::size_t HashCRC32::GetDigestLength() const
{
return 4;
}

View File

@@ -24,11 +24,11 @@ namespace Nz
delete m_state;
}
void HashFletcher16::Append(const UInt8* data, unsigned int len)
void HashFletcher16::Append(const UInt8* data, std::size_t len)
{
while (len)
{
unsigned int tlen = std::min(len, 21U);
std::size_t tlen = std::min<std::size_t>(len, 21U);
len -= tlen;
do
{
@@ -62,7 +62,7 @@ namespace Nz
return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2);
}
unsigned int HashFletcher16::GetDigestLength() const
std::size_t HashFletcher16::GetDigestLength() const
{
return 2;
}

View File

@@ -277,7 +277,7 @@ namespace Nz
delete m_state;
}
void HashMD5::Append(const UInt8* data, unsigned int len)
void HashMD5::Append(const UInt8* data, std::size_t len)
{
const UInt8 *p = data;
int left = len;
@@ -352,7 +352,7 @@ namespace Nz
return ByteArray(&digest[0], 16);
}
unsigned int HashMD5::GetDigestLength() const
std::size_t HashMD5::GetDigestLength() const
{
return 16;
}

View File

@@ -18,7 +18,7 @@ namespace Nz
delete m_state;
}
void HashSHA1::Append(const UInt8* data, unsigned int len)
void HashSHA1::Append(const UInt8* data, std::size_t len)
{
SHA1_Update(m_state, data, len);
}
@@ -37,7 +37,7 @@ namespace Nz
return ByteArray(digest, SHA1_DIGEST_LENGTH);
}
unsigned int HashSHA1::GetDigestLength() const
std::size_t HashSHA1::GetDigestLength() const
{
return SHA1_DIGEST_LENGTH;
}

View File

@@ -18,7 +18,7 @@ namespace Nz
delete m_state;
}
void HashSHA224::Append(const UInt8* data, unsigned int len)
void HashSHA224::Append(const UInt8* data, std::size_t len)
{
SHA224_Update(m_state, data, len);
}
@@ -37,7 +37,7 @@ namespace Nz
return ByteArray(digest, SHA224_DIGEST_LENGTH);
}
unsigned int HashSHA224::GetDigestLength() const
std::size_t HashSHA224::GetDigestLength() const
{
return SHA224_DIGEST_LENGTH;
}

View File

@@ -18,7 +18,7 @@ namespace Nz
delete m_state;
}
void HashSHA256::Append(const UInt8* data, unsigned int len)
void HashSHA256::Append(const UInt8* data, std::size_t len)
{
SHA256_Update(m_state, data, len);
}
@@ -37,7 +37,7 @@ namespace Nz
return ByteArray(digest, SHA256_DIGEST_LENGTH);
}
unsigned int HashSHA256::GetDigestLength() const
std::size_t HashSHA256::GetDigestLength() const
{
return SHA256_DIGEST_LENGTH;
}

View File

@@ -18,7 +18,7 @@ namespace Nz
delete m_state;
}
void HashSHA384::Append(const UInt8* data, unsigned int len)
void HashSHA384::Append(const UInt8* data, std::size_t len)
{
SHA384_Update(m_state, data, len);
}
@@ -37,7 +37,7 @@ namespace Nz
return ByteArray(digest, SHA384_DIGEST_LENGTH);
}
unsigned int HashSHA384::GetDigestLength() const
std::size_t HashSHA384::GetDigestLength() const
{
return SHA384_DIGEST_LENGTH;
}

View File

@@ -18,7 +18,7 @@ namespace Nz
delete m_state;
}
void HashSHA512::Append(const UInt8* data, unsigned int len)
void HashSHA512::Append(const UInt8* data, std::size_t len)
{
SHA512_Update(m_state, data, len);
}
@@ -37,7 +37,7 @@ namespace Nz
return ByteArray(digest, SHA512_DIGEST_LENGTH);
}
unsigned int HashSHA512::GetDigestLength() const
std::size_t HashSHA512::GetDigestLength() const
{
return SHA512_DIGEST_LENGTH;
}

View File

@@ -866,12 +866,12 @@ namespace Nz
delete m_state;
}
void HashWhirlpool::Append(const UInt8* data, unsigned int len)
void HashWhirlpool::Append(const UInt8* data, std::size_t len)
{
len *= 8; // Whirlpool fonctionne avec une taille en bits
len *= 8; // Whirlpool works with bits
int sourcePos = 0; /* index of leftmost source UInt8 containing data (1 to 8 bits). */
int sourceGap = (8 - (static_cast<int>(len) & 7)) & 7; /* space on source[sourcePos]. */
int sourceGap = (8 - (static_cast<std::intmax_t>(len) & 7)) & 7; /* space on source[sourcePos]. */
int bufferRem = m_state->bufferBits & 7; /* occupied bits on buffer[bufferPos]. */
UInt32 b;
@@ -1015,7 +1015,7 @@ namespace Nz
return ByteArray(&result[0], 64);
}
unsigned int HashWhirlpool::GetDigestLength() const
std::size_t HashWhirlpool::GetDigestLength() const
{
return 64;
}