]> granicus.if.org Git - icu/commitdiff
ICU-9679 Fix some gcc compiler warnings
authorMichael Ow <mow@svn.icu-project.org>
Fri, 30 Nov 2012 22:19:58 +0000 (22:19 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Fri, 30 Nov 2012 22:19:58 +0000 (22:19 +0000)
X-SVN-Rev: 32912

icu4c/source/common/uloc_tag.c
icu4c/source/i18n/decimfmt.cpp
icu4c/source/i18n/uspoof.cpp

index c7cf87ca89d98d8306a5cb67f744a5fec90b806b..d40099e5e71df515a6f0c72aa38df57d3ecbab99 100644 (file)
@@ -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) {
index bd9898c20839cceead205e928706fac9573a29c1..51918430a1923e7077b82e3a2bde1cf022ee898d 100644 (file)
@@ -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 {
index a8984329e6b9164f749e8305e11205184dbefdfe..32f4322a17d2a2f415671c7d54cf2beb3a16850a 100644 (file)
@@ -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;