diff --git a/icu4c/source/test/cintltst/cmsgtst.c b/icu4c/source/test/cintltst/cmsgtst.c index 8ed4969d6cc..93ef88f1f39 100644 --- a/icu4c/source/test/cintltst/cmsgtst.c +++ b/icu4c/source/test/cintltst/cmsgtst.c @@ -715,7 +715,7 @@ static void TestMsgFormatSelect(void) status=U_ZERO_ERROR; resultlength=resultLengthOut+1; result=(UChar*)malloc(sizeof(UChar) * resultlength); - u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultlength, &status, str , str1); + u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultlength, &status, str , str1, 6); if(u_strcmp(result, expected)==0) log_verbose("PASS: MessagFormat successful on Select test#2\n"); else{ diff --git a/icu4c/source/test/cintltst/tracetst.c b/icu4c/source/test/cintltst/tracetst.c index 96e503127bb..94d10046aeb 100644 --- a/icu4c/source/test/cintltst/tracetst.c +++ b/icu4c/source/test/cintltst/tracetst.c @@ -339,7 +339,7 @@ static void TestTraceAPI() { /* Null ptrs for strings, vectors */ test_format("Null string - %s", 50, 0, "Null string - *NULL*", __LINE__, NULL); - test_format("Null string - %S", 50, 0, "Null string - *NULL*", __LINE__, NULL); + test_format("Null string - %S", 50, 0, "Null string - *NULL*", __LINE__, NULL, -1); test_format("Null vector - %vc", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2); test_format("Null vector - %vC", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2); test_format("Null vector - %vd", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2); diff --git a/icu4c/source/test/intltest/numfmtst.cpp b/icu4c/source/test/intltest/numfmtst.cpp index 09e3da1b8f4..ce1432df2eb 100644 --- a/icu4c/source/test/intltest/numfmtst.cpp +++ b/icu4c/source/test/intltest/numfmtst.cpp @@ -2388,12 +2388,12 @@ void NumberFormatTest::TestCurrencyNames(void) { void NumberFormatTest::TestCurrencyUnit(void){ UErrorCode ec = U_ZERO_ERROR; - static const UChar USD[] = {85, 83, 68, 0}; /*USD*/ - static const char USD8[] = {85, 83, 68, 0}; - static const UChar BAD[] = {63, 63, 63, 0}; /*???*/ - static const UChar BAD2[] = {63, 63, 65, 0}; /*???*/ - static const UChar XXX[] = u"XXX"; - static const char XXX8[] = {88, 88, 88}; + static const UChar USD[] = u"USD"; + static const char USD8[] = "USD"; + static const UChar BAD[] = u"???"; + static const UChar BAD2[] = u"??A"; + static const UChar XXX[] = u"XXX"; + static const char XXX8[] = "XXX"; CurrencyUnit cu(USD, ec); assertSuccess("CurrencyUnit", ec); @@ -8801,8 +8801,8 @@ void NumberFormatTest::Test13327_numberingSystemBufferOverflow() { assertSuccess("Constructing locale string", status); Locale locale(localeId.data()); - NumberingSystem* ns = NumberingSystem::createInstance(locale, status); - assertFalse("Should not be null", ns == nullptr); + LocalPointer ns(NumberingSystem::createInstance(locale, status)); + assertFalse("Should not be null", ns.getAlias() == nullptr); assertSuccess("Should create with no error", status); } } diff --git a/icu4c/source/tools/gendict/gendict.cpp b/icu4c/source/tools/gendict/gendict.cpp index 73b9fec32b8..b712640091e 100644 --- a/icu4c/source/tools/gendict/gendict.cpp +++ b/icu4c/source/tools/gendict/gendict.cpp @@ -314,7 +314,7 @@ int main(int argc, char **argv) { // Read in the dictionary source file if (verbose) { printf("Opening file %s...\n", wordFileName); } const char *codepage = "UTF-8"; - UCHARBUF *f = ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status); + LocalUCHARBUFPointer f(ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status)); if (status.isFailure()) { fprintf(stderr, "error opening input file: ICU Error \"%s\"\n", status.errorName()); exit(status.reset()); @@ -338,10 +338,10 @@ int main(int argc, char **argv) { int minlen = 255; int maxlen = 0; UBool isOk = TRUE; - while (readLine(f, fileLine, status)) { + while (readLine(f.getAlias(), fileLine, status)) { lineCount++; if (fileLine.isEmpty()) continue; - + // Parse word [spaces value]. int32_t keyLen; for (keyLen = 0; keyLen < fileLine.length() && !u_isspace(fileLine[keyLen]); ++keyLen) {} diff --git a/icu4c/source/tools/genrb/parse.cpp b/icu4c/source/tools/genrb/parse.cpp index 18f994dd202..96ac4a7313b 100644 --- a/icu4c/source/tools/genrb/parse.cpp +++ b/icu4c/source/tools/genrb/parse.cpp @@ -763,8 +763,8 @@ GenrbImporter::getRules( } /* Parse the data into an SRBRoot */ - struct SRBRoot *data = - parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode); + LocalPointer data( + parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode)); if (U_FAILURE(errorCode)) { return; }