Skip to content

Commit

Permalink
re-enable "unused-parameters" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaeckel committed Aug 24, 2014
1 parent 01c34dc commit 473b031
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/aes/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ int ECB_TEST(void)
*/
void ECB_DONE(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}


Expand Down
1 change: 1 addition & 0 deletions src/ciphers/anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,7 @@ int anubis_test(void)
*/
void anubis_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/blowfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ int blowfish_test(void)
*/
void blowfish_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/ciphers/camellia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/cast5.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ int cast5_test(void)
*/
void cast5_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/ciphers/des.c
Original file line number Diff line number Diff line change
Expand Up @@ -1864,13 +1864,15 @@ int des3_test(void)
*/
void des_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/** Terminate the context
@param skey The scheduled key
*/
void des3_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}


Expand Down
1 change: 1 addition & 0 deletions src/ciphers/kasumi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/khazad.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ int khazad_test(void)
*/
void khazad_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/kseed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/multi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ int multi2_test(void)
*/
void multi2_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/noekeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ int noekeon_test(void)
*/
void noekeon_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/rc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ int rc2_test(void)
*/
void rc2_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/rc5.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ int rc5_test(void)
*/
void rc5_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/rc6.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ int rc6_test(void)
*/
void rc6_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/safer/safer.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ int safer_sk64_test(void)
*/
void safer_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

int safer_sk128_test(void)
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/safer/saferp.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ int saferp_test(void)
*/
void saferp_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/skipjack.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ int skipjack_test(void)
*/
void skipjack_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/twofish/twofish.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ int twofish_test(void)
*/
void twofish_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/ciphers/xtea.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ int xtea_test(void)
*/
void xtea_done(symmetric_key *skey)
{
LTC_UNUSED_PARAM(skey);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/headers/tomcrypt_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
4 changes: 4 additions & 0 deletions src/prngs/rng_get_bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) &&
Expand Down
12 changes: 12 additions & 0 deletions src/prngs/sprng.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const struct ltc_prng_descriptor sprng_desc =
*/
int sprng_start(prng_state *prng)
{
LTC_UNUSED_PARAM(prng);
return CRYPT_OK;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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);
}

Expand All @@ -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;
}

Expand All @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 473b031

Please sign in to comment.