Browse Source

re-enable "unused-parameters" warning

Steffen Jaeckel 11 years ago
parent
commit
473b0319ad

+ 1 - 1
makefile

@@ -37,7 +37,7 @@ endif
 endif
 
 # Compilation flags. Note the += does not write over the user's CFLAGS!
-CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE
+CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE
 
 # additional warnings (newer GCC 3.4 and higher)
 ifdef GCC_34

+ 1 - 0
src/ciphers/aes/aes.c

@@ -725,6 +725,7 @@ int ECB_TEST(void)
 */
 void ECB_DONE(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 

+ 1 - 0
src/ciphers/anubis.c

@@ -1520,6 +1520,7 @@ int anubis_test(void)
 */
 void anubis_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/blowfish.c

@@ -567,6 +567,7 @@ int blowfish_test(void)
 */
 void blowfish_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 4 - 1
src/ciphers/camellia.c

@@ -721,7 +721,10 @@ int camellia_test(void)
    return CRYPT_OK;
 }
 
-void camellia_done(symmetric_key *skey) {}
+void camellia_done(symmetric_key *skey)
+{
+  LTC_UNUSED_PARAM(skey);
+}
 
 int camellia_keysize(int *keysize)
 {

+ 1 - 0
src/ciphers/cast5.c

@@ -695,6 +695,7 @@ int cast5_test(void)
 */
 void cast5_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 2 - 0
src/ciphers/des.c

@@ -1864,6 +1864,7 @@ int des3_test(void)
 */
 void des_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /** Terminate the context
@@ -1871,6 +1872,7 @@ void des_done(symmetric_key *skey)
 */
 void des3_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 

+ 1 - 0
src/ciphers/kasumi.c

@@ -236,6 +236,7 @@ int kasumi_setup(const unsigned char *key, int keylen, int num_rounds, symmetric
 
 void kasumi_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 int kasumi_keysize(int *keysize)

+ 1 - 0
src/ciphers/khazad.c

@@ -830,6 +830,7 @@ int khazad_test(void)
 */
 void khazad_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/kseed.c

@@ -298,6 +298,7 @@ int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key
 */
 void kseed_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/multi2.c

@@ -295,6 +295,7 @@ int multi2_test(void)
 */
 void multi2_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/noekeon.c

@@ -318,6 +318,7 @@ int noekeon_test(void)
 */
 void noekeon_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/rc2.c

@@ -334,6 +334,7 @@ int rc2_test(void)
 */
 void rc2_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/rc5.c

@@ -294,6 +294,7 @@ int rc5_test(void)
 */
 void rc5_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/rc6.c

@@ -321,6 +321,7 @@ int rc6_test(void)
 */
 void rc6_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/safer/safer.c

@@ -447,6 +447,7 @@ int safer_sk64_test(void)
 */
 void safer_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 int safer_sk128_test(void)

+ 1 - 0
src/ciphers/safer/saferp.c

@@ -528,6 +528,7 @@ int saferp_test(void)
 */
 void saferp_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/skipjack.c

@@ -318,6 +318,7 @@ int skipjack_test(void)
 */
 void skipjack_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/twofish/twofish.c

@@ -677,6 +677,7 @@ int twofish_test(void)
 */
 void twofish_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 1 - 0
src/ciphers/xtea.c

@@ -249,6 +249,7 @@ int xtea_test(void)
 */
 void xtea_done(symmetric_key *skey)
 {
+  LTC_UNUSED_PARAM(skey);
 }
 
 /**

+ 4 - 0
src/headers/tomcrypt_macros.h

@@ -414,6 +414,10 @@ static inline ulong64 ROR64c(ulong64 word, const int i)
    #define MIN(x, y) ( ((x)<(y))?(x):(y) )
 #endif
 
+#ifndef LTC_UNUSED_PARAM
+   #define LTC_UNUSED_PARAM(x) (void)(x)
+#endif
+
 /* extract a byte portably */
 #ifdef _MSC_VER
    #define byte(x, n) ((unsigned char)((x) >> (8 * (n))))

+ 4 - 0
src/prngs/rng_get_bytes.c

@@ -20,7 +20,10 @@
 static unsigned long rng_nix(unsigned char *buf, unsigned long len,
                              void (*callback)(void))
 {
+    LTC_UNUSED_PARAM(callback);
 #ifdef LTC_NO_FILE
+    LTC_UNUSED_PARAM(buf);
+    LTC_UNUSED_PARAM(len);
     return 0;
 #else
     FILE *f;
@@ -103,6 +106,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
 static unsigned long rng_win32(unsigned char *buf, unsigned long len,
                                void (*callback)(void))
 {
+   LTC_UNUSED_PARAM(callback);
    HCRYPTPROV hProv = 0;
    if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
                             (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) &&

+ 12 - 0
src/prngs/sprng.c

@@ -42,6 +42,7 @@ const struct ltc_prng_descriptor sprng_desc =
 */
 int sprng_start(prng_state *prng)
 {
+   LTC_UNUSED_PARAM(prng);
    return CRYPT_OK;
 }
 
@@ -54,6 +55,9 @@ int sprng_start(prng_state *prng)
 */
 int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng)
 {
+   LTC_UNUSED_PARAM(in);
+   LTC_UNUSED_PARAM(inlen);
+   LTC_UNUSED_PARAM(prng);
    return CRYPT_OK;
 }
 
@@ -64,6 +68,7 @@ int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *
 */
 int sprng_ready(prng_state *prng)
 {
+   LTC_UNUSED_PARAM(prng);
    return CRYPT_OK;
 }
 
@@ -77,6 +82,7 @@ int sprng_ready(prng_state *prng)
 unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *prng)
 {
    LTC_ARGCHK(out != NULL);
+   LTC_UNUSED_PARAM(prng);
    return rng_get_bytes(out, outlen, NULL);
 }
 
@@ -87,6 +93,7 @@ unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *p
 */
 int sprng_done(prng_state *prng)
 {
+   LTC_UNUSED_PARAM(prng);
    return CRYPT_OK;
 }
 
@@ -100,6 +107,8 @@ int sprng_done(prng_state *prng)
 int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng)
 {
    LTC_ARGCHK(outlen != NULL);
+   LTC_UNUSED_PARAM(out);
+   LTC_UNUSED_PARAM(prng);
 
    *outlen = 0;
    return CRYPT_OK;
@@ -114,6 +123,9 @@ int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng)
 */
 int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng)
 {
+  LTC_UNUSED_PARAM(in);
+  LTC_UNUSED_PARAM(inlen);
+  LTC_UNUSED_PARAM(prng);
    return CRYPT_OK;
 }