From a0dfd09875aca94c5f8bdb5d6e68284df5a7353f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 4 Sep 2023 16:48:41 +0200 Subject: [PATCH] crypto/{gc-rijndael,rijndael} tests: Fix some gcc -Wshadow warnings. * tests/test-gc-rijndael.c (main): Rename local variable 'i' to 'round'. * tests/test-rijndael.c (main): Likewise. --- ChangeLog | 4 ++++ tests/test-gc-rijndael.c | 10 +++++----- tests/test-rijndael.c | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf44c670fc..9b72a900a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-09-04 Bruno Haible + crypto/{gc-rijndael,rijndael} tests: Fix some gcc -Wshadow warnings. + * tests/test-gc-rijndael.c (main): Rename local variable 'i' to 'round'. + * tests/test-rijndael.c (main): Likewise. + threads-h tests: Fix gcc -Wold-style-declaration warning. * tests/test-thread_local.c (value0, value1, value2, value3): Put the 'thread_local' storage class specifier before the type. diff --git a/tests/test-gc-rijndael.c b/tests/test-gc-rijndael.c index 2439d89201..ba014d7bf3 100644 --- a/tests/test-gc-rijndael.c +++ b/tests/test-gc-rijndael.c @@ -43,7 +43,7 @@ main (int argc, char *argv[]) char ct[] = "\xC3\x4C\x05\x2C\xC0\xDA\x8D\x73" "\x45\x1A\xFE\x5F\x03\xBE\x29\x7F"; gc_cipher_handle ctx; - size_t i; + size_t round; rc = gc_cipher_open (GC_AES128, GC_ECB, &ctx); if (rc != GC_OK) @@ -55,7 +55,7 @@ main (int argc, char *argv[]) memcpy (buf, pt, 16); - for (i = 0; i < 10000; i++) + for (round = 0; round < 10000; round++) { rc = gc_cipher_encrypt_inline (ctx, 16, buf); if (rc != GC_OK) @@ -78,7 +78,7 @@ main (int argc, char *argv[]) return 1; } - for (i = 0; i < 10000; i++) + for (round = 0; round < 10000; round++) { rc = gc_cipher_decrypt_inline (ctx, 16, buf); if (rc != GC_OK) @@ -116,7 +116,7 @@ main (int argc, char *argv[]) char ct[] = "\x66\xe9\x4b\xd4\xef\x8a\x2c\x3b" "\x88\x4c\xfa\x59\xca\x34\x2b\x2e"; gc_cipher_handle ctx; - size_t i; + size_t round; rc = gc_cipher_open (GC_AES128, GC_CBC, &ctx); if (rc != GC_OK) @@ -132,7 +132,7 @@ main (int argc, char *argv[]) memcpy (buf, pt, 16); - for (i = 0; i < 10000; i++) + for (round = 0; round < 10000; round++) { rc = gc_cipher_encrypt_inline (ctx, 16, buf); if (rc != GC_OK) diff --git a/tests/test-rijndael.c b/tests/test-rijndael.c index b77ba66425..30b3d5ce50 100644 --- a/tests/test-rijndael.c +++ b/tests/test-rijndael.c @@ -34,7 +34,7 @@ main (int argc, char *argv[]) "\x00\x00\x00\x00\x00\x00\x00\x00"; char ct[] = "\xC3\x4C\x05\x2C\xC0\xDA\x8D\x73" "\x45\x1A\xFE\x5F\x03\xBE\x29\x7F"; - size_t i; + size_t round; rc = rijndaelMakeKey (&key, RIJNDAEL_DIR_ENCRYPT, 128, "00000000000000000000000000000000"); @@ -47,7 +47,7 @@ main (int argc, char *argv[]) memset (in, 0, RIJNDAEL_BITSPERBLOCK / 8); - for (i = 0; i < 10000; i++) + for (round = 0; round < 10000; round++) { rc = rijndaelBlockEncrypt (&cipher, &key, in, 128, out); if (rc < 0) @@ -78,7 +78,7 @@ main (int argc, char *argv[]) if (rc != 0) printf ("cipherInit failed %d\n", rc); - for (i = 0; i < 10000; i++) + for (round = 0; round < 10000; round++) { memcpy (in, out, RIJNDAEL_BITSPERBLOCK / 8); -- 2.39.5