From b53def373698c6ed291f3fdf84982db0ab72a85f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 26 Jan 2016 10:43:51 -0500 Subject: [PATCH] Cleared -Wcast-align with unaligned access (Issue 122) --- misc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc.h b/misc.h index 02970d42..7261bfca 100644 --- a/misc.h +++ b/misc.h @@ -1944,7 +1944,7 @@ inline T GetWord(bool assumeAligned, ByteOrder order, const byte *block) // return ConditionalByteReverse(order, *reinterpret_cast(block)); CRYPTOPP_UNUSED(assumeAligned); #ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - return ConditionalByteReverse(order, *reinterpret_cast(block)); + return ConditionalByteReverse(order, *reinterpret_cast((const void *)block)); #else T temp; memcpy(&temp, block, sizeof(T)); @@ -1970,7 +1970,7 @@ inline void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, c // *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); CRYPTOPP_UNUSED(assumeAligned); #ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS - *reinterpret_cast(block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast(xorBlock) : 0); + *reinterpret_cast((void *)block) = ConditionalByteReverse(order, value) ^ (xorBlock ? *reinterpret_cast((const void *)xorBlock) : 0); #else T t1, t2 = 0; t1 = ConditionalByteReverse(order, value);