From: Bruno Haible Date: Mon, 4 Sep 2023 15:43:50 +0000 (+0200) Subject: unistr/u{8,16,32}-strchr tests: Fix some gcc -Wshadow warnings. X-Git-Tag: v1.0~827 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d36c317360810bea235c4fb56340468b9499fe81;p=gnulib.git 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'. --- diff --git a/ChangeLog b/ChangeLog index ec5ca2b68d..faf7eb7a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-09-04 Bruno Haible + 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'. diff --git a/tests/unistr/test-strchr.h b/tests/unistr/test-strchr.h index 6d932045d8..20a239c3e2 100644 --- a/tests/unistr/test-strchr.h +++ b/tests/unistr/test-strchr.h @@ -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;