From 7f8d3e8882a7e4d389351802446e7bbf5726806a Mon Sep 17 00:00:00 2001 From: bobsayshilol Date: Wed, 14 Nov 2018 03:04:03 +0000 Subject: [PATCH] Miscellaneos warning fixes (GH #739) * Fix -pedantic warning in GCC. * Fix -Wunused-private-field warning. * Fix -Wkeyword-macro warning. --- des.cpp | 6 ++++-- filters.h | 2 +- gf2n.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/des.cpp b/des.cpp index 144897eb..2a130aa4 100644 --- a/des.cpp +++ b/des.cpp @@ -284,14 +284,16 @@ namespace { void RawDES::RawSetKey(CipherDir dir, const byte *key) { #if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) -# define register /* Define to nothing for C++11 and above */ +# define REGISTER /* Define to nothing for C++11 and above */ +#else +# define REGISTER register #endif SecByteBlock buffer(56+56+8); byte *const pc1m=buffer; /* place to modify pc1 into */ byte *const pcr=pc1m+56; /* place to rotate pc1 into */ byte *const ks=pcr+56; - register int i,j,l; + REGISTER int i,j,l; int m; for (j=0; j<56; j++) { /* convert pc1 to bits of key */ diff --git a/filters.h b/filters.h index 72e2550c..0118a4ac 100644 --- a/filters.h +++ b/filters.h @@ -1100,7 +1100,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS StringSinkTemplate; /// \brief Append input to a std::vector object /// \details VectorSink is a typedef for StringSinkTemplate >. -DOCUMENTED_TYPEDEF(StringSinkTemplate >, VectorSink); +DOCUMENTED_TYPEDEF(StringSinkTemplate >, VectorSink) CRYPTOPP_DLL_TEMPLATE_CLASS StringSinkTemplate >; /// \brief Incorporates input into RNG as additional entropy diff --git a/gf2n.h b/gf2n.h index 40cf3934..4bb34b19 100644 --- a/gf2n.h +++ b/gf2n.h @@ -357,13 +357,13 @@ class CRYPTOPP_DLL GF2NPP : public GF2NP public: // polynomial modulus = x^t0 + x^t1 + x^t2 + x^t3 + x^t4, t0 > t1 > t2 > t3 > t4 GF2NPP(unsigned int t0, unsigned int t1, unsigned int t2, unsigned int t3, unsigned int t4) - : GF2NP(PolynomialMod2::Pentanomial(t0, t1, t2, t3, t4)), t0(t0), t1(t1), t2(t2), t3(t3) {} + : GF2NP(PolynomialMod2::Pentanomial(t0, t1, t2, t3, t4)), t1(t1), t2(t2), t3(t3) {} GF2NP * Clone() const {return new GF2NPP(*this);} void DEREncode(BufferedTransformation &bt) const; private: - unsigned int t0, t1, t2, t3; + unsigned int t1, t2, t3; }; // construct new GF2NP from the ASN.1 sequence Characteristic-two