diff --git a/icu4c/source/common/iculserv.cpp b/icu4c/source/common/iculserv.cpp index 6bb908a8d20..29d2de08221 100644 --- a/icu4c/source/common/iculserv.cpp +++ b/icu4c/source/common/iculserv.cpp @@ -661,7 +661,7 @@ ICUResourceBundleFactory::handleCreate(const Locale& loc, int32_t /* kind */, co char pkg[20]; int32_t length; length=_bundleName.extract(0, INT32_MAX, pkg, (int32_t)sizeof(pkg), US_INV); - if(length>=sizeof(pkg)) { + if(length>=(int32_t)sizeof(pkg)) { return NULL; } return new ResourceBundle(pkg, loc, status); diff --git a/icu4c/source/common/rbbiscan.cpp b/icu4c/source/common/rbbiscan.cpp index 3953329623b..13c44c42ba0 100644 --- a/icu4c/source/common/rbbiscan.cpp +++ b/icu4c/source/common/rbbiscan.cpp @@ -1061,13 +1061,15 @@ void RBBIRuleScanner::parse() { // printNodeStack for debugging... // //--------------------------------------------------------------------------------- -void RBBIRuleScanner::printNodeStack(const char *title) { #ifdef RBBI_DEBUG +void RBBIRuleScanner::printNodeStack(const char *) {} +#else +void RBBIRuleScanner::printNodeStack(const char *title) { int i; RBBIDebugPrintf("%s. Dumping node stack...\n", title); for (i=fNodeStackPtr; i>0; i--) {fNodeStack[i]->printTree(TRUE);} -#endif } +#endif diff --git a/icu4c/source/i18n/dcfmtsym.cpp b/icu4c/source/i18n/dcfmtsym.cpp index 74d658d7d4e..d9b4d484d82 100644 --- a/icu4c/source/i18n/dcfmtsym.cpp +++ b/icu4c/source/i18n/dcfmtsym.cpp @@ -208,14 +208,12 @@ DecimalFormatSymbols::initialize(const UChar** numberElements, int32_t *numberEl {kPlusSignSymbol, 11}, {kMonetarySeparatorSymbol, 0} }; - static const int32_t TYPE_MAPPING_LEN = (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0])); int32_t idx; - if (numberElementsLength > TYPE_MAPPING_LEN) { - numberElementsLength = TYPE_MAPPING_LEN; - } - for (idx = 0; idx < numberElementsLength; idx++) { - fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]); + for (idx = 0; idx < (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0])); idx++) { + if (TYPE_MAPPING[idx][1] < numberElementsLength) { + fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]); + } } // Default values until it's set later on. diff --git a/icu4c/source/i18n/rbnf.cpp b/icu4c/source/i18n/rbnf.cpp index 957fc5cf976..dbb8cf5b366 100644 --- a/icu4c/source/i18n/rbnf.cpp +++ b/icu4c/source/i18n/rbnf.cpp @@ -900,7 +900,7 @@ RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& st if (cap > 64) { bp = new char[cap]; } - int32_t len = name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant); + name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant); Locale retLocale(bp); if (bp != buffer) { delete[] bp; diff --git a/icu4c/source/i18n/tridpars.cpp b/icu4c/source/i18n/tridpars.cpp index 9b6326d8d54..3aadb70c0d9 100644 --- a/icu4c/source/i18n/tridpars.cpp +++ b/icu4c/source/i18n/tridpars.cpp @@ -652,7 +652,6 @@ void TransliteratorIDParser::registerSpecialInverse(const UnicodeString& target, umtx_init(&LOCK); Mutex lock(&LOCK); - UErrorCode ec = U_ZERO_ERROR; SPECIAL_INVERSES->put(target, new UnicodeString(inverseTarget), status); if (bidirectional) { SPECIAL_INVERSES->put(inverseTarget, new UnicodeString(target), status);