From 53a148983ccf8945cf3c48223c66b51b5e384a15 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Fri, 30 Nov 2012 22:19:58 +0000 Subject: [PATCH] ICU-9679 Fix some gcc compiler warnings X-SVN-Rev: 32912 --- icu4c/source/common/uloc_tag.c | 7 +------ icu4c/source/i18n/decimfmt.cpp | 4 ++-- icu4c/source/i18n/uspoof.cpp | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/icu4c/source/common/uloc_tag.c b/icu4c/source/common/uloc_tag.c index c7cf87ca89d..d40099e5e71 100644 --- a/icu4c/source/common/uloc_tag.c +++ b/icu4c/source/common/uloc_tag.c @@ -2082,10 +2082,9 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta int32_t subtagLen; int32_t extlangIdx; ExtensionListEntry *pExtension; - AttributeListEntry *pAttribute; char *pExtValueSubtag, *pExtValueSubtagEnd; int32_t i; - UBool isLDMLExtension, privateuseVar = FALSE; + UBool privateuseVar = FALSE; int32_t grandfatheredLen = 0; if (parsedLen != NULL) { @@ -2161,8 +2160,6 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta pExtension = NULL; pExtValueSubtag = NULL; pExtValueSubtagEnd = NULL; - pAttribute = NULL; - isLDMLExtension = FALSE; while (pNext) { char *pSep; @@ -2288,8 +2285,6 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta } } - isLDMLExtension = (uprv_tolower(*pSubtag) == LDMLEXT); - /* create a new extension */ pExtension = (ExtensionListEntry*)uprv_malloc(sizeof(ExtensionListEntry)); if (pExtension == NULL) { diff --git a/icu4c/source/i18n/decimfmt.cpp b/icu4c/source/i18n/decimfmt.cpp index bd9898c2083..51918430a19 100644 --- a/icu4c/source/i18n/decimfmt.cpp +++ b/icu4c/source/i18n/decimfmt.cpp @@ -2158,7 +2158,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, #endif UBool fastParseOk = false; /* TRUE iff fast parse is OK */ - UBool fastParseHadDecimal = FALSE; /* true if fast parse saw a decimal point. */ + // UBool fastParseHadDecimal = FALSE; /* true if fast parse saw a decimal point. */ if(!currencyParsing && @@ -2220,7 +2220,7 @@ UBool DecimalFormat::subparse(const UnicodeString& text, } else if(ch == decimalChar) { parsedNum.append((char)('.'), err); decimalChar=0; // no more decimals. - fastParseHadDecimal=TRUE; + // fastParseHadDecimal=TRUE; } else if(intOnly && !u_isdigit(ch)) { break; // hit a non-integer. (fall through if integer, to slow parse) } else { diff --git a/icu4c/source/i18n/uspoof.cpp b/icu4c/source/i18n/uspoof.cpp index a8984329e6b..32f4322a17d 100644 --- a/icu4c/source/i18n/uspoof.cpp +++ b/icu4c/source/i18n/uspoof.cpp @@ -369,7 +369,7 @@ uspoof_checkUTF8(const USpoofChecker *sc, // u_strToUTF8() in preflight mode is an easy way to do it. U_ASSERT(position16 <= len16); u_strToUTF8(NULL, 0, position, text16, position16, status); - if (position > 0) { + if (position != NULL && *position > 0) { // position is the required buffer length from u_strToUTF8, which includes // space for a terminating NULL, which we don't want, hence the -1. *position -= 1; -- 2.40.0