From 3db6f361d20d777ce87434a9fd3c0e3500601ebf Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 20 Aug 2017 07:15:02 -0400 Subject: [PATCH] Fix compile under MSVC (ClCompile target) -> validat1.cpp(1081): warning C4800: 'CryptoPP::word32' : forcing value to bool 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj] validat1.cpp(1090): warning C4800: 'CryptoPP::word32' : forcing value to bool 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj] validat1.cpp(1099): warning C4800: 'CryptoPP::word32' : forcing value to bool 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj] --- validat1.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validat1.cpp b/validat1.cpp index fdeaaaed..5bd050ca 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -1078,7 +1078,7 @@ bool TestMersenne() std::cout << " VIA RNG is activated\n"; // Bit 13 should be unset - fail = (msr & (1 << 13U)); + fail = !!(msr & (1 << 13U)); pass &= !fail; if (fail) std::cout << "FAILED:"; @@ -1087,7 +1087,7 @@ bool TestMersenne() std::cout << " von Neumann corrector is activated\n"; // Bit 14 should be unset - fail = (msr & (1 << 14U)); + fail = !!(msr & (1 << 14U)); pass &= !fail; if (fail) std::cout << "FAILED:"; @@ -1096,7 +1096,7 @@ bool TestMersenne() std::cout << " String filter is deactivated\n"; // Bit 12:10 should be unset - fail = (msr & (0x7 << 10U)); + fail = !!(msr & (0x7 << 10U)); pass &= !fail; if (fail) std::cout << "FAILED:";