]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/{gc-rijndael,rijndael} tests: Fix some gcc -Wshadow warnings.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 14:48:41 +0000 (16:48 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 14 Sep 2023 10:10:13 +0000 (12:10 +0200)
* tests/test-gc-rijndael.c (main): Rename local variable 'i' to 'round'.
* tests/test-rijndael.c (main): Likewise.

ChangeLog
tests/test-gc-rijndael.c
tests/test-rijndael.c

index bf44c670fc7fa907116d656cc3d9be00dbd8211e..9b72a900a77000b601b32a978e0e18da7689bef9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-09-04  Bruno Haible  <bruno@clisp.org>
 
+       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.
index 2439d89201c4739f044f04412778562e32768697..ba014d7bf306e63bd49323ffa8b8dc993781cef7 100644 (file)
@@ -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)
index b77ba66425c292799506de720dd0c540c84e0df6..30b3d5ce5034eff6ca755e4daacaee3348c7c360 100644 (file)
@@ -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);