The attached patch fixes several gcc "unused parameter" warnings.
Regards, Peter.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---
diff -Nur cryptopp560/cryptlib.h cryptopp560.patched/cryptlib.h
--- cryptopp560/cryptlib.h 2009-03-15 01:48:02.000000000 +0100
+++ cryptopp560.patched/cryptlib.h 2009-08-25 13:58:16.807518600 +0200
@@ -321,7 +321,7 @@
class CRYPTOPP_DLL NullNameValuePairs : public NameValuePairs
{
public:
- bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const {return false;}
+ bool GetVoidValue(const char *, const std::type_info &, void *) const {return false;}
};
//! _
@@ -406,7 +406,7 @@
//! returns maximal length of IVs accepted by this object
virtual unsigned int MaxIVLength() const {return IVSize();}
//! resynchronize with an IV. ivLength=-1 means use IVSize()
- virtual void Resynchronize(const byte *iv, int ivLength=-1) {throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");}
+ virtual void Resynchronize(const byte *, int =-1) {throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");}
//! get a secure IV for the next message
/*! This method should be called after you finish encrypting one message and are ready to start the next one.
After calling it, you must call SetKey() or Resynchronize() before using this object again.
@@ -517,7 +517,7 @@
//! returns whether this cipher supports random access
virtual bool IsRandomAccess() const =0;
//! for random access ciphers, seek to an absolute position
- virtual void Seek(lword n)
+ virtual void Seek(lword)
{
assert(!IsRandomAccess());
throw NotImplemented("StreamTransformation: this object doesn't support random access");
@@ -667,7 +667,7 @@
protected:
const Algorithm & GetAlgorithm() const {return *static_cast<const MessageAuthenticationCode *>(this);}
- virtual void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) {}
+ virtual void UncheckedSpecifyDataLengths(lword, lword, lword) {}
};
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
@@ -681,7 +681,7 @@
{
public:
//! update RNG state with additional unpredictable values
- virtual void IncorporateEntropy(const byte *input, size_t length) {throw NotImplemented("RandomNumberGenerator: IncorporateEntropy not implemented");}
+ virtual void IncorporateEntropy(const byte *, size_t) {throw NotImplemented("RandomNumberGenerator: IncorporateEntropy not implemented");}
//! returns true if IncorporateEntropy is implemented
virtual bool CanIncorporateEntropy() const {return false;}
@@ -843,9 +843,9 @@
//! \name SIGNALS
//@{
- virtual void IsolatedInitialize(const NameValuePairs ¶meters) {throw NotImplemented("BufferedTransformation: this object can't be reinitialized");}
+ virtual void IsolatedInitialize(const NameValuePairs &) {throw NotImplemented("BufferedTransformation: this object can't be reinitialized");}
virtual bool IsolatedFlush(bool hardFlush, bool blocking) =0;
- virtual bool IsolatedMessageSeriesEnd(bool blocking) {return false;}
+ virtual bool IsolatedMessageSeriesEnd(bool) {return false;}
//! initialize or reinitialize this object
virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1);
@@ -867,7 +867,7 @@
//! set propagation of automatically generated and transferred signals
/*! propagation == 0 means do not automaticly generate signals */
- virtual void SetAutoSignalPropagation(int propagation) {}
+ virtual void SetAutoSignalPropagation(int) {}
//!
virtual int GetAutoSignalPropagation() const {return 0;}
@@ -1026,7 +1026,7 @@
virtual const BufferedTransformation *AttachedTransformation() const
{return const_cast<BufferedTransformation *>(this)->AttachedTransformation();}
//! delete the current attachment chain and replace it with newAttachment
- virtual void Detach(BufferedTransformation *newAttachment = 0)
+ virtual void Detach(BufferedTransformation * = 0)
{assert(!Attachable()); throw NotImplemented("BufferedTransformation: this object is not attachable");}
//! add newAttachment to the end of attachment chain
virtual void Attach(BufferedTransformation *newAttachment);
@@ -1075,14 +1075,14 @@
// virtual std::vector<std::string> GetSupportedFormats(bool includeSaveOnly=false, bool includeLoadOnly=false);
//! save key into a BufferedTransformation
- virtual void Save(BufferedTransformation &bt) const
+ virtual void Save(BufferedTransformation &) const
{throw NotImplemented("CryptoMaterial: this object does not support saving");}
//! load key from a BufferedTransformation
/*! \throws KeyingErr if decode fails
\note Generally does not check that the key is valid.
Call ValidateKey() or ThrowIfInvalidKey() to check that. */
- virtual void Load(BufferedTransformation &bt)
+ virtual void Load(BufferedTransformation &)
{throw NotImplemented("CryptoMaterial: this object does not support loading");}
//! \return whether this object supports precomputation
@@ -1091,13 +1091,13 @@
/*! The exact semantics of Precompute() is varies, but
typically it means calculate a table of n objects
that can be used later to speed up computation. */
- virtual void Precompute(unsigned int n)
+ virtual void Precompute(unsigned int)
{assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");}
//! retrieve previously saved precomputation
- virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)
+ virtual void LoadPrecomputation(BufferedTransformation &)
{assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");}
//! save precomputation for later use
- virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
+ virtual void SavePrecomputation(BufferedTransformation &) const
{assert(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");}
// for internal library use
@@ -1117,7 +1117,7 @@
//! generate a random key or crypto parameters
/*! \throws KeyingErr if algorithm parameters are invalid, or if a key can't be generated
(e.g., if this is a public key object) */
- virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs)
+ virtual void GenerateRandom(RandomNumberGenerator &, const NameValuePairs & = g_nullNameValuePairs)
{throw NotImplemented("GeneratableCryptoMaterial: this object does not support key/parameter generation");}
//! calls the above function with a NameValuePairs object that just specifies "KeySize"
@@ -1318,7 +1318,7 @@
virtual size_t SignatureLength() const =0;
//! maximum signature length produced for a given length of recoverable message part
- virtual size_t MaxSignatureLength(size_t recoverablePartLength = 0) const {return SignatureLength();}
+ virtual size_t MaxSignatureLength(size_t = 0) const {return SignatureLength();}
//! length of longest message that can be recovered, or 0 if this signature scheme does not support message recovery
virtual size_t MaxRecoverableLength() const =0;
@@ -1351,7 +1351,7 @@
unsigned int DigestSize() const
{throw NotImplemented("PK_MessageAccumulator: DigestSize() should not be called");}
//! should not be called on PK_MessageAccumulator
- void TruncatedFinal(byte *digest, size_t digestSize)
+ void TruncatedFinal(byte *, size_t)
{throw NotImplemented("PK_MessageAccumulator: TruncatedFinal() should not be called");}
};
diff -Nur cryptopp560/filters.h cryptopp560.patched/filters.h
--- cryptopp560/filters.h 2009-03-15 01:48:00.000000000 +0100
+++ cryptopp560.patched/filters.h 2009-08-25 13:58:16.823143700 +0200
@@ -89,7 +89,7 @@
void SetTransparent(bool transparent) {m_transparent = transparent;}
void AddRangeToSkip(unsigned int message, lword position, lword size, bool sortNow = true);
void ResetMeter();
- void IsolatedInitialize(const NameValuePairs ¶meters) {ResetMeter();}
+ void IsolatedInitialize(const NameValuePairs &) {ResetMeter();}
lword GetCurrentMessageBytes() const {return m_currentMessageBytes;}
lword GetTotalBytes() {return m_totalBytes;}
@@ -169,14 +169,14 @@
protected:
bool DidFirstPut() {return m_firstInputDone;}
- virtual void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &firstSize, size_t &blockSize, size_t &lastSize)
+ virtual void InitializeDerivedAndReturnNewSizes(const NameValuePairs ¶meters, size_t &, size_t &, size_t &)
{InitializeDerived(parameters);}
- virtual void InitializeDerived(const NameValuePairs ¶meters) {}
+ virtual void InitializeDerived(const NameValuePairs &) {}
// FirstPut() is called if (firstSize != 0 and totalLength >= firstSize)
// or (firstSize == 0 and (totalLength > 0 or a MessageEnd() is received))
virtual void FirstPut(const byte *inString) =0;
// NextPut() is called if totalLength >= firstSize+blockSize+lastSize
- virtual void NextPutSingle(const byte *inString) {assert(false);}
+ virtual void NextPutSingle(const byte *) {assert(false);}
// Same as NextPut() except length can be a multiple of blockSize
// Either NextPut() or NextPutMultiple() must be overriden
virtual void NextPutMultiple(const byte *inString, size_t length);
@@ -200,7 +200,7 @@
// This function should no longer be used, put this here to cause a compiler error
// if someone tries to override NextPut().
- virtual int NextPut(const byte *inString, size_t length) {assert(false); return 0;}
+ virtual int NextPut(const byte *, size_t) {assert(false); return 0;}
class BlockQueue
{
@@ -246,7 +246,7 @@
protected:
virtual bool IsolatedMessageEnd(bool blocking) =0;
- void IsolatedInitialize(const NameValuePairs ¶meters) {m_inQueue.Clear();}
+ void IsolatedInitialize(const NameValuePairs &) {m_inQueue.Clear();}
ByteQueue m_inQueue;
};
@@ -695,7 +695,7 @@
lword MaxRetrievable() const {return m_length-m_count;}
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
- size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
+ size_t CopyRangeTo2(BufferedTransformation &, lword &, lword =LWORD_MAX, const std::string & =DEFAULT_CHANNEL, bool =true) const
{
throw NotImplemented("RandomNumberStore: CopyRangeTo2() is not supported by this store");
}
@@ -712,7 +712,7 @@
{
public:
NullStore(lword size = ULONG_MAX) : m_size(size) {}
- void StoreInitialize(const NameValuePairs ¶meters) {}
+ void StoreInitialize(const NameValuePairs &) {}
lword MaxRetrievable() const {return m_size;}
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const;
diff -Nur cryptopp560/misc.h cryptopp560.patched/misc.h
--- cryptopp560/misc.h 2009-03-15 01:48:00.000000000 +0100
+++ cryptopp560.patched/misc.h 2009-08-25 13:58:16.838768800 +0200
@@ -331,7 +331,7 @@
}
template <class T>
-inline unsigned int GetAlignmentOf(T *dummy=NULL) // VC60 workaround
+inline unsigned int GetAlignmentOf(T * =NULL) // VC60 workaround
{
#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
if (sizeof(T) < 16)
diff -Nur cryptopp560/secblock.h cryptopp560.patched/secblock.h
--- cryptopp560/secblock.h 2009-03-15 01:48:02.000000000 +0100
+++ cryptopp560.patched/secblock.h 2009-08-25 13:58:16.838768800 +0200
@@ -176,13 +176,13 @@
public:
CRYPTOPP_INHERIT_ALLOCATOR_TYPES
- pointer allocate(size_type n, const void * = NULL)
+ pointer allocate(size_type, const void * = NULL)
{
assert(false);
return NULL;
}
- void deallocate(void *p, size_type n)
+ void deallocate(void *, size_type)
{
assert(false);
}
diff -Nur cryptopp560/simple.h cryptopp560.patched/simple.h
--- cryptopp560/simple.h 2009-03-15 01:48:00.000000000 +0100
+++ cryptopp560.patched/simple.h 2009-08-25 13:58:16.838768800 +0200
@@ -49,7 +49,7 @@
class CRYPTOPP_NO_VTABLE Bufferless : public T
{
public:
- bool IsolatedFlush(bool hardFlush, bool blocking) {return false;}
+ bool IsolatedFlush(bool, bool) {return false;}
};
//! _
@@ -59,7 +59,7 @@
public:
bool Flush(bool completeFlush, int propagation=-1, bool blocking=true)
{return ChannelFlush(DEFAULT_CHANNEL, completeFlush, propagation, blocking);}
- bool IsolatedFlush(bool hardFlush, bool blocking)
+ bool IsolatedFlush(bool, bool)
{assert(false); return false;}
bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true)
{
@@ -85,12 +85,12 @@
{InputRejected() : NotImplemented("BufferedTransformation: this object doesn't allow input") {}};
// shouldn't be calling these functions on this class
- size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
+ size_t Put2(const byte *, size_t, int, bool)
{throw InputRejected();}
bool IsolatedFlush(bool, bool) {return false;}
bool IsolatedMessageSeriesEnd(bool) {throw InputRejected();}
- size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking)
+ size_t ChannelPut2(const std::string &, const byte *, size_t, int, bool)
{throw InputRejected();}
bool ChannelMessageSeriesEnd(const std::string &, int, bool) {throw InputRejected();}
};
@@ -103,7 +103,7 @@
virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) =0;
private:
- bool IsolatedFlush(bool hardFlush, bool blocking) {assert(false); return false;}
+ bool IsolatedFlush(bool, bool) {assert(false); return false;}
};
//! _
@@ -114,7 +114,7 @@
virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1) =0;
private:
- void IsolatedInitialize(const NameValuePairs ¶meters) {assert(false);}
+ void IsolatedInitialize(const NameValuePairs &) {assert(false);}
};
//! _
@@ -189,9 +189,9 @@
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Sink : public BufferedTransformation
{
public:
- size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true)
+ size_t TransferTo2(BufferedTransformation &, lword &transferBytes, const std::string & =DEFAULT_CHANNEL, bool =true)
{transferBytes = 0; return 0;}
- size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const
+ size_t CopyRangeTo2(BufferedTransformation &, lword &, lword =LWORD_MAX, const std::string & =DEFAULT_CHANNEL, bool =true) const
{return 0;}
};
@@ -199,8 +199,8 @@
{
public:
std::string AlgorithmName() const {return "BitBucket";}
- void IsolatedInitialize(const NameValuePairs ¶meters) {}
- size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
+ void IsolatedInitialize(const NameValuePairs &) {}
+ size_t Put2(const byte *, size_t, int, bool)
{return 0;}
};