diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index b811f8d07aa..d41180a5e0f 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -3273,7 +3273,7 @@ Calendar::setWeekData(const Locale& desiredLocale, const char *type, UErrorCode& Locale min = Locale::createFromName(minLocaleID); Locale useLocale; if ( uprv_strlen(desiredLocale.getCountry()) == 0 || - uprv_strlen(desiredLocale.getScript()) > 0 && uprv_strlen(min.getScript()) == 0 ) { + (uprv_strlen(desiredLocale.getScript()) > 0 && uprv_strlen(min.getScript()) == 0) ) { char maxLocaleID[ULOC_FULLNAME_CAPACITY] = { 0 }; myStatus = U_ZERO_ERROR; uloc_addLikelySubtags(desiredLocale.getName(),maxLocaleID,ULOC_FULLNAME_CAPACITY,&myStatus); diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index a6fa0c37a76..d6dc1c7f31c 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -342,8 +342,8 @@ SimpleDateFormat::SimpleDateFormat(const UnicodeString& pattern, UErrorCode& status) : fPattern(pattern), fLocale(Locale::getDefault()), - fTimeZoneFormat(NULL), fSymbols(symbolsToAdopt), + fTimeZoneFormat(NULL), fGMTFormatters(NULL), fNumberFormatters(NULL), fOverrideList(NULL) @@ -410,8 +410,8 @@ SimpleDateFormat::SimpleDateFormat(const Locale& locale, UErrorCode& status) : fPattern(gDefaultPattern), fLocale(locale), - fTimeZoneFormat(NULL), fSymbols(NULL), + fTimeZoneFormat(NULL), fGMTFormatters(NULL), fNumberFormatters(NULL), fOverrideList(NULL) @@ -3093,6 +3093,8 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC tzFormat()->parse(UTZFMT_STYLE_LOCATION, text, tmpPos, parsedID, &parsedTimeType); } break; + default: + break; } if (tmpPos.getErrorIndex() < 0) { if (parsedTimeType == UTZFMT_TIME_TYPE_STANDARD) { diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 37febb1ae4e..a70d19ab35a 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -642,9 +642,9 @@ private: // then our results are zone[i] for i=0..len-1. Len will be zero // if the zone data could not be loaded. int32_t* map; + int32_t* localMap; int32_t len; int32_t pos; - int32_t* localMap; TZEnumeration(int32_t* mapData, int32_t mapLen, UBool adoptMapData) : pos(0) { map = mapData; diff --git a/icu4c/source/i18n/uspoof_impl.h b/icu4c/source/i18n/uspoof_impl.h index fb125cefa60..20b2bc30a90 100644 --- a/icu4c/source/i18n/uspoof_impl.h +++ b/icu4c/source/i18n/uspoof_impl.h @@ -301,7 +301,7 @@ class SpoofData: public UMemory { // to be deleted when refcount goes to zero. UDataMemory *fUDM; // If not NULL, our data came from a // UDataMemory, which we must close when - // we're done. + // we are done. uint32_t fMemLimit; // Limit of available raw data space int32_t fRefCount; diff --git a/icu4c/source/test/cintltst/cbiditst.c b/icu4c/source/test/cintltst/cbiditst.c index 9d82a1df4a7..d8717701297 100644 --- a/icu4c/source/test/cintltst/cbiditst.c +++ b/icu4c/source/test/cintltst/cbiditst.c @@ -4107,10 +4107,10 @@ assertIllegalArgument(const char* message, UErrorCode* rc) { } typedef struct { - char* prologue; - char* source; - char* epilogue; - char* expected; + const char* prologue; + const char* source; + const char* epilogue; + const char* expected; UBiDiLevel paraLevel; } contextCase; diff --git a/icu4c/source/test/cintltst/ccaltst.c b/icu4c/source/test/cintltst/ccaltst.c index 03a3c6bf9e7..71440da86d6 100644 --- a/icu4c/source/test/cintltst/ccaltst.c +++ b/icu4c/source/test/cintltst/ccaltst.c @@ -1704,7 +1704,7 @@ typedef struct { static const UChar tzUSPacific[] = { 0x55,0x53,0x2F,0x50,0x61,0x63,0x69,0x66,0x69,0x63,0 }; /* "US/Pacific" */ static const TFDItem tfdItems[] = { - /* timezone locale start target yDf MDf dDf HDf mDf + /* timezone locale start target yDf MDf dDf HDf mDf */ { tzUSPacific, "en_US", 1267459800000.0, 1277772600000.0, 0, 3, 27, 9, 40 }, /* 2010-Mar-01 08:10 -> 2010-Jun-28 17:50 */ { tzUSPacific, "en_US", 1267459800000.0, 1299089280000.0, 1, 0, 1, 1, 58 }, /* 2010-Mar-01 08:10 -> 2011-Mar-02 10:08 */ { NULL, NULL, 0.0, 0.0, 0, 0, 0, 0, 0 } /* terminator */ diff --git a/icu4c/source/test/cintltst/cldrtest.c b/icu4c/source/test/cintltst/cldrtest.c index 9f2347bfe91..b27d1d3f8fc 100644 --- a/icu4c/source/test/cintltst/cldrtest.c +++ b/icu4c/source/test/cintltst/cldrtest.c @@ -599,7 +599,6 @@ compareArrays(const char *keyName, static void compareConsistentCountryInfo(const char *fromLocale, const char *toLocale) { UErrorCode errorCode = U_ZERO_ERROR; - UResourceBundle *fromDateTimeElements, *toDateTimeElements, *fromWeekendData = NULL, *toWeekendData = NULL; UResourceBundle *fromArray, *toArray; UResourceBundle *fromLocaleBund = ures_open(NULL, fromLocale, &errorCode); UResourceBundle *toLocaleBund = ures_open(NULL, toLocale, &errorCode); @@ -654,8 +653,6 @@ compareConsistentCountryInfo(const char *fromLocale, const char *toLocale) { } ures_close(fromArray); ures_close(toArray); - -cleanup: ures_close(fromCalendar); ures_close(toCalendar); ures_close(fromGregorian); diff --git a/icu4c/source/test/cintltst/cmsccoll.c b/icu4c/source/test/cintltst/cmsccoll.c index 773a38c825b..9532eb4f63f 100644 --- a/icu4c/source/test/cintltst/cmsccoll.c +++ b/icu4c/source/test/cintltst/cmsccoll.c @@ -6280,7 +6280,6 @@ static void TestReorderingAcrossCloning() int32_t reorderCodes[3] = {USCRIPT_GREEK, USCRIPT_HAN, UCOL_REORDER_CODE_PUNCTUATION}; UCollator *clonedCollation; int32_t bufferSize; - int32_t* buffer; int32_t retrievedReorderCodesLength; int32_t retrievedReorderCodes[10]; int loopIndex; diff --git a/icu4c/source/test/cintltst/ucnvseltst.c b/icu4c/source/test/cintltst/ucnvseltst.c index 7f892663f06..6497871f679 100644 --- a/icu4c/source/test/cintltst/ucnvseltst.c +++ b/icu4c/source/test/cintltst/ucnvseltst.c @@ -1,5 +1,5 @@ /******************************************************************** - * Copyright (c) 1997-2010, International Business Machines + * Copyright (c) 1997-2011, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************** * @@ -506,7 +506,6 @@ static void TestSelector() /* Improve code coverage of UPropsVectors */ static void TestUPropsVector() { - uint32_t value; UErrorCode errorCode = U_ILLEGAL_ARGUMENT_ERROR; UPropsVectors *pv = upvec_open(100, &errorCode); if (pv != NULL) { diff --git a/icu4c/source/test/intltest/ssearch.cpp b/icu4c/source/test/intltest/ssearch.cpp index d9b1ab3fd7a..1fae4a3a89c 100644 --- a/icu4c/source/test/intltest/ssearch.cpp +++ b/icu4c/source/test/intltest/ssearch.cpp @@ -1641,7 +1641,7 @@ const char *cPattern = "maketh houndes ete hem"; TEST_ASSERT_M(refMatchPos == icuMatchPos, "strstr and icu give different match positions."); int32_t i; - int32_t j=0; + // int32_t j=0; // Try loopcounts around 100000 to some millions, depending on the operation, // to get runtimes of at least several seconds. diff --git a/icu4c/source/test/intltest/tztest.cpp b/icu4c/source/test/intltest/tztest.cpp index 250e1b0ac2b..d88cfb6ae58 100644 --- a/icu4c/source/test/intltest/tztest.cpp +++ b/icu4c/source/test/intltest/tztest.cpp @@ -603,10 +603,10 @@ TimeZoneTest::TestGetAvailableIDsNew() // And ID in any set, but not in canonical set must not be a canonical ID any->reset(ec); - while (id1 = any->snext(ec)) { + while ((id1 = any->snext(ec)) != NULL) { UBool found = FALSE; canonical->reset(ec); - while (id2 = canonical->snext(ec)) { + while ((id2 = canonical->snext(ec)) != NULL) { if (*id1 == *id2) { found = TRUE; break; @@ -635,7 +635,7 @@ TimeZoneTest::TestGetAvailableIDsNew() // canonical set must contains only canonical IDs canonical->reset(ec); - while (id1 = canonical->snext(ec)) { + while ((id1 = canonical->snext(ec)) != NULL) { TimeZone::getCanonicalID(*id1, canonicalID, isSystemID, ec); if (U_FAILURE(ec)) { break; @@ -654,7 +654,7 @@ TimeZoneTest::TestGetAvailableIDsNew() // canonicalLoc set must contain only canonical location IDs canonicalLoc->reset(ec); - while (id1 = canonicalLoc->snext(ec)) { + while ((id1 = canonicalLoc->snext(ec)) != NULL) { TimeZone::getRegion(*id1, region, sizeof(region), ec); if (U_FAILURE(ec)) { break; @@ -670,7 +670,7 @@ TimeZoneTest::TestGetAvailableIDsNew() // any_US must contain only US zones any_US->reset(ec); - while (id1 = any_US->snext(ec)) { + while ((id1 = any_US->snext(ec)) != NULL) { TimeZone::getRegion(*id1, region, sizeof(region), ec); if (U_FAILURE(ec)) { break; @@ -686,7 +686,7 @@ TimeZoneTest::TestGetAvailableIDsNew() // any_W5 must contain only GMT-05:00 zones any_W5->reset(ec); - while (id1 = any_W5->snext(ec)) { + while ((id1 = any_W5->snext(ec)) != NULL) { TimeZone *tz = TimeZone::createTimeZone(*id1); if (tz->getRawOffset() != (-5)*60*60*1000) { errln((UnicodeString)"FAIL: ANY_W5 contains a zone whose offset is not -05:00: " + *id1); @@ -728,10 +728,10 @@ TimeZoneTest::checkContainsAll(StringEnumeration *s1, const char *name1, s2->reset(ec); - while (id2 = s2->snext(ec)) { + while ((id2 = s2->snext(ec)) != NULL) { UBool found = FALSE; s1->reset(ec); - while (id1 = s1->snext(ec)) { + while ((id1 = s1->snext(ec)) != NULL) { if (*id1 == *id2) { found = TRUE; break; diff --git a/icu4c/source/tools/ctestfw/uperf.cpp b/icu4c/source/tools/ctestfw/uperf.cpp index fda5bd36b8b..5fb25b15514 100644 --- a/icu4c/source/tools/ctestfw/uperf.cpp +++ b/icu4c/source/tools/ctestfw/uperf.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2002-2010, International Business Machines Corporation and + * Copyright (c) 2002-2011, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -490,8 +490,7 @@ void UPerfTest::usage( void ) this->runIndexedTest( index, FALSE, name ); if (!name) break; - fprintf(stdout,name); - fprintf(stdout,"\n"); + fprintf(stdout, "%s\n", name); index++; }while (name && (name[0] != 0)); verbose = save_verbose;