Cleared "unused parameter" warning with GCC 5.1 and -Wextra

pull/35/head
Jeffrey Walton 2015-07-23 20:14:15 -04:00
parent db40142116
commit 20e652abbb
7 changed files with 31 additions and 10 deletions

View File

@ -49,7 +49,7 @@ public:
AbstractRing() {m_mg.m_pRing = this;}
AbstractRing(const AbstractRing &source) : AbstractGroup<T>(source) {m_mg.m_pRing = this;}
AbstractRing& operator=(const AbstractRing &source) {CRYTPOPP_UNUSED(source);return *this;}
AbstractRing& operator=(const AbstractRing &source) {CRYPTOPP_UNUSED(source);return *this;}
virtual bool IsUnit(const Element &a) const =0;
virtual const Element& MultiplicativeIdentity() const =0;
@ -209,7 +209,7 @@ public:
{Element::Divide(r, q, a, d);}
bool operator==(const EuclideanDomainOf<T> &rhs) const
{return true;}
{CRYPTOPP_UNUSED(rhs);return true;}
private:
mutable Element result;

View File

@ -405,12 +405,12 @@ void BERGeneralDecoder::Init(byte asnTag)
BERGeneralDecoder::~BERGeneralDecoder()
{
try // avoid throwing in constructor
try // avoid throwing in desstructor
{
if (!m_finished)
MessageEnd();
}
catch (...)
catch (const Exception&)
{
}
}
@ -496,12 +496,12 @@ DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
DERGeneralEncoder::~DERGeneralEncoder()
{
try // avoid throwing in constructor
try // avoid throwing in destructor
{
if (!m_finished)
MessageEnd();
}
catch (...)
catch (const Exception&)
{
}
}

View File

@ -2,9 +2,17 @@
#define CRYPTOPP_OBJFACT_H
#include "cryptlib.h"
#include "misc.h"
#include <map>
#include <vector>
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-value"
# pragma GCC diagnostic ignored "-Wunused-variable"
# pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
NAMESPACE_BEGIN(CryptoPP)
//! _
@ -133,4 +141,8 @@ void RegisterAuthenticatedSymmetricCipherDefaultFactories(const char *name=NULL,
NAMESPACE_END
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic push
#endif
#endif

View File

@ -5,8 +5,15 @@
#ifndef CRYPTOPP_IMPORTS
#include "fips140.h"
#include "misc.h"
#include "trdlocal.h" // needs to be included last for cygwin
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic ignored "-Wunused-value"
# pragma GCC diagnostic ignored "-Wunused-variable"
# pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
NAMESPACE_BEGIN(CryptoPP)
// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during

View File

@ -15,7 +15,7 @@ public:
GF256(byte modulus) : m_modulus(modulus) {}
Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const
{return rng.GenerateByte();}
{CRYPTOPP_UNUSED(ignored);return rng.GenerateByte();}
bool Equal(Element a, Element b) const
{return a==b;}
@ -39,7 +39,7 @@ public:
{return a^=b;}
Element Double(Element a) const
{return 0;}
{CRYPTOPP_UNUSED(a);return 0;}
Element One() const
{return 1;}

View File

@ -2,6 +2,7 @@
#define CRYPTOPP_GF2_32_H
#include "cryptlib.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
@ -15,7 +16,7 @@ public:
GF2_32(word32 modulus=0x0000008D) : m_modulus(modulus) {}
Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const
{return rng.GenerateWord32();}
{CRYPTOPP_UNUSED(ignored);return rng.GenerateWord32();}
bool Equal(Element a, Element b) const
{return a==b;}
@ -39,7 +40,7 @@ public:
{return a^=b;}
Element Double(Element a) const
{return 0;}
{CRYPTOPP_UNUSED(a);return 0;}
Element MultiplicativeIdentity() const
{return 1;}

View File

@ -2,6 +2,7 @@
#include "pch.h"
#include "xtr.h"
#include "misc.h"
#include "nbtheory.h"
#include "algebra.cpp"