From e739873910b8d8cd7ed341307ada4460fee83c67 Mon Sep 17 00:00:00 2001 From: Fredrik Roubert Date: Mon, 27 Nov 2023 23:23:32 +0100 Subject: [PATCH] ICU-22522 Delete unused variables. Clang 16 is more thorough in finding unused variables, so these must be removed to be able to compile this code using Clang 16 and -Werror. --- icu4c/source/test/cintltst/cbiditst.c | 3 +-- icu4c/source/test/intltest/rbbimonkeytest.cpp | 2 +- icu4c/source/test/intltest/rbbitst.cpp | 1 + icu4c/source/test/intltest/utxttest.cpp | 6 ++---- icu4c/source/tools/genrb/rle.c | 18 ++++++++---------- icu4c/source/tools/genrb/wrtjava.cpp | 3 --- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/icu4c/source/test/cintltst/cbiditst.c b/icu4c/source/test/cintltst/cbiditst.c index ce4c1ce57f28..37d69df48fdb 100644 --- a/icu4c/source/test/cintltst/cbiditst.c +++ b/icu4c/source/test/cintltst/cbiditst.c @@ -4539,8 +4539,7 @@ overrideBidiClass(const void *context, UChar32 c) { DEF, DEF, DEF, LRO, B, RLO, BN, DEF /* 78-7F */ }; static const int nEntries = UPRV_LENGTHOF(customClasses); - const char *dummy = context; /* just to avoid a compiler warning */ - dummy++; + (void)context; /* just to avoid a compiler warning */ return c >= nEntries ? U_BIDI_CLASS_DEFAULT : customClasses[c]; } diff --git a/icu4c/source/test/intltest/rbbimonkeytest.cpp b/icu4c/source/test/intltest/rbbimonkeytest.cpp index cd8436ac30f8..45fe3e43a419 100644 --- a/icu4c/source/test/intltest/rbbimonkeytest.cpp +++ b/icu4c/source/test/intltest/rbbimonkeytest.cpp @@ -286,7 +286,7 @@ void BreakRules::compileRules(UCHARBUF *rules, UErrorCode &status) { } UnicodeString emptyString; - for (int32_t lineNumber=0; ;lineNumber++) { // Loop once per input line. + for (;;) { // Loop once per input line. if (U_FAILURE(status)) { return; } diff --git a/icu4c/source/test/intltest/rbbitst.cpp b/icu4c/source/test/intltest/rbbitst.cpp index 2afe4b3912df..e95419afc470 100644 --- a/icu4c/source/test/intltest/rbbitst.cpp +++ b/icu4c/source/test/intltest/rbbitst.cpp @@ -4178,6 +4178,7 @@ void RBBITest::RunMonkey(BreakIterator *bi, RBBIMonkeyKind &mk, const char *name expectedBreaks[breakPos] = 1; expectedCount++; U_ASSERT(expectedCountfCount > 0) { current = res->fFirst; - i = 0; while(current != nullptr){ if(!current->isString()){ allStrings = false; @@ -370,7 +368,6 @@ array_write_java(const ArrayResource *res, UErrorCode *status) { if(U_FAILURE(*status)){ return; } - i++; current = current->fNext; } T_FileStream_write(out,"\n",1);