ICU-8524 compiler warning cleanup.

X-SVN-Rev: 30026
This commit is contained in:
Andy Heninger 2011-05-04 22:34:13 +00:00
parent 78174d2eca
commit ae8896de7f
12 changed files with 24 additions and 28 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 */

View file

@ -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);

View file

@ -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;

View file

@ -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) {

View file

@ -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.

View file

@ -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;

View file

@ -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;