]> Savannah Git Hosting - gnulib.git/commitdiff
unistr/u{8,16,32}-strchr tests: Fix some gcc -Wshadow warnings.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 15:43:50 +0000 (17:43 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 15:43:50 +0000 (17:43 +0200)
* tests/unistr/test-strchr.h (test_strchr): Reduce of scope of local
variable 'i'.

ChangeLog
tests/unistr/test-strchr.h

index ec5ca2b68dff05d2c5c76be446d8244673c1117c..faf7eb7a7036b669da1d1cfdc86889b63e07984d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-09-04  Bruno Haible  <bruno@clisp.org>
 
+       unistr/u{8,16,32}-strchr tests: Fix some gcc -Wshadow warnings.
+       * tests/unistr/test-strchr.h (test_strchr): Reduce of scope of local
+       variable 'i'.
+
        unistr/u{8,16,32}-chr tests: Fix some gcc -Wshadow warnings.
        * tests/unistr/test-chr.h (main): Reduce of scope of local variables
        'i' and 'page_boundary'.
index 6d932045d856e4ff4cf17fc930f50a9d1631ad43..20a239c3e25dde4a85d22128266fd5272db49f8c 100644 (file)
@@ -22,7 +22,6 @@ test_strchr (void)
 {
   size_t size = 0x100000;
   size_t length;
-  size_t i;
   UNIT *input;
   uint32_t *input32 = (uint32_t *) malloc ((size + 1) * sizeof (uint32_t));
   ASSERT (input32);
@@ -30,7 +29,7 @@ test_strchr (void)
   input32[0] = 'a';
   input32[1] = 'b';
   u32_set (input32 + 2, 'c', 1024);
-  for (i = 1026; i < size - 2; i += 63)
+  for (size_t i = 1026; i < size - 2; i += 63)
     {
       size_t last = i + 63 < size - 2 ? i + 63 : size - 2;
       ucs4_t uc = 'd' | (i - 1026);
@@ -54,7 +53,7 @@ test_strchr (void)
     UNIT *exp = input + 1026;
     UNIT *prev = input + 2;
 
-    for (i = 1026; i < size - 2; i += 63)
+    for (size_t i = 1026; i < size - 2; i += 63)
       {
         UNIT c[6];
         size_t n;