From 07e831947832804cbe7bc22756dd6c8403f24f36 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 23 Jul 2015 14:21:06 -0400 Subject: Cleared "unused function" warning when using GCC with -Wall --- eccrypto.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'eccrypto.cpp') diff --git a/eccrypto.cpp b/eccrypto.cpp index fe77d2bc..66c978b8 100644 --- a/eccrypto.cpp +++ b/eccrypto.cpp @@ -11,6 +11,7 @@ #include "argnames.h" #include "ec2n.h" #include "misc.h" +#include "trap.h" #if GCC_DIAGNOSTIC_AWARE # pragma GCC diagnostic ignored "-Wunused-function" @@ -32,8 +33,7 @@ static void ECDSA_TestInstantiations() } #endif -// VC60 workaround: complains when these functions are put into an anonymous namespace -static Integer ConvertToInteger(const PolynomialMod2 &x) +static inline Integer ConvertToInteger(const PolynomialMod2 &x) { unsigned int l = x.ByteCount(); SecByteBlock temp(l); @@ -118,7 +118,10 @@ struct OIDLessThan inline bool operator()(const EcRecommendedParameters& a, const EcRecommendedParameters& b) {return a.oid < b.oid;} }; -static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) +// Declare it so we can attach the attribute +static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) CRYPTOPP_UNUSED_FUNCTION; + +void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) { // this array must be sorted by OID static const EcRecommendedParameters rec[] = { @@ -253,7 +256,10 @@ static void GetRecommendedParameters(const EcRecommendedParameters *&begin end = rec + COUNTOF(rec); } -static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) +// Declare it so we can attach the unused attribute +static void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) CRYPTOPP_UNUSED_FUNCTION; + +void GetRecommendedParameters(const EcRecommendedParameters *&begin, const EcRecommendedParameters *&end) { // this array must be sorted by OID static const EcRecommendedParameters rec[] = { -- cgit v1.2.1