Skip to content

Commit

Permalink
Cleanup warnings under MSC
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jan 21, 2018
1 parent d6cf3b5 commit 1df1d25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
16 changes: 1 addition & 15 deletions algparam.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// algparam.h - originally written and placed in the public domain by Wei Dai

/// \file
/// \headerfile algparam.h
/// \file algparam.h
/// \brief Classes for working with NameValuePairs


Expand All @@ -11,14 +10,6 @@
#include "config.h"
#include "cryptlib.h"

#if CRYPTOPP_MSC_VERSION
# pragma warning(push)
# pragma warning(disable: 4231 4275)
# if (CRYPTOPP_MSC_VERSION >= 1400)
# pragma warning(disable: 6011 6386 28193)
# endif
#endif

#include "smartptr.h"
#include "secblock.h"
#include "integer.h"
Expand Down Expand Up @@ -516,11 +507,6 @@ AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwI
#define CRYPTOPP_SET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Set##name)
#define CRYPTOPP_SET_FUNCTION_ENTRY2(name1, name2) (Name::name1(), Name::name2(), &ThisClass::Set##name1##And##name2)

// TODO: fix 6011 when the API/ABI can change
#if (CRYPTOPP_MSC_VERSION >= 1400)
# pragma warning(pop)
#endif

NAMESPACE_END

#endif
1 change: 1 addition & 0 deletions mqv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// FHMQV provided by Uri Blumenthal.

#include "pch.h"
#include "config.h"
#include "mqv.h"
#include "hmqv.h"
#include "fhmqv.h"
Expand Down
4 changes: 4 additions & 0 deletions padlkrng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
// find copies of the Programmer's manual, Cryptography Research Inc audit
// report, and other goodies at http://www.cryptopp.com/wiki/VIA_Padlock.

#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4702)
#endif

NAMESPACE_BEGIN(CryptoPP)

PadlockRNG::PadlockRNG(word32 divisor)
Expand Down
8 changes: 4 additions & 4 deletions validat4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#endif

#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
# pragma warning(disable: 4610 4510 4505 4355)
#endif

NAMESPACE_BEGIN(CryptoPP)
Expand Down Expand Up @@ -425,15 +425,15 @@ bool TestCryptoSign()
uint64_t s = STDMIN(smlen, (uint64_t)crypto_sign_BYTES);
pass = (s >= crypto_sign_BYTES) && pass;

fail = std::memcmp(sm, data.sig, s) != 0;
fail = std::memcmp(sm, data.sig, (size_t)s) != 0;
pass = !fail && pass;

uint64_t rmlen;
rc = crypto_sign_open(rm, &rmlen, sm, smlen, pk);
fail = (rc != 0); pass = !fail && pass;

pass = (l == rmlen) && pass;
fail = std::memcmp(m, rm, STDMIN(l, rmlen)) != 0;
fail = std::memcmp(m, rm, (size_t)STDMIN(l, rmlen)) != 0;
pass = !fail && pass;
}

Expand Down Expand Up @@ -470,7 +470,7 @@ bool TestCryptoSignKeys()
if(mlen && rmlen)
{
pass = (mlen == rmlen) && pass;
fail = std::memcmp(m, rm, STDMIN(mlen, rmlen)) != 0;
fail = std::memcmp(m, rm, (size_t)STDMIN(mlen, rmlen)) != 0;
pass = !fail && pass;
}

Expand Down

0 comments on commit 1df1d25

Please sign in to comment.