From 5b3a708915b98152de705ae4de25ff000dc60acf Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Mon, 6 Feb 2012 19:57:08 +0000 Subject: [PATCH] ICU-8992 Compiler Warning cleanup for gcc 4.6.1 X-SVN-Rev: 31329 --- icu4c/source/common/loclikely.cpp | 7 +++---- icu4c/source/common/rbbi.cpp | 6 +++--- icu4c/source/common/ucnv_u8.c | 5 ++--- icu4c/source/common/ucnvmbcs.c | 11 ++--------- icu4c/source/common/ucol_swp.cpp | 4 +--- icu4c/source/common/uloc_tag.c | 4 +--- icu4c/source/common/uresbund.cpp | 6 +++--- icu4c/source/common/ushape.cpp | 10 +++++----- icu4c/source/i18n/calendar.cpp | 5 ++--- icu4c/source/i18n/dtptngen.cpp | 16 ++++++---------- icu4c/source/i18n/numsys.cpp | 4 +--- icu4c/source/i18n/persncal.cpp | 5 ++--- icu4c/source/i18n/tzgnames.cpp | 6 +++--- icu4c/source/i18n/ucal.cpp | 3 +-- icu4c/source/i18n/ucol_elm.cpp | 9 ++++----- icu4c/source/i18n/ucol_tok.cpp | 6 +++--- icu4c/source/i18n/ucurr.cpp | 6 ++---- icu4c/source/layout/IndicReordering.cpp | 8 +++++--- icu4c/source/layout/OpenTypeLayoutEngine.cpp | 10 ++++++---- icu4c/source/tools/ctestfw/ctest.c | 7 +++---- icu4c/source/tools/genrb/parse.cpp | 13 +++---------- icu4c/source/tools/genrb/wrtjava.c | 11 ++--------- icu4c/source/tools/genrb/wrtxml.cpp | 7 ++----- icu4c/source/tools/gensprep/store.c | 6 ++---- icu4c/source/tools/icuinfo/icuinfo.cpp | 7 ++----- icu4c/source/tools/toolutil/package.cpp | 4 ++-- icu4c/source/tools/toolutil/pkg_gencmn.c | 4 +++- icu4c/source/tools/toolutil/ppucd.cpp | 5 ++++- icu4c/source/tools/toolutil/swapimpl.cpp | 4 ++-- icu4c/source/tools/toolutil/udbgutil.cpp | 4 ++-- 30 files changed, 82 insertions(+), 121 deletions(-) diff --git a/icu4c/source/common/loclikely.cpp b/icu4c/source/common/loclikely.cpp index edee9086f26..1d2c251ebde 100644 --- a/icu4c/source/common/loclikely.cpp +++ b/icu4c/source/common/loclikely.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1997-2011, International Business Machines +* Copyright (C) 1997-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -595,7 +595,6 @@ createLikelySubtagsString( **/ char tagBuffer[ULOC_FULLNAME_CAPACITY]; char likelySubtagsBuffer[ULOC_FULLNAME_CAPACITY]; - int32_t tagBufferLength = 0; if(U_FAILURE(*err)) { goto error; @@ -608,7 +607,7 @@ createLikelySubtagsString( const char* likelySubtags = NULL; - tagBufferLength = createTagString( + createTagString( lang, langLength, script, @@ -661,7 +660,7 @@ createLikelySubtagsString( const char* likelySubtags = NULL; - tagBufferLength = createTagString( + createTagString( lang, langLength, script, diff --git a/icu4c/source/common/rbbi.cpp b/icu4c/source/common/rbbi.cpp index 7bc18f1e33a..f76d02ae294 100644 --- a/icu4c/source/common/rbbi.cpp +++ b/icu4c/source/common/rbbi.cpp @@ -1,6 +1,6 @@ /* *************************************************************************** -* Copyright (C) 1999-2011 International Business Machines Corporation +* Copyright (C) 1999-2012 International Business Machines Corporation * and others. All rights reserved. *************************************************************************** */ @@ -988,7 +988,7 @@ enum RBBIRunMode { //----------------------------------------------------------------------------------- int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) { int32_t state; - int16_t category = 0; + uint16_t category = 0; RBBIRunMode mode; RBBIStateTableRow *row; @@ -1205,7 +1205,7 @@ continueOn: //----------------------------------------------------------------------------------- int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable) { int32_t state; - int16_t category = 0; + uint16_t category = 0; RBBIRunMode mode; RBBIStateTableRow *row; UChar32 c; diff --git a/icu4c/source/common/ucnv_u8.c b/icu4c/source/common/ucnv_u8.c index 8b265cb0fc4..1b6249274bb 100644 --- a/icu4c/source/common/ucnv_u8.c +++ b/icu4c/source/common/ucnv_u8.c @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2011, International Business Machines +* Copyright (C) 2002-2012, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u8.c @@ -752,7 +752,7 @@ static void ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { - UConverter *utf8, *cnv; + UConverter *utf8; const uint8_t *source, *sourceLimit; uint8_t *target; int32_t targetCapacity; @@ -765,7 +765,6 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, /* set up the local pointers */ utf8=pToUArgs->converter; - cnv=pFromUArgs->converter; source=(uint8_t *)pToUArgs->source; sourceLimit=(uint8_t *)pToUArgs->sourceLimit; target=(uint8_t *)pFromUArgs->target; diff --git a/icu4c/source/common/ucnvmbcs.c b/icu4c/source/common/ucnvmbcs.c index 18101ce4cac..4258dbdb096 100644 --- a/icu4c/source/common/ucnvmbcs.c +++ b/icu4c/source/common/ucnvmbcs.c @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 2000-2011, International Business Machines +* Copyright (C) 2000-2012, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -5180,7 +5180,7 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, uint32_t stage2Entry; uint32_t asciiRoundtrips; - uint16_t value, minValue; + uint16_t value; UBool hasSupplementary; /* set up the local pointers */ @@ -5200,13 +5200,6 @@ ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, } asciiRoundtrips=cnv->sharedData->mbcs.asciiRoundtrips; - if(cnv->useFallback) { - /* use all roundtrip and fallback results */ - minValue=0x800; - } else { - /* use only roundtrips and fallbacks from private-use characters */ - minValue=0xc00; - } hasSupplementary=(UBool)(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY); /* get the converter state from the UTF-8 UConverter */ diff --git a/icu4c/source/common/ucol_swp.cpp b/icu4c/source/common/ucol_swp.cpp index b4ced0ea929..b33268c8fef 100644 --- a/icu4c/source/common/ucol_swp.cpp +++ b/icu4c/source/common/ucol_swp.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2003-2011, International Business Machines +* Copyright (C) 2003-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -106,7 +106,6 @@ utrie_swap(const UDataSwapper *ds, U_CAPI UBool U_EXPORT2 ucol_looksLikeCollationBinary(const UDataSwapper *ds, const void *inData, int32_t length) { - const uint8_t *inBytes; const UCATableHeader *inHeader; UCATableHeader header; @@ -114,7 +113,6 @@ ucol_looksLikeCollationBinary(const UDataSwapper *ds, return FALSE; } - inBytes=(const uint8_t *)inData; inHeader=(const UCATableHeader *)inData; /* diff --git a/icu4c/source/common/uloc_tag.c b/icu4c/source/common/uloc_tag.c index e477ce39a09..5db5e8f4133 100644 --- a/icu4c/source/common/uloc_tag.c +++ b/icu4c/source/common/uloc_tag.c @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2009-2011, International Business Machines +* Copyright (C) 2009-2012, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -2022,7 +2022,6 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta ExtensionListEntry *pExtension; AttributeListEntry *pAttribute; char *pExtValueSubtag, *pExtValueSubtagEnd; - char *pAttrValue; int32_t i; UBool isLDMLExtension, reqLDMLType, privateuseVar = FALSE; @@ -2099,7 +2098,6 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta pExtValueSubtag = NULL; pExtValueSubtagEnd = NULL; pAttribute = NULL; - pAttrValue = NULL; isLDMLExtension = FALSE; reqLDMLType = FALSE; diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index 450f43fdd2f..107426de499 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -1,6 +1,6 @@ /* ****************************************************************************** -* Copyright (C) 1997-2011, International Business Machines Corporation and * +* Copyright (C) 1997-2012, International Business Machines Corporation and * * others. All Rights Reserved. * ****************************************************************************** * @@ -323,7 +323,7 @@ static UResourceDataEntry *init_entry(const char *localeID, const char *path, UE char aliasName[100] = { 0 }; int32_t aliasLen = 0; /*UBool isAlias = FALSE;*/ - UHashTok hashkey; + /*UHashTok hashkey; */ if(U_FAILURE(*status)) { return NULL; @@ -342,7 +342,7 @@ static UResourceDataEntry *init_entry(const char *localeID, const char *path, UE find.fPath = (char *)path; /* calculate the hash value of the entry */ - hashkey.pointer = (void *)&find; + /*hashkey.pointer = (void *)&find;*/ /*hashValue = hashEntry(hashkey);*/ /* check to see if we already have this entry */ diff --git a/icu4c/source/common/ushape.cpp b/icu4c/source/common/ushape.cpp index 65a0d33e8a4..c09c13228f4 100644 --- a/icu4c/source/common/ushape.cpp +++ b/icu4c/source/common/ushape.cpp @@ -1,7 +1,7 @@ /* ****************************************************************************** * - * Copyright (C) 2000-2011, International Business Machines + * Copyright (C) 2000-2012, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -913,8 +913,8 @@ expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UE if( countl>0 && isLamAlefChar(dest[i])) { tempbuffer[j] = LAM_CHAR; /* to ensure the array index is within the range */ - U_ASSERT(dest[i]-0xFEF5 >= 0 - && dest[i]-0xFEF5 < sizeof(convertLamAlef)/sizeof(convertLamAlef[0])); + U_ASSERT(dest[i] >= 0xFEF5u + && dest[i]-0xFEF5u < sizeof(convertLamAlef)/sizeof(convertLamAlef[0])); tempbuffer[j-1] = convertLamAlef[ dest[i] - 0xFEF5 ]; j--; countl--; @@ -1306,8 +1306,8 @@ shapeUnicode(UChar *dest, int32_t sourceLength, tashkeelFound = 1; } else { /* to ensure the array index is within the range */ - U_ASSERT(dest[i]-0x064B >= 0 - && dest[i]-0x064B < sizeof(IrrelevantPos)/sizeof(IrrelevantPos[0])); + U_ASSERT(dest[i] >= 0x064Bu + && dest[i]-0x064Bu < sizeof(IrrelevantPos)/sizeof(IrrelevantPos[0])); dest[i] = 0xFE70 + IrrelevantPos[(dest[i] - 0x064B)] + Shape; } }else if ((currLink & APRESENT) > 0) { diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index df2ee1d9c1b..10d6be35f32 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1997-2011, International Business Machines Corporation and * +* Copyright (C) 1997-2012, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -247,8 +247,7 @@ static ECalType getCalendarTypeForLocale(const char *locid) { regionLen = uloc_getCountry(canonicalName, region, sizeof(region) - 1, &status); if (regionLen == 0) { char fullLoc[256]; - int32_t fullLocLen = 0; - fullLocLen = uloc_addLikelySubtags(locid, fullLoc, sizeof(fullLoc) - 1, &status); + uloc_addLikelySubtags(locid, fullLoc, sizeof(fullLoc) - 1, &status); regionLen = uloc_getCountry(fullLoc, region, sizeof(region) - 1, &status); } if (U_FAILURE(status)) { diff --git a/icu4c/source/i18n/dtptngen.cpp b/icu4c/source/i18n/dtptngen.cpp index 3201cdded8f..8717db086cb 100644 --- a/icu4c/source/i18n/dtptngen.cpp +++ b/icu4c/source/i18n/dtptngen.cpp @@ -406,7 +406,6 @@ void DateTimePatternGenerator::addICUPatterns(const Locale& locale, UErrorCode& status) { UnicodeString dfPattern; UnicodeString conflictingString; - UDateTimePatternConflict conflictingStatus; DateFormat* df; if (U_FAILURE(status)) { @@ -419,7 +418,7 @@ DateTimePatternGenerator::addICUPatterns(const Locale& locale, UErrorCode& statu df = DateFormat::createDateInstance(style, locale); SimpleDateFormat* sdf; if (df != NULL && (sdf = dynamic_cast(df)) != NULL) { - conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, conflictingString, status); + addPattern(sdf->toPattern(dfPattern), FALSE, conflictingString, status); } // TODO Maybe we should return an error when the date format isn't simple. delete df; @@ -429,7 +428,7 @@ DateTimePatternGenerator::addICUPatterns(const Locale& locale, UErrorCode& statu df = DateFormat::createTimeInstance(style, locale); if (df != NULL && (sdf = dynamic_cast(df)) != NULL) { - conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, conflictingString, status); + addPattern(sdf->toPattern(dfPattern), FALSE, conflictingString, status); // HACK for hh:ss if ( i==DateFormat::kMedium ) { hackPattern = dfPattern; @@ -445,7 +444,6 @@ DateTimePatternGenerator::addICUPatterns(const Locale& locale, UErrorCode& statu void DateTimePatternGenerator::hackTimes(const UnicodeString& hackPattern, UErrorCode& status) { - UDateTimePatternConflict conflictingStatus; UnicodeString conflictingString; fp->set(hackPattern); @@ -476,7 +474,7 @@ DateTimePatternGenerator::hackTimes(const UnicodeString& hackPattern, UErrorCode break; } mmss+= field; - conflictingStatus = addPattern(mmss, FALSE, conflictingString, status); + addPattern(mmss, FALSE, conflictingString, status); break; } else { @@ -500,7 +498,6 @@ DateTimePatternGenerator::addCLDRData(const Locale& locale, UErrorCode& err) { UResourceBundle *patBundle, *fieldBundle, *fBundle; UnicodeString rbPattern, value, field; UnicodeString conflictingPattern; - UDateTimePatternConflict conflictingStatus; const char *key=NULL; int32_t i; @@ -633,7 +630,7 @@ DateTimePatternGenerator::addCLDRData(const Locale& locale, UErrorCode& err) { setAvailableFormat(retKey, err); // Add pattern with its associated skeleton. Override any duplicate derived from std patterns, // but not a previous availableFormats entry: - conflictingStatus = addPatternWithSkeleton(format, &retKey, TRUE, conflictingPattern, err); + addPatternWithSkeleton(format, &retKey, TRUE, conflictingPattern, err); } #if defined(U_USE_ASCII_BUNDLE_ITERATOR) ures_a_close(&aiter); @@ -676,7 +673,7 @@ DateTimePatternGenerator::addCLDRData(const Locale& locale, UErrorCode& err) { setAvailableFormat(retKey, err); // Add pattern with its associated skeleton. Override any duplicate derived from std patterns, // but not a previous availableFormats entry: - conflictingStatus = addPatternWithSkeleton(format, &retKey, TRUE, conflictingPattern, err); + addPatternWithSkeleton(format, &retKey, TRUE, conflictingPattern, err); } } #if defined(U_USE_ASCII_BUNDLE_ITERATOR) @@ -821,11 +818,10 @@ DateTimePatternGenerator::getDecimal() const { void DateTimePatternGenerator::addCanonicalItems() { UnicodeString conflictingPattern; - UDateTimePatternConflict conflictingStatus; UErrorCode status = U_ZERO_ERROR; for (int32_t i=0; igetNameType(i); switch (nameType) { case UTZNM_LONG_STANDARD: - isLongStandard = TRUE; + // isLongStandard = TRUE; case UTZNM_SHORT_STANDARD: // this one is never used for generic, but just in case isStandard = TRUE; // TODO: Remove this later, see the comments above. bestMatchTimeType = UTZFMT_TIME_TYPE_STANDARD; diff --git a/icu4c/source/i18n/ucal.cpp b/icu4c/source/i18n/ucal.cpp index 0d3b3aeac4b..52677852806 100644 --- a/icu4c/source/i18n/ucal.cpp +++ b/icu4c/source/i18n/ucal.cpp @@ -639,8 +639,7 @@ ucal_getKeywordValuesForLocale(const char * /* key */, const char* locale, UBool prefRegionLength = uloc_getCountry(locale, prefRegion, sizeof(prefRegion), status); if (prefRegionLength == 0) { char loc[ULOC_FULLNAME_CAPACITY] = ""; - int32_t locLength = 0; - locLength = uloc_addLikelySubtags(locale, loc, sizeof(loc), status); + uloc_addLikelySubtags(locale, loc, sizeof(loc), status); prefRegionLength = uloc_getCountry(loc, prefRegion, sizeof(prefRegion), status); } diff --git a/icu4c/source/i18n/ucol_elm.cpp b/icu4c/source/i18n/ucol_elm.cpp index e9e83b6f0e4..3a92e1d02a1 100644 --- a/icu4c/source/i18n/ucol_elm.cpp +++ b/icu4c/source/i18n/ucol_elm.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2001-2011, International Business Machines +* Copyright (C) 2001-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -806,13 +806,12 @@ static void uprv_uca_unsafeCPAddCCNZ(tempUCATable *t, UErrorCode *status) { const UHashElement *e = NULL; UCAElements *element = NULL; UChar NFCbuf[256]; - uint32_t NFCbufLen = 0; while((e = uhash_nextElement(t->prefixLookup, &i)) != NULL) { element = (UCAElements *)e->value.pointer; // codepoints here are in the NFD form. We need to add the // first code point of the NFC form to unsafe, because // strcoll needs to backup over them. - NFCbufLen = unorm_normalize(element->cPoints, element->cSize, UNORM_NFC, 0, + unorm_normalize(element->cPoints, element->cSize, UNORM_NFC, 0, NFCbuf, 256, status); unsafeCPSet(t->unsafeCP, NFCbuf[0]); } @@ -1873,7 +1872,7 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t, UChar comp[256]; CompData precomp[256]; // precomposed array int32_t precompLen = 0; // count for precomp - int32_t i, len, decompLen, curClass, replacedPos; + int32_t i, len, decompLen, replacedPos; tempTailorContext c; if ( cmLookup == NULL ) { @@ -1903,7 +1902,7 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t, // Save the current precomposed char and its class to find any // other combining mark combinations. precomp[precompLen].cp=comp[0]; - curClass = precomp[precompLen].cClass = + precomp[precompLen].cClass = index[nfcImpl->getFCD16(decomp[1]) & 0xff]; precompLen++; replacedPos=0; diff --git a/icu4c/source/i18n/ucol_tok.cpp b/icu4c/source/i18n/ucol_tok.cpp index b70c3145330..ca40cc603be 100644 --- a/icu4c/source/i18n/ucol_tok.cpp +++ b/icu4c/source/i18n/ucol_tok.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2001-2011, International Business Machines +* Copyright (C) 2001-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -1549,7 +1549,7 @@ inline UColToken *getVirginBefore(UColTokenParser *src, UColToken *sourceToken, collIterate s; uint32_t baseCE = UCOL_NOT_FOUND, baseContCE = UCOL_NOT_FOUND; uint32_t CE, SecondCE; - uint32_t invPos; + // uint32_t invPos; if(sourceToken != NULL) { uprv_init_collIterate(src->UCA, src->source+((sourceToken->source)&0xFFFFFF), 1, &s, status); } else { @@ -1608,7 +1608,7 @@ inline UColToken *getVirginBefore(UColTokenParser *src, UColToken *sourceToken, } } else { - invPos = ucol_inv_getPrevCE(src, baseCE, baseContCE, &CE, &SecondCE, strength); + /* invPos = */ ucol_inv_getPrevCE(src, baseCE, baseContCE, &CE, &SecondCE, strength); // we got the previous CE. Now we need to see if the difference between // the two CEs is really of the requested strength. diff --git a/icu4c/source/i18n/ucurr.cpp b/icu4c/source/i18n/ucurr.cpp index 60024c1df04..707aa480a95 100644 --- a/icu4c/source/i18n/ucurr.cpp +++ b/icu4c/source/i18n/ucurr.cpp @@ -2000,14 +2000,13 @@ ucurr_countCurrencies(const char* locale, UErrorCode* ec) { int32_t currCount = 0; - int32_t resLen = 0; if (ec != NULL && U_SUCCESS(*ec)) { // local variables UErrorCode localStatus = U_ZERO_ERROR; char id[ULOC_FULLNAME_CAPACITY]; - resLen = uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus); + uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus); // get country or country_variant in `id' /*uint32_t variantType =*/ idForLocale(locale, id, sizeof(id), ec); @@ -2274,8 +2273,7 @@ U_CAPI UEnumeration *U_EXPORT2 ucurr_getKeywordValuesForLocale(const char *key, prefRegionLength = uloc_getCountry(locale, prefRegion, sizeof(prefRegion), status); if (prefRegionLength == 0) { char loc[ULOC_FULLNAME_CAPACITY] = ""; - int32_t locLength = 0; - locLength = uloc_addLikelySubtags(locale, loc, sizeof(loc), status); + uloc_addLikelySubtags(locale, loc, sizeof(loc), status); prefRegionLength = uloc_getCountry(loc, prefRegion, sizeof(prefRegion), status); } diff --git a/icu4c/source/layout/IndicReordering.cpp b/icu4c/source/layout/IndicReordering.cpp index 6f4753a8336..d64d8ed043f 100644 --- a/icu4c/source/layout/IndicReordering.cpp +++ b/icu4c/source/layout/IndicReordering.cpp @@ -1,6 +1,6 @@ /* / * - * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2012 - All Rights Reserved * */ @@ -1199,7 +1199,6 @@ void IndicReordering::getDynamicProperties( DynamicProperties *, const IndicClas LEUnicode currentChar; - LEUnicode virama; LEUnicode workChars[2]; LEGlyphStorage workGlyphs; @@ -1207,14 +1206,17 @@ void IndicReordering::getDynamicProperties( DynamicProperties *, const IndicClas //le_int32 offset = 0; +#if 0 +// TODO: Should this section of code have actually been doing something? // First find the relevant virama for the script we are dealing with - + LEUnicode virama; for ( currentChar = classTable->firstChar ; currentChar <= classTable->lastChar ; currentChar++ ) { if ( classTable->isVirama(currentChar)) { virama = currentChar; break; } } +#endif for ( currentChar = classTable->firstChar ; currentChar <= classTable->lastChar ; currentChar++ ) { if ( classTable->isConsonant(currentChar)) { diff --git a/icu4c/source/layout/OpenTypeLayoutEngine.cpp b/icu4c/source/layout/OpenTypeLayoutEngine.cpp index 13479b44cea..9b0c94a2a58 100644 --- a/icu4c/source/layout/OpenTypeLayoutEngine.cpp +++ b/icu4c/source/layout/OpenTypeLayoutEngine.cpp @@ -1,7 +1,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2012 - All Rights Reserved * */ @@ -300,7 +300,7 @@ le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 o { LEUnicode *outChars = NULL; LEGlyphStorage fakeGlyphStorage; - le_int32 outCharCount, outGlyphCount, fakeGlyphCount; + le_int32 outCharCount, outGlyphCount; if (LE_FAILURE(success)) { return 0; @@ -318,11 +318,13 @@ le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 o } if (outChars != NULL) { - fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success); + // le_int32 fakeGlyphCount = + glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success); LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... //adjustGlyphs(outChars, 0, outCharCount, rightToLeft, fakeGlyphs, fakeGlyphCount); } else { - fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, fakeGlyphStorage, success); + // le_int32 fakeGlyphCount = + glyphProcessing(chars, offset, count, max, rightToLeft, fakeGlyphStorage, success); //adjustGlyphs(chars, offset, count, rightToLeft, fakeGlyphs, fakeGlyphCount); } diff --git a/icu4c/source/tools/ctestfw/ctest.c b/icu4c/source/tools/ctestfw/ctest.c index 22b626b78fb..474e75423e9 100644 --- a/icu4c/source/tools/ctestfw/ctest.c +++ b/icu4c/source/tools/ctestfw/ctest.c @@ -1,7 +1,7 @@ /* ******************************************************************************** * -* Copyright (C) 1996-2011, International Business Machines +* Copyright (C) 1996-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************** @@ -902,8 +902,7 @@ int T_CTEST_EXPORT2 initArgs( int argc, const char* const argv[], ArgHandlerPtr argHandler, void *context) { int i; - int doList = FALSE; - int argSkip = 0; + int argSkip = 0; VERBOSITY = FALSE; ERR_MSG = TRUE; @@ -928,7 +927,7 @@ initArgs( int argc, const char* const argv[], ArgHandlerPtr argHandler, void *co } else if (strcmp( argv[i], "-l" )==0 ) { - doList = TRUE; + /* doList = TRUE; */ } else if (strcmp( argv[i], "-e1") == 0) { diff --git a/icu4c/source/tools/genrb/parse.cpp b/icu4c/source/tools/genrb/parse.cpp index 0a7aacad518..b9e393c2881 100644 --- a/icu4c/source/tools/genrb/parse.cpp +++ b/icu4c/source/tools/genrb/parse.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2011, International Business Machines +* Copyright (C) 1998-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -834,7 +834,6 @@ addCollation(ParseState* state, struct SResource *result, uint32_t startline, U enum ETokenType token; char subtag[1024]; UVersionInfo version; - UBool override = FALSE; uint32_t line; GenrbData genrbdata; /* '{' . (name resource)* '}' */ @@ -901,12 +900,7 @@ addCollation(ParseState* state, struct SResource *result, uint32_t startline, U } else if (uprv_strcmp(subtag, "Override") == 0) { - override = FALSE; - - if (u_strncmp(member->u.fString.fChars, trueValue, u_strlen(trueValue)) == 0) - { - override = TRUE; - } + // UBool override = (u_strncmp(member->u.fString.fChars, trueValue, u_strlen(trueValue)) == 0); table_add(result, member, line, status); } @@ -1591,7 +1585,6 @@ parseImport(ParseState* state, char *tag, uint32_t startline, const struct UStri char *filename; uint32_t line; char *fullname = NULL; - int32_t numRead = 0; filename = getInvariantString(state, &line, NULL, status); if (U_FAILURE(*status)) @@ -1686,7 +1679,7 @@ parseImport(ParseState* state, char *tag, uint32_t startline, const struct UStri return NULL; } - numRead = T_FileStream_read (file, data, len); + /* int32_t numRead = */ T_FileStream_read (file, data, len); T_FileStream_close (file); result = bin_open(state->bundle, tag, len, data, fullname, comment, status); diff --git a/icu4c/source/tools/genrb/wrtjava.c b/icu4c/source/tools/genrb/wrtjava.c index 4b74c2f6967..ff6f63b030c 100644 --- a/icu4c/source/tools/genrb/wrtjava.c +++ b/icu4c/source/tools/genrb/wrtjava.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2000-2011, International Business Machines +* Copyright (C) 2000-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -325,8 +325,6 @@ array_write_java( struct SResource *res, UErrorCode *status) { uint32_t i = 0; const char* arr ="new String[] { \n"; struct SResource *current = NULL; - struct SResource *first =NULL; - UBool decrementTabs = FALSE; UBool allStrings = TRUE; if (U_FAILURE(*status)) { @@ -351,13 +349,11 @@ array_write_java( struct SResource *res, UErrorCode *status) { write_tabs(out); T_FileStream_write(out, object, (int32_t)uprv_strlen(object)); tabCount++; - decrementTabs = TRUE; }else{ write_tabs(out); T_FileStream_write(out, arr, (int32_t)uprv_strlen(arr)); tabCount++; } - first=current; while (current != NULL) { /*if(current->fType==URES_STRING){ write_tabs(out); @@ -510,9 +506,7 @@ static UBool start = TRUE; static void table_write_java(struct SResource *res, UErrorCode *status) { uint32_t i = 0; - UBool allStrings =TRUE; struct SResource *current = NULL; - struct SResource *save = NULL; const char* obj = "new Object[][]{\n"; if (U_FAILURE(*status)) { @@ -526,7 +520,7 @@ table_write_java(struct SResource *res, UErrorCode *status) { tabCount++; } start = FALSE; - save = current = res->u.fTable.fFirst; + current = res->u.fTable.fFirst; i = 0; @@ -541,7 +535,6 @@ table_write_java(struct SResource *res, UErrorCode *status) { tabCount++; - allStrings=FALSE; write_tabs(out); if(currentKeyString != NULL) { diff --git a/icu4c/source/tools/genrb/wrtxml.cpp b/icu4c/source/tools/genrb/wrtxml.cpp index 52c04ea6714..7e760534a5a 100644 --- a/icu4c/source/tools/genrb/wrtxml.cpp +++ b/icu4c/source/tools/genrb/wrtxml.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2002-2009, International Business Machines +* Copyright (C) 2002-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -674,12 +674,10 @@ array_write_xml(struct SResource *res, const char* id, const char* language, UEr int index = 0; struct SResource *current = NULL; - struct SResource *first =NULL; sid = printContainer(res, group, array_restype, NULL, id, status); current = res->u.fArray.fFirst; - first=current; while (current != NULL) { char c[256] = {0}; @@ -910,7 +908,6 @@ table_write_xml(struct SResource *res, const char* id, const char* language, UBo uint32_t i = 0; struct SResource *current = NULL; - struct SResource *save = NULL; char* sid = NULL; if (U_FAILURE(*status)) { @@ -923,7 +920,7 @@ table_write_xml(struct SResource *res, const char* id, const char* language, UBo sid[0] = '\0'; } - save = current = res->u.fTable.fFirst; + current = res->u.fTable.fFirst; i = 0; while (current != NULL) { diff --git a/icu4c/source/tools/gensprep/store.c b/icu4c/source/tools/gensprep/store.c index b20317971dc..49ea02eb5f7 100644 --- a/icu4c/source/tools/gensprep/store.c +++ b/icu4c/source/tools/gensprep/store.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2011, International Business Machines +* Copyright (C) 1999-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -551,12 +551,10 @@ storeRange(uint32_t start, uint32_t end, UStringPrepType type,UErrorCode* status /* folding value: just store the offset (16 bits) if there is any non-0 entry */ static uint32_t U_CALLCONV getFoldedValue(UNewTrie *trie, UChar32 start, int32_t offset) { - uint32_t foldedValue, value; + uint32_t value; UChar32 limit=0; UBool inBlockZero; - foldedValue=0; - limit=start+0x400; while(start0) { diff --git a/icu4c/source/tools/toolutil/pkg_gencmn.c b/icu4c/source/tools/toolutil/pkg_gencmn.c index 09454d2fde5..ced82138d2e 100644 --- a/icu4c/source/tools/toolutil/pkg_gencmn.c +++ b/icu4c/source/tools/toolutil/pkg_gencmn.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 2008-2011, International Business Machines + * Copyright (C) 2008-2012, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* */ @@ -523,6 +523,8 @@ pathToFullPath(const char *path, const char *source) { fullPath[0] = 0; } n = (int32_t)uprv_strlen(fullPath); + fullPath[n] = 0; /* Suppress compiler warning for unused variable n */ + /* when conditional code below is not compiled. */ uprv_strcat(fullPath, path); #if (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) diff --git a/icu4c/source/tools/toolutil/ppucd.cpp b/icu4c/source/tools/toolutil/ppucd.cpp index 6d6e77c37a3..c2a1b77d4b7 100644 --- a/icu4c/source/tools/toolutil/ppucd.cpp +++ b/icu4c/source/tools/toolutil/ppucd.cpp @@ -106,7 +106,10 @@ PreparsedUCD::readLine(UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return NO_LINE; } // Select the next available line buffer. while(!isLineBufferAvailable(lineIndex)) { - lineIndex= (lineIndex==kNumLineBuffers-1) ? lineIndex=0 : lineIndex+1; + ++lineIndex; + if (lineIndex == kNumLineBuffers) { + lineIndex = 0; + } } char *line=lines[lineIndex]; *line=0; diff --git a/icu4c/source/tools/toolutil/swapimpl.cpp b/icu4c/source/tools/toolutil/swapimpl.cpp index 81e1c17405f..90c1eb41e05 100644 --- a/icu4c/source/tools/toolutil/swapimpl.cpp +++ b/icu4c/source/tools/toolutil/swapimpl.cpp @@ -750,7 +750,7 @@ udata_swap(const UDataSwapper *ds, UErrorCode *pErrorCode) { char dataFormatChars[4]; const UDataInfo *pInfo; - int32_t headerSize, i, swappedLength; + int32_t i, swappedLength; if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { return 0; @@ -763,7 +763,7 @@ udata_swap(const UDataSwapper *ds, * information. Otherwise we would have to pass some of the information * and not be able to use the UDataSwapFn signature. */ - headerSize=udata_swapDataHeader(ds, inData, -1, NULL, pErrorCode); + udata_swapDataHeader(ds, inData, -1, NULL, pErrorCode); /* * If we wanted udata_swap() to also handle non-loadable data like a UTrie, diff --git a/icu4c/source/tools/toolutil/udbgutil.cpp b/icu4c/source/tools/toolutil/udbgutil.cpp index e92bb41dffd..610f43a8fa8 100644 --- a/icu4c/source/tools/toolutil/udbgutil.cpp +++ b/icu4c/source/tools/toolutil/udbgutil.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2007-2011, International Business Machines Corporation and + * Copyright (c) 2007-2012, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -529,7 +529,7 @@ U_CAPI int32_t udbg_getSystemParameterValueByIndex(int32_t i, char *buffer, int3 if(i>=0 && i< (int32_t)U_SYSPARAM_COUNT) { return systemParams[i].paramFunction(&(systemParams[i]),buffer,bufferCapacity,status); } else { - return NULL; + return 0; } }