Cleared "unused parameter" warning with GCC 5.1 and -Wextra
parent
e87857f67d
commit
35b213c085
|
|
@ -2,6 +2,7 @@
|
||||||
#define CRYPTOPP_ALGEBRA_H
|
#define CRYPTOPP_ALGEBRA_H
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
|
@ -47,8 +48,8 @@ public:
|
||||||
typedef T Element;
|
typedef T Element;
|
||||||
|
|
||||||
AbstractRing() {m_mg.m_pRing = this;}
|
AbstractRing() {m_mg.m_pRing = this;}
|
||||||
AbstractRing(const AbstractRing &source) {m_mg.m_pRing = this;}
|
AbstractRing(const AbstractRing &source) : AbstractGroup<T>(source) {m_mg.m_pRing = this;}
|
||||||
AbstractRing& operator=(const AbstractRing &source) {return *this;}
|
AbstractRing& operator=(const AbstractRing &source) {CRYTPOPP_UNUSED(source);return *this;}
|
||||||
|
|
||||||
virtual bool IsUnit(const Element &a) const =0;
|
virtual bool IsUnit(const Element &a) const =0;
|
||||||
virtual const Element& MultiplicativeIdentity() const =0;
|
virtual const Element& MultiplicativeIdentity() const =0;
|
||||||
|
|
|
||||||
14
cryptlib.h
14
cryptlib.h
|
|
@ -82,6 +82,16 @@ and getting me started with this manual.
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "stdcpp.h"
|
#include "stdcpp.h"
|
||||||
|
|
||||||
|
// We can't include "misc.h" due to circular references....
|
||||||
|
#define GCC_DIAGNOSTIC_AWARE_X ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) || defined(__clang__))
|
||||||
|
|
||||||
|
#if GCC_DIAGNOSTIC_AWARE_X
|
||||||
|
# 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)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
// forward declarations
|
// forward declarations
|
||||||
|
|
@ -1673,4 +1683,8 @@ typedef AuthenticatedKeyAgreementDomain PK_AuthenticatedKeyAgreementDomain;
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
#if GCC_DIAGNOSTIC_AWARE_X
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
1
misc.h
1
misc.h
|
|
@ -60,6 +60,7 @@
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wunused-value"
|
# pragma GCC diagnostic ignored "-Wunused-value"
|
||||||
# pragma GCC diagnostic ignored "-Wunused-variable"
|
# pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ public:
|
||||||
Element RandomElement( RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0 ) const
|
Element RandomElement( RandomNumberGenerator &rng , const RandomizationParameter &ignore_for_now = 0 ) const
|
||||||
// left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct
|
// left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct
|
||||||
{
|
{
|
||||||
|
CRYPTOPP_UNUSED(ignore_for_now);
|
||||||
return Element( rng , Integer( (long) 0) , m_modulus - Integer( (long) 1 ) ) ;
|
return Element( rng , Integer( (long) 0) , m_modulus - Integer( (long) 1 ) ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
28
secblock.h
28
secblock.h
|
|
@ -5,7 +5,13 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <assert.h>
|
|
||||||
|
#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)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
|
@ -142,13 +148,13 @@ public:
|
||||||
|
|
||||||
pointer allocate(size_type n, const void * = NULL)
|
pointer allocate(size_type n, const void * = NULL)
|
||||||
{
|
{
|
||||||
assert(false);
|
CRYPTOPP_ASSERT(false);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(void *p, size_type n)
|
void deallocate(void *p, size_type n)
|
||||||
{
|
{
|
||||||
assert(false);
|
CRYPTOPP_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type max_size() const {return 0;}
|
size_type max_size() const {return 0;}
|
||||||
|
|
@ -167,7 +173,7 @@ public:
|
||||||
|
|
||||||
pointer allocate(size_type n)
|
pointer allocate(size_type n)
|
||||||
{
|
{
|
||||||
assert(IsAlignedOn(m_array, 8));
|
CRYPTOPP_ASSERT(IsAlignedOn(m_array, 8));
|
||||||
|
|
||||||
if (n <= S && !m_allocated)
|
if (n <= S && !m_allocated)
|
||||||
{
|
{
|
||||||
|
|
@ -193,8 +199,8 @@ public:
|
||||||
{
|
{
|
||||||
if (p == GetAlignedArray())
|
if (p == GetAlignedArray())
|
||||||
{
|
{
|
||||||
assert(n <= S);
|
CRYPTOPP_ASSERT(n <= S);
|
||||||
assert(m_allocated);
|
CRYPTOPP_ASSERT(m_allocated);
|
||||||
m_allocated = false;
|
m_allocated = false;
|
||||||
SecureWipeArray((pointer)p, n);
|
SecureWipeArray((pointer)p, n);
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +212,7 @@ public:
|
||||||
{
|
{
|
||||||
if (p == GetAlignedArray() && newSize <= S)
|
if (p == GetAlignedArray() && newSize <= S)
|
||||||
{
|
{
|
||||||
assert(oldSize <= S);
|
CRYPTOPP_ASSERT(oldSize <= S);
|
||||||
if (oldSize > newSize)
|
if (oldSize > newSize)
|
||||||
SecureWipeArray(p+newSize, oldSize-newSize);
|
SecureWipeArray(p+newSize, oldSize-newSize);
|
||||||
return p;
|
return p;
|
||||||
|
|
@ -282,10 +288,10 @@ public:
|
||||||
// {return m_ptr+offset;}
|
// {return m_ptr+offset;}
|
||||||
|
|
||||||
// T& operator[](size_type index)
|
// T& operator[](size_type index)
|
||||||
// {assert(index >= 0 && index < m_size); return m_ptr[index];}
|
// {CRYPTOPP_ASSERT(index >= 0 && index < m_size); return m_ptr[index];}
|
||||||
|
|
||||||
// const T& operator[](size_type index) const
|
// const T& operator[](size_type index) const
|
||||||
// {assert(index >= 0 && index < m_size); return m_ptr[index];}
|
// {CRYPTOPP_ASSERT(index >= 0 && index < m_size); return m_ptr[index];}
|
||||||
|
|
||||||
iterator begin()
|
iterator begin()
|
||||||
{return m_ptr;}
|
{return m_ptr;}
|
||||||
|
|
@ -464,4 +470,8 @@ __stl_alloc_rebind(CryptoPP::AllocatorWithCleanup<_Tp1>& __a, const _Tp2*)
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
#if GCC_DIAGNOSTIC_AWARE
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
11
simple.h
11
simple.h
|
|
@ -9,6 +9,13 @@
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
#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)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! _
|
//! _
|
||||||
|
|
@ -206,4 +213,8 @@ public:
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
#if GCC_DIAGNOSTIC_AWARE
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue