summaryrefslogtreecommitdiff
path: root/crc.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-01-24 18:40:22 -0500
committerJeffrey Walton <noloader@gmail.com>2016-01-24 18:40:22 -0500
commit9d6e3ae6efad4dbd3c95d279440ed25152c2b300 (patch)
treec4ef8ab5c8ddb020462554df21ce423ac7d33fce /crc.cpp
parent9454c6ba2bca2bff70a38d61fa77df8b9f75877f (diff)
downloadcryptopp-git-9d6e3ae6efad4dbd3c95d279440ed25152c2b300.tar.gz
Cleared -Wcast-align (Issue 122)
Diffstat (limited to 'crc.cpp')
-rw-r--r--crc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/crc.cpp b/crc.cpp
index 3a2cb4fe..0ddfe448 100644
--- a/crc.cpp
+++ b/crc.cpp
@@ -124,6 +124,7 @@ CRC32::CRC32()
void CRC32::Update(const byte *s, size_t n)
{
+ assert(IsAlignedOn(s,GetAlignmentOf<word32>()));
word32 crc = m_crc;
for(; !IsAligned<word32>(s) && n > 0; n--)
@@ -131,7 +132,7 @@ void CRC32::Update(const byte *s, size_t n)
while (n >= 4)
{
- crc ^= *(const word32 *)s;
+ crc ^= *(const word32 *)(void*)s;
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);
crc = m_tab[CRC32_INDEX(crc)] ^ CRC32_SHIFTED(crc);