From 1ce593357f92a8789be2363fc5067f6245016931 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 29 Apr 2016 10:25:18 -0400 Subject: [PATCH] Cleared compile errors under Visual Studio .Net compilers --- blake2.cpp | 8 ++++---- ida.cpp | 2 +- integer.cpp | 4 ++-- misc.h | 2 +- zdeflate.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blake2.cpp b/blake2.cpp index 1f59210b..8724aa38 100644 --- a/blake2.cpp +++ b/blake2.cpp @@ -71,10 +71,10 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_IV }; const word64 BLAKE2_IV::iv[8] = { - 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL + W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b), + W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1), + W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f), + W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179) }; // IV and Sigma are a better fit as part of BLAKE2_Base, but that diff --git a/ida.cpp b/ida.cpp index 6bcf3ccb..363fe98a 100644 --- a/ida.cpp +++ b/ida.cpp @@ -402,7 +402,7 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo #else typedef std::reverse_iterator RevIt; #endif - const byte *x = std::find_if(RevIt(end), RevIt(begin), bind2nd(std::not_equal_to(), byte(0))).base(); + const byte *x = std::find_if(RevIt(end), RevIt(begin), std::bind2nd(std::not_equal_to(), byte(0))).base(); if (x != begin && *(x-1) == 1) { AttachedTransformation()->Put(begin, x-begin-1); diff --git a/integer.cpp b/integer.cpp index 04613e38..9930968f 100644 --- a/integer.cpp +++ b/integer.cpp @@ -4468,7 +4468,7 @@ std::string IntToString(Integer value, unsigned int base) // Specialization declared in misc.h to avoid Coverity findings. template <> CRYPTOPP_DLL -std::string IntToString(unsigned long long value, unsigned int base) +std::string IntToString(word64 value, unsigned int base) { // Hack... set the high bit for uppercase. static const unsigned int HIGH_BIT = (1U << 31); @@ -4482,7 +4482,7 @@ std::string IntToString(unsigned long long value, unsigned i std::string result; while (value > 0) { - unsigned long long digit = value % base; + word64 digit = value % base; result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; value /= base; } diff --git a/misc.h b/misc.h index cdee9de7..d9f98cad 100644 --- a/misc.h +++ b/misc.h @@ -497,7 +497,7 @@ std::string IntToString(T value, unsigned int base = 10) //! \details this template function specialization was added to suppress //! Coverity findings on IntToString() with unsigned types. template <> CRYPTOPP_DLL -std::string IntToString(unsigned long long value, unsigned int base); +std::string IntToString(word64 value, unsigned int base); //! \brief Converts an Integer to a string //! \param value the Integer to convert diff --git a/zdeflate.cpp b/zdeflate.cpp index 9643d5d7..5adfa5b8 100644 --- a/zdeflate.cpp +++ b/zdeflate.cpp @@ -663,9 +663,9 @@ void Deflator::EncodeBlock(bool eof, unsigned int blockType) { #if defined(_MSC_VER) && !defined(__MWERKS__) && (_MSC_VER <= 1300) // VC60 and VC7 workaround: built-in std::reverse_iterator has two template parameters, Dinkumware only has one - typedef reverse_bidirectional_iterator RevIt; + typedef std::reverse_bidirectional_iterator RevIt; #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator RevIt; + typedef std::reverse_iterator RevIt; #else typedef std::reverse_iterator RevIt; #endif