Cleared unused variable and function warnings

This commit is contained in:
Jeffrey Walton 2015-07-19 10:22:16 -04:00
parent 41be55ca17
commit 8f59d9af35
12 changed files with 33 additions and 6 deletions

View File

@ -15,7 +15,7 @@ void ThreeWay_TestInstantiations()
static const word32 START_E = 0x0b0b; // round constant of first encryption round
static const word32 START_D = 0xb1b1; // round constant of first decryption round
static const word32 RC_MODULUS = 0x11011;
// static const word32 RC_MODULUS = 0x11011;
static inline word32 reverseBits(word32 a)
{

View File

@ -348,6 +348,9 @@ void EncodedObjectFilter::Put(const byte *inString, size_t length)
if (m_lengthRemaining == 0)
m_state = IDENTIFIER;
case TAIL: case ALL_DONE: ;;
default: ;;
}
if (m_state == IDENTIFIER && m_level == 0)

View File

@ -640,7 +640,7 @@ void OutputPair(const NameValuePairs &v, const char *name)
{
Integer x;
bool b = v.GetValue(name, x);
assert(b);
assert(b); CRYPTOPP_UNUSED(b);
cout << name << ": \\\n ";
x.Encode(HexEncoder(new FileSink(cout), false, 64, "\\\n ").Ref(), x.MinEncodedSize());
cout << endl;

View File

@ -817,7 +817,7 @@ void HashVerificationFilter::FirstPut(const byte *inString)
{
m_expectedHash.New(m_digestSize);
if(inString)
if (inString)
memcpy(m_expectedHash, inString, m_expectedHash.size());
if (m_flags & PUT_HASH)
AttachedTransformation()->Put(inString, m_expectedHash.size());

View File

@ -26,6 +26,7 @@ extern "C" {_CRTIMP void __cdecl _CRT_DEBUGGER_HOOK(int);}
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic ignored "-Wunused-value"
# pragma GCC diagnostic ignored "-Wunused-variable"
# pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#endif
NAMESPACE_BEGIN(CryptoPP)

9
hkdf.h
View File

@ -10,6 +10,11 @@
#include <cstring>
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-variable"
#endif
NAMESPACE_BEGIN(CryptoPP)
//! abstract base class for key derivation function
@ -84,4 +89,8 @@ unsigned int HKDF<T>::DeriveKey(byte *derived, size_t derivedLen, const byte *se
NAMESPACE_END
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic pop
#endif
#endif // CRYPTOPP_HASH_KEY_DERIVATION_FUNCTION_H

View File

@ -16,6 +16,8 @@ lword LimitedBandwidth::ComputeCurrentTransceiveLimit()
return ULONG_MAX;
double curTime = GetCurTimeAndCleanUp();
CRYPTOPP_UNUSED(curTime);
lword total = 0;
for (OpQueue::size_type i=0; i!=m_ops.size(); ++i)
total += m_ops[i].second;

View File

@ -73,6 +73,11 @@ being unloaded from L1 cache, until that round is finished.
#include "misc.h"
#include "cpu.h"
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
NAMESPACE_BEGIN(CryptoPP)
#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
@ -1259,5 +1264,9 @@ size_t Rijndael::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo
NAMESPACE_END
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic pop
#endif
#endif
#endif

2
rw.cpp
View File

@ -11,7 +11,9 @@
#ifndef CRYPTOPP_IMPORTS
#ifdef _OPENMP
static const bool CRYPTOPP_RW_USE_OMP = false;
#endif
NAMESPACE_BEGIN(CryptoPP)

View File

@ -286,6 +286,7 @@ bool TestOS_RNG()
RandomNumberSource test(*rng, UINT_MAX, false, new Deflator(new Redirector(meter)));
unsigned long total=0, length=0;
time_t t = time(NULL), t1 = 0;
CRYPTOPP_UNUSED(length);
// check that it doesn't take too long to generate a reasonable amount of randomness
while (total < 16 && (t1 < 10 || total*8 > (unsigned long)t1))

View File

@ -27,9 +27,9 @@ void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer
do
{
bool qFound = q.Randomize(rng, minQ, maxQ, Integer::PRIME, 7, 12);
assert(qFound);
assert(qFound); CRYPTOPP_UNUSED(qFound);
bool solutionsExist = SolveModularQuadraticEquation(r1, r2, 1, -1, 1, q);
assert(solutionsExist);
assert(solutionsExist); CRYPTOPP_UNUSED(solutionsExist);
} while (!p.Randomize(rng, minP, maxP, Integer::PRIME, CRT(rng.GenerateBit()?r1:r2, q, 2, 3, EuclideanMultiplicativeInverse(p, 3)), 3*q));
assert(((p.Squared() - p + 1) % q).IsZero());

View File

@ -36,7 +36,7 @@ inline bool LowFirstBitReader::FillBuffer(unsigned int length)
inline unsigned long LowFirstBitReader::PeekBits(unsigned int length)
{
bool result = FillBuffer(length);
assert(result);
assert(result); CRYPTOPP_UNUSED(result);
return m_buffer & (((unsigned long)1 << length) - 1);
}