From d317881da9b2e3ecbba86fa55dfd861c07fc9606 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 31 Jul 2016 03:02:45 -0400 Subject: Fix GCC compile error under LP64 data model (Issue 236) --- rdrand.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'rdrand.cpp') diff --git a/rdrand.cpp b/rdrand.cpp index 637f5cab..cc18cc43 100644 --- a/rdrand.cpp +++ b/rdrand.cpp @@ -175,7 +175,8 @@ static int ALL_RRI_GenerateBlock(byte *output, size_t size, unsigned int safety) #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 if (_rdrand32_step((word32*)output)) #else - if (_rdrand64_step((word64*)output)) + // Cast due to GCC, http://github.com/weidai11/cryptopp/issues/236 + if (_rdrand64_step(reinterpret_cast(output))) #endif { output += sizeof(val); @@ -196,7 +197,8 @@ static int ALL_RRI_GenerateBlock(byte *output, size_t size, unsigned int safety) #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 if (_rdrand32_step(&val)) #else - if (_rdrand64_step(&val)) + // Cast due to GCC, http://github.com/weidai11/cryptopp/issues/236 + if (_rdrand64_step(reinterpret_cast(&val))) #endif { memcpy(output, &val, size); @@ -348,7 +350,8 @@ static int ALL_RSI_GenerateBlock(byte *output, size_t size, unsigned int safety) #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 if (_rdseed32_step((word32*)output)) #else - if (_rdseed64_step((word64*)output)) + // Cast due to GCC, http://github.com/weidai11/cryptopp/issues/236 + if (_rdseed64_step(reinterpret_cast(output))) #endif { output += sizeof(val); @@ -369,7 +372,8 @@ static int ALL_RSI_GenerateBlock(byte *output, size_t size, unsigned int safety) #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 if (_rdseed32_step(&val)) #else - if (_rdseed64_step(&val)) + // Cast due to GCC, http://github.com/weidai11/cryptopp/issues/236 + if (_rdseed64_step(reinterpret_cast(&val))) #endif { memcpy(output, &val, size); -- cgit v1.2.1