]> granicus.if.org Git - icu/commitdiff
ICU-9292 Merge BEAM warning fixes from branch into trunk
authorMichael Ow <mow@svn.icu-project.org>
Thu, 3 May 2012 05:50:26 +0000 (05:50 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Thu, 3 May 2012 05:50:26 +0000 (05:50 +0000)
X-SVN-Rev: 31792

57 files changed:
icu4c/source/common/bmpset.cpp
icu4c/source/common/bytestriebuilder.cpp
icu4c/source/common/locdispnames.cpp
icu4c/source/common/locmap.c
icu4c/source/common/normalizer2impl.cpp
icu4c/source/common/normlzr.cpp
icu4c/source/common/uchar.c
icu4c/source/common/ucharstriebuilder.cpp
icu4c/source/common/ucnv2022.cpp
icu4c/source/common/ucnv_ct.c
icu4c/source/common/ucnvmbcs.c
icu4c/source/common/ucnvmbcs.h
icu4c/source/common/uloc.cpp
icu4c/source/common/unicode/idna.h
icu4c/source/common/uniset_props.cpp
icu4c/source/common/uresdata.c
icu4c/source/common/ustrtrns.cpp
icu4c/source/common/utrie.cpp
icu4c/source/data/mappings/convrtrs.txt
icu4c/source/extra/uconv/uconv.cpp
icu4c/source/extra/uconv/uwmsg.c
icu4c/source/i18n/bmsearch.cpp
icu4c/source/i18n/buddhcal.cpp
icu4c/source/i18n/calendar.cpp
icu4c/source/i18n/choicfmt.cpp
icu4c/source/i18n/colldata.cpp
icu4c/source/i18n/decNumber.c
icu4c/source/i18n/digitlst.cpp
icu4c/source/i18n/dtfmtsym.cpp
icu4c/source/i18n/dtptngen.cpp
icu4c/source/i18n/msgfmt.cpp
icu4c/source/i18n/plurrule.cpp
icu4c/source/i18n/regexcmp.cpp
icu4c/source/i18n/rematch.cpp
icu4c/source/i18n/smpdtfmt.cpp
icu4c/source/i18n/timezone.cpp
icu4c/source/i18n/tzfmt.cpp
icu4c/source/i18n/ucol.cpp
icu4c/source/i18n/ucol_res.cpp
icu4c/source/i18n/ucurr.cpp
icu4c/source/i18n/unicode/msgfmt.h
icu4c/source/io/locbund.cpp
icu4c/source/layout/LookupProcessor.cpp
icu4c/source/tools/ctestfw/ctest.c
icu4c/source/tools/gencnval/gencnval.c
icu4c/source/tools/genrb/parse.cpp
icu4c/source/tools/genrb/ustr.h
icu4c/source/tools/genrb/wrtjava.c
icu4c/source/tools/makeconv/genmbcs.cpp
icu4c/source/tools/makeconv/makeconv.c
icu4c/source/tools/pkgdata/pkgdata.cpp
icu4c/source/tools/toolutil/pkg_genc.c
icu4c/source/tools/toolutil/pkg_gencmn.c
icu4c/source/tools/toolutil/ppucd.cpp
icu4c/source/tools/toolutil/swapimpl.cpp
icu4c/source/tools/toolutil/ucmstate.c
icu4c/source/tools/toolutil/uparse.c

index 83cc9064f7e62da4484c51868264046202f3e027..b874436eced7938d5065d10f279fbfd942a250c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2007-2011, International Business Machines
+*   Copyright (C) 2007-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -107,7 +107,7 @@ static void set32x64Bits(uint32_t table[64], int32_t start, int32_t limit) {
         // limit<=0x800. If limit==0x800 then limitLead=32 and limitTrail=0.
         // In that case, bits=1<<limitLead is undefined but the bits value
         // is not used because trail<limitTrail is already false.
-        bits=1<<limitLead;
+        bits=(uint32_t)1<<((limitLead == 0x20) ? (limitLead - 1) : limitLead);
         for(trail=0; trail<limitTrail; ++trail) {
             table[trail]|=bits;
         }
index c105dfec1ba9426a76c5bacea60804dcb3d77287..b173ee898700d01a360716022796769f013071b5 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-*   Copyright (C) 2010-2011, International Business Machines
+*   Copyright (C) 2010-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  bytestriebuilder.cpp
@@ -430,9 +430,9 @@ BytesTrieBuilder::writeValueAndFinal(int32_t i, UBool isFinal) {
     int32_t length=1;
     if(i<0 || i>0xffffff) {
         intBytes[0]=(char)BytesTrie::kFiveByteValueLead;
-        intBytes[1]=(char)(i>>24);
-        intBytes[2]=(char)(i>>16);
-        intBytes[3]=(char)(i>>8);
+        intBytes[1]=(char)((uint32_t)i>>24);
+        intBytes[2]=(char)((uint32_t)i>>16);
+        intBytes[3]=(char)((uint32_t)i>>8);
         intBytes[4]=(char)i;
         length=5;
     // } else if(i<=BytesTrie::kMaxOneByteValue) {
index 539224563b02d36c34f1452be9dd41aa29f3477e..dd4445246fb4e41754fdb9fb784801f5886493f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1997-2011, International Business Machines
+*   Copyright (C) 1997-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -282,7 +282,7 @@ static const char _kCountries[]       = "Countries";
 static const char _kVariants[]        = "Variants";
 static const char _kKeys[]            = "Keys";
 static const char _kTypes[]           = "Types";
-static const char _kRootName[]        = "root";
+//static const char _kRootName[]        = "root";
 static const char _kCurrency[]        = "currency";
 static const char _kCurrencies[]      = "Currencies";
 static const char _kLocaleDisplayPattern[] = "localeDisplayPattern";
index 205cea10589297d8f045f15177174995de4fa9d7..9ebc70218e05e45e85135f9a2a0fc4f0b36ea5f2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  **********************************************************************
- *   Copyright (C) 1996-2011, International Business Machines
+ *   Copyright (C) 1996-2012, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  **********************************************************************
  *
@@ -171,13 +171,13 @@ ILCID_POSIX_SUBTABLE(az) {
 ILCID_POSIX_ELEMENT_ARRAY(0x046d, ba, ba_RU)
 ILCID_POSIX_ELEMENT_ARRAY(0x0423, be, be_BY)
 
-ILCID_POSIX_SUBTABLE(ber) {
+/*ILCID_POSIX_SUBTABLE(ber) {
     {0x5f,   "ber"},
     {0x045f, "ber_Arab_DZ"},
     {0x045f, "ber_Arab"},
     {0x085f, "ber_Latn_DZ"},
     {0x085f, "ber_Latn"}
-};
+};*/
 
 ILCID_POSIX_ELEMENT_ARRAY(0x0402, bg, bg_BG)
 
index a6ef0c1b2895041cd977db63e007443f9be1458f..050b58169c7397b44d976acd01b19ad83fd1d90f 100644 (file)
@@ -657,8 +657,10 @@ void Normalizer2Impl::decomposeAndAppend(const UChar *src, const UChar *limit,
     if(limit==NULL) {  // appendZeroCC() needs limit!=NULL
         limit=u_strchr(iter.codePointStart, 0);
     }
-    buffer.append(src, (int32_t)(iter.codePointStart-src), firstCC, prevCC, errorCode) &&
+
+    if (buffer.append(src, (int32_t)(iter.codePointStart-src), firstCC, prevCC, errorCode)) {
         buffer.appendZeroCC(iter.codePointStart, limit, errorCode);
+    }
 }
 
 // Note: hasDecompBoundary() could be implemented as aliases to
index b9580537b232ae53909a452c5d31a658314058a9..7a5209f0154c64fe380dc162db7e4cbd5baf84ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *************************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1996-2011, International Business Machines Corporation and
+ * Copyright (c) 1996-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  *************************************************************************
  */
@@ -65,8 +65,6 @@ Normalizer::Normalizer(const Normalizer &copy) :
     init();
 }
 
-static const UChar _NUL=0;
-
 void
 Normalizer::init() {
     UErrorCode errorCode=U_ZERO_ERROR;
index 9cb5f0db196a9b43618360db286bec25c3a40b28..6ce39e635091afcbfa49022f054a824826365103 100644 (file)
@@ -560,7 +560,7 @@ uscript_hasScript(UChar32 c, UScriptCode sc) {
     if(scriptX>=UPROPS_SCRIPT_X_WITH_OTHER) {
         scx=scriptExtensions+scx[1];
     }
-    if(sc>0x7fff) {
+    if(sc>=USCRIPT_CODE_LIMIT) {
         /* Guard against bogus input that would make us go past the Script_Extensions terminator. */
         return FALSE;
     }
@@ -603,7 +603,7 @@ uscript_getScriptExtensions(UChar32 c,
     do {
         sx=*scx++;
         if(length<capacity) {
-            scripts[length]=sx&0x7fff;
+            scripts[length]=(UScriptCode)(sx&0x7fff);
         }
         ++length;
     } while(sx<0x8000);
index b304a3b42c3015c1f4acb5038b9dd61b93300331..5ff120e772270586a30d367aa2ff4955a407d975 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-*   Copyright (C) 2010-2011, International Business Machines
+*   Copyright (C) 2010-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  ucharstriebuilder.h
@@ -378,7 +378,7 @@ UCharsTrieBuilder::writeValueAndFinal(int32_t i, UBool isFinal) {
     int32_t length;
     if(i<0 || i>UCharsTrie::kMaxTwoUnitValue) {
         intUnits[0]=(UChar)(UCharsTrie::kThreeUnitValueLead);
-        intUnits[1]=(UChar)(i>>16);
+        intUnits[1]=(UChar)((uint32_t)i>>16);
         intUnits[2]=(UChar)i;
         length=3;
     // } else if(i<=UCharsTrie::kMaxOneUnitValue) {
@@ -402,7 +402,7 @@ UCharsTrieBuilder::writeValueAndType(UBool hasValue, int32_t value, int32_t node
     int32_t length;
     if(value<0 || value>UCharsTrie::kMaxTwoUnitNodeValue) {
         intUnits[0]=(UChar)(UCharsTrie::kThreeUnitNodeValueLead);
-        intUnits[1]=(UChar)(value>>16);
+        intUnits[1]=(UChar)((uint32_t)value>>16);
         intUnits[2]=(UChar)value;
         length=3;
     } else if(value<=UCharsTrie::kMaxOneUnitNodeValue) {
index 90b4532f100a1c825f317d87cc3c374143397336..2289e80c851c1aea5e5baf347f63c9b03be9f75e 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 2000-2011, International Business Machines
+*   Copyright (C) 2000-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   file name:  ucnv2022.cpp
@@ -78,7 +78,7 @@
 #endif
 
 static const char SHIFT_IN_STR[]  = "\x0F";
-static const char SHIFT_OUT_STR[] = "\x0E";
+// static const char SHIFT_OUT_STR[] = "\x0E";
 
 #define CR      0x0D
 #define LF      0x0A
index d51831de22b3416554bba53ca302bf1478a6e746..7161d139a1e69b4b50341bff6611af0516dfe928 100644 (file)
@@ -293,7 +293,7 @@ _CompoundTextOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorC
             return;
         }
 
-        myConverterData->state = 0;
+        myConverterData->state = (COMPOUND_TEXT_CONVERTERS)0;
     } else {
         *errorCode = U_MEMORY_ALLOCATION_ERROR;
     }
index 4258dbdb0960170c85d8039dbb80e28655d1e988..159b5e5ca5abd25bbb5a70450dbe6573ab70653c 100644 (file)
@@ -1343,7 +1343,6 @@ reconstituteData(UConverterMBCSTable *mbcsTable,
                  UErrorCode *pErrorCode) {
     uint16_t *stage1;
     uint32_t *stage2;
-    uint8_t *bytes;
     uint32_t dataLength=stage1Length*2+fullStage2Length*4+mbcsTable->fromUBytesLength;
     mbcsTable->reconstitutedData=(uint8_t *)uprv_malloc(dataLength);
     if(mbcsTable->reconstitutedData==NULL) {
@@ -1362,7 +1361,7 @@ reconstituteData(UConverterMBCSTable *mbcsTable,
                 stage2Length*4);
 
     mbcsTable->fromUnicodeTable=stage1;
-    mbcsTable->fromUnicodeBytes=bytes=(uint8_t *)(stage2+fullStage2Length);
+    mbcsTable->fromUnicodeBytes=(uint8_t *)(stage2+fullStage2Length);
 
     /* indexes into stage 2 count from the bottom of the fromUnicodeTable */
     stage2=(uint32_t *)stage1;
index 7875f826d2e614be731bfbb3be1491128a381e0f..b960f825621e01f1accf6d0eb8ca8709d829e0a7 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2000-2011, International Business Machines
+*   Copyright (C) 2000-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -274,17 +274,17 @@ enum {
 
 #define MBCS_ENTRY_SET_STATE(entry, state) (int32_t)(((entry)&0x80ffffff)|((int32_t)(state)<<24L))
 
-#define MBCS_ENTRY_STATE(entry) (((entry)>>24)&0x7f)
+#define MBCS_ENTRY_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
 
 #define MBCS_ENTRY_IS_TRANSITION(entry) ((entry)>=0)
 #define MBCS_ENTRY_IS_FINAL(entry) ((entry)<0)
 
-#define MBCS_ENTRY_TRANSITION_STATE(entry) ((entry)>>24)
+#define MBCS_ENTRY_TRANSITION_STATE(entry) (((uint32_t)entry)>>24)
 #define MBCS_ENTRY_TRANSITION_OFFSET(entry) ((entry)&0xffffff)
 
-#define MBCS_ENTRY_FINAL_STATE(entry) (((entry)>>24)&0x7f)
+#define MBCS_ENTRY_FINAL_STATE(entry) ((((uint32_t)entry)>>24)&0x7f)
 #define MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry) ((entry)<(int32_t)0x80100000)
-#define MBCS_ENTRY_FINAL_ACTION(entry) (((entry)>>20)&0xf)
+#define MBCS_ENTRY_FINAL_ACTION(entry) ((((uint32_t)entry)>>20)&0xf)
 #define MBCS_ENTRY_FINAL_VALUE(entry) ((entry)&0xfffff)
 #define MBCS_ENTRY_FINAL_VALUE_16(entry) (uint16_t)(entry)
 
index 25caee1b56459c935b566491446cf0329e075e73..42678feb48eb2747d2de7197de250605db5d2760 100644 (file)
@@ -1009,7 +1009,7 @@ uloc_setKeywordValue(const char* keywordName,
         while(keywordStart[i-1] == ' ') {
             i--;
         }
-        U_ASSERT(i>=0);
+        U_ASSERT(i>=0 && i<ULOC_KEYWORD_BUFFER_LEN);
         localeKeywordNameBuffer[i] = 0;
 
         nextSeparator = uprv_strchr(nextEqualsign, ';');
@@ -1839,7 +1839,7 @@ _canonicalize(const char* localeID,
             len += _getKeywords(tmpLocaleID+1, '@', (len<nameCapacity ? name+len : NULL), nameCapacity-len,
                                 NULL, 0, NULL, TRUE, addKeyword, addValue, err);
         } else if (addKeyword != NULL) {
-            U_ASSERT(addValue != NULL);
+            U_ASSERT(addValue != NULL && len < nameCapacity);
             /* inelegant but works -- later make _getKeywords do this? */
             len += _copyCount(name+len, nameCapacity-len, "@");
             len += _copyCount(name+len, nameCapacity-len, addKeyword);
index 7fe5eb8d03e835bfc50c9ce86c889931dc5164fa..70a84166f3359e239c02fc04c06eb2d47d6478c6 100644 (file)
@@ -31,7 +31,7 @@
 
 U_NAMESPACE_BEGIN
 
-class U_COMMON_API IDNAInfo;
+class IDNAInfo;
 
 /**
  * Abstract base class for IDNA processing.
index 00043a039fda2cd0953dc8a902ba1977e9244fbf..6795efa569ac743e8c04253ef6b9b599080e4e89 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2011, International Business Machines
+*   Copyright (C) 1999-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -74,7 +74,7 @@ U_NAMESPACE_USE
 //static const UChar POSIX_OPEN[]  = { SET_OPEN,COLON,0 };  // "[:"
 static const UChar POSIX_CLOSE[] = { COLON,SET_CLOSE,0 };  // ":]"
 //static const UChar PERL_OPEN[]   = { BACKSLASH,LOWER_P,0 }; // "\\p"
-static const UChar PERL_CLOSE[]  = { CLOSE_BRACE,0 };    // "}"
+//static const UChar PERL_CLOSE[]  = { CLOSE_BRACE,0 };    // "}"
 //static const UChar NAME_OPEN[]   = { BACKSLASH,UPPER_N,0 };  // "\\N"
 static const UChar HYPHEN_RIGHT_BRACE[] = {HYPHEN,SET_CLOSE,0}; /*-]*/
 
@@ -1038,7 +1038,6 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop,
                     applyFilter(numericValueFilter, &value, UPROPS_SRC_CHAR, ec);
                     return *this;
                 }
-                break;
             case UCHAR_NAME:
                 {
                     // Must munge name, since u_charFromName() does not do
@@ -1054,7 +1053,6 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop,
                         FAIL(ec);
                     }
                 }
-                break;
             case UCHAR_UNICODE_1_NAME:
                 // ICU 49 deprecates the Unicode_1_Name property APIs.
                 FAIL(ec);
@@ -1069,7 +1067,6 @@ UnicodeSet::applyPropertyAlias(const UnicodeString& prop,
                     applyFilter(versionFilter, &version, UPROPS_SRC_PROPSVEC, ec);
                     return *this;
                 }
-                break;
             case UCHAR_SCRIPT_EXTENSIONS:
                 v = u_getPropertyValueEnum(UCHAR_SCRIPT, vname.data());
                 if (v == UCHAR_INVALID_CODE) {
index f5218ea8f82c52c233d7f6bcac5fa36e2bcb4f5d..5ebeb0c52778bbb311ceb96c47c7e1b2e3170823 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *                                                                             *
-* Copyright (C) 1999-2011, International Business Machines Corporation        *
+* Copyright (C) 1999-2012, International Business Machines Corporation        *
 *               and others. All Rights Reserved.                              *
 *                                                                             *
 *******************************************************************************
@@ -173,7 +173,7 @@ res_init(ResourceData *pResData,
     }
 
     /* currently, we accept only resources that have a Table as their roots */
-    rootType=RES_GET_TYPE(pResData->rootRes);
+    rootType=(UResType)RES_GET_TYPE(pResData->rootRes);
     if(!URES_IS_TABLE(rootType)) {
         *errorCode=U_INVALID_FORMAT_ERROR;
         res_unload(pResData);
@@ -559,7 +559,7 @@ res_findResource(const ResourceData *pResData, Resource r, char** path, const ch
   Resource t1 = r;
   Resource t2;
   int32_t indexR = 0;
-  UResType type = RES_GET_TYPE(t1);
+  UResType type = (UResType)RES_GET_TYPE(t1);
 
   /* if you come in with an empty path, you'll be getting back the same resource */
   if(!uprv_strlen(pathP)) {
@@ -611,7 +611,7 @@ res_findResource(const ResourceData *pResData, Resource r, char** path, const ch
       t2 = RES_BOGUS;
     }
     t1 = t2;
-    type = RES_GET_TYPE(t1);
+    type = (UResType)RES_GET_TYPE(t1);
     /* position pathP to next resource key/index */
     pathP = *path;
   }
index d702aa8fd6befb097e16b128e6fed6724830d548..57cabd58e2a3b8d95f1ba8a892cb004f1da06484 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2001-2011, International Business Machines
+*   Copyright (C) 2001-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -1310,7 +1310,7 @@ u_strFromJavaModifiedUTF8WithSub(
     }
 
     /* Faster loop without ongoing checking for pSrcLimit and pDestLimit. */
-    pSrcLimit = pSrc + srcLength;
+    pSrcLimit = (pSrc == NULL) ? NULL : pSrc + srcLength;
     for(;;) {
         count = (int32_t)(pDestLimit - pDest);
         srcLength = (int32_t)(pSrcLimit - pSrc);
index eb97aaa55b1b77b08b3e8222927438406b08e78e..b8caeb722b30586bcc51d7459fec737e085b4d3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2001-2011, International Business Machines
+*   Copyright (C) 2001-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -943,7 +943,7 @@ utrie_unserializeDummy(UTrie *trie,
     /* calculate the actual size of the dummy trie data */
 
     /* max(Latin-1, block 0) */
-    latin1Length= UTRIE_SHIFT<=8 ? 256 : UTRIE_DATA_BLOCK_LENGTH;
+    latin1Length= 256; /*UTRIE_SHIFT<=8 ? 256 : UTRIE_DATA_BLOCK_LENGTH;*/
 
     trie->indexLength=UTRIE_BMP_INDEX_LENGTH+UTRIE_SURROGATE_BLOCK_COUNT;
     trie->dataLength=latin1Length;
index 467afb5aa048e1c7a6998fd584524b489ab11d86..09f1a91dd74d29df4e30ca066ba8ff7b2f66b2fb 100644 (file)
@@ -931,7 +931,7 @@ macos-38_2-10.2 { UTR22* }      x-mac-romania { MIME* } x-MacRomania { JAVA* } M
 macos-518-10.2 { UTR22* }       x-mac-arabic { MIME* } x-MacArabic { JAVA* } MacArabic { JAVA }
 macos-1285-10.2 { UTR22* }      x-mac-hebrew { MIME* } x-MacHebrew { JAVA* } MacHebrew { JAVA }
 
-ibm-1051_P100-1995 { UTR22* }   ibm-1051 { IBM* } hp-roman8 { IANA* } roman8 { IANA } r8 { IANA } csHPRoman8 { IANA } x-roman8 { JAVA}   # HP Latin1
+ibm-1051_P100-1995 { UTR22* }   ibm-1051 { IBM* } hp-roman8 { IANA* } roman8 { IANA } r8 { IANA } csHPRoman8 { IANA } x-roman8 { JAVA}   # HP Latin1
 ibm-1276_P100-1995 { UTR22* }   ibm-1276 { IBM* } Adobe-Standard-Encoding { IANA* } csAdobeStandardEncoding { IANA } # Different from ISO-Unicode-IBM-1276 (GCSGID: 1276)
 
 ibm-1006_P100-1995 { UTR22* }   ibm-1006 { IBM* } IBM1006 { JAVA } cp1006 { JAVA* } 1006 { JAVA } x-IBM1006 { JAVA }  # Urdu
index 0bba48eafe1a732dc62e770d90ad2fc4634c2e5d..54ce847580dca694c4a284bd303a7a3ae2c0182b 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 *
-*   Copyright (C) 1999-2011, International Business Machines
+*   Copyright (C) 1999-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************/
@@ -593,6 +593,7 @@ ConvertFile::convertFile(const char *pname,
     UConverter *convto = 0;
     UErrorCode err = U_ZERO_ERROR;
     UBool flush;
+    UBool closeFile = FALSE;
     const char *cbufp, *prevbufp;
     char *bufp;
 
@@ -628,6 +629,7 @@ ConvertFile::convertFile(const char *pname,
             u_wmsg(stderr, "cantOpenInputF", str1.getBuffer(), str2.getBuffer());
             return FALSE;
         }
+        closeFile = TRUE;
     } else {
         infilestr = "-";
         infile = stdin;
@@ -1051,7 +1053,7 @@ normal_exit:
     delete t;
 #endif
 
-    if (infile != stdin) {
+    if (closeFile) {
         fclose(infile);
     }
 
index 61e6c4637191045b8284fee00d7181cd8cba81af..67c12885953deb18b983531ed312e1fae2ebeb4e 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (C) 1998-2004, International Business Machines Corporation 
+* Copyright (C) 1998-2012, International Business Machines Corporation
 * and others.  All Rights Reserved.
 **********************************************************************
 *
@@ -84,7 +84,6 @@ finish:
     ucnv_close(converter);
 }
 
-static const char *gPath = 0;
 static UResourceBundle *gBundle = NULL;
 
 U_STRING_DECL(gNoFormatting, " (UCONFIG_NO_FORMATTING see uconfig.h)", 38);
@@ -110,7 +109,6 @@ U_CFUNC UResourceBundle *u_wmsg_setPath(const char *path, UErrorCode *err)
          return 0;
     }
 
-    gPath = uprv_strdup(path);
     gBundle = b;
 
     U_STRING_INIT(gNoFormatting, " (UCONFIG_NO_FORMATTING see uconfig.h)", 38);
@@ -143,9 +141,6 @@ U_CFUNC int u_wmsg(FILE *fp, const char *tag, ... )
 
     if(U_FAILURE(err))
     {
-#if 0
-        fprintf(stderr, "u_wmsg: failed to load tag [%s] [%s] [%s]!!\n", tag,  u_errorName(err), gPath);
-#endif
         return -1;
     }
 
index 4d2dcc5c9cc7181b67bfd4031a6e4fad7e3611ea..e6d81594fa84cbb9fe38ae0cf2496c2591583adf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ******************************************************************************
- *   Copyright (C) 1996-2011, International Business Machines                 *
+ *   Copyright (C) 1996-2012, International Business Machines                 *
  *   Corporation and others.  All Rights Reserved.                            *
  ******************************************************************************
  */
@@ -306,7 +306,7 @@ void Target::setLast(int32_t last)
     bufferMin = 0;
     bufferMax = 1;
 
-    ceb[0].order      = UCOL_NULLORDER;
+    ceb[0].order      = (uint32_t)UCOL_NULLORDER;
     ceb[0].lowOffset  = last;
     ceb[0].highOffset = last;
 
index 92f726c302865c2eb18c78673ec4c2a601dc88c6..d61f68810dad55d26661db0b3b323c823a1b2027 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-* Copyright (C) 2003-2008, International Business Machines Corporation and    *
+* Copyright (C) 2003-2012, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 *
@@ -24,7 +24,7 @@ U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(BuddhistCalendar)
 
-static const int32_t kMaxEra = 0; // only 1 era
+//static const int32_t kMaxEra = 0; // only 1 era
 
 static const int32_t kBuddhistEraStart = -543;  // 544 BC (Gregorian)
 
index a8c014f858be883a9f81d118e5bb01ce4d7cbd44..a5200899064738a7e16a84ba22df015a6ed11320 100644 (file)
@@ -3186,7 +3186,6 @@ int32_t Calendar::handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t w
             // we're not possibly in the last week -must be ywoy
             return yearWoy;
         }
-        break;
 
     case UCAL_DATE:
         if((internalGet(UCAL_MONTH)==0) &&
@@ -3206,18 +3205,10 @@ int32_t Calendar::handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t w
             //within 1st week and in this month.. 
             //return yearWoy+1;
             return yearWoy;
-            break;
 
     default: // assume the year is appropriate
         return yearWoy;
-        break;
     }
-
-#if defined (U_DEBUG_CAL) 
-    fprintf(stderr, "%s:%d - forgot a return on field %s\n", __FILE__, __LINE__, fldName(bestField));
-#endif 
-
-    return yearWoy;
 }
 
 int32_t Calendar::handleGetMonthLength(int32_t extendedYear, int32_t month) const
index 58b440a7e4cda4906f258bc1361ddf149a6b4e69..79a722bdfee66984d414e4e7a44c2d09c35ef950 100644 (file)
@@ -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.                                                *
 *******************************************************************************
 *
@@ -64,8 +64,8 @@ static const UChar RIGHT_CURLY_BRACE = 0x7D;    /*}*/
 #endif
 #define INFINITY     ((UChar)0x221E)
 
-static const UChar gPositiveInfinity[] = {INFINITY, 0};
-static const UChar gNegativeInfinity[] = {MINUS, INFINITY, 0};
+//static const UChar gPositiveInfinity[] = {INFINITY, 0};
+//static const UChar gNegativeInfinity[] = {MINUS, INFINITY, 0};
 #define POSITIVE_INF_STRLEN 1
 #define NEGATIVE_INF_STRLEN 2
 
index 358b3ac422737bcba4ef5964c74c44c9af31d107..946568b1e1ccd47e6412f18f851f7ef26910acda 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ******************************************************************************
- *   Copyright (C) 1996-2011, International Business Machines                 *
+ *   Copyright (C) 1996-2012, International Business Machines                 *
  *   Corporation and others.  All Rights Reserved.                            *
  ******************************************************************************
  */
@@ -162,7 +162,7 @@ uint32_t CEList::get(int32_t index) const
         return ces[index];
     }
 
-    return UCOL_NULLORDER;
+    return (uint32_t)UCOL_NULLORDER;
 }
 
 uint32_t &CEList::operator[](int32_t index) const
index 5883c22b7f954f3f3cddd89b7306ddb408464fcc..3cb8bd9900f30c25c0db06aba26e773a18b8631f 100644 (file)
@@ -6063,11 +6063,11 @@ static decNumber * decCompareOp(decNumber *res, const decNumber *lhs,
 
     /* If total ordering then handle differing signs 'up front'  */
     if (op==COMPTOTAL) {                /* total ordering  */
-      if (decNumberIsNegative(lhs) & !decNumberIsNegative(rhs)) {
+      if (decNumberIsNegative(lhs) && !decNumberIsNegative(rhs)) {
         result=-1;
         break;
         }
-      if (!decNumberIsNegative(lhs) & decNumberIsNegative(rhs)) {
+      if (!decNumberIsNegative(lhs) && decNumberIsNegative(rhs)) {
         result=+1;
         break;
         }
index b885a17cb212075d045fff5a76ad5322f17168ec..31361be5aa931d44e3327f15232be8c4b8da4d60 100644 (file)
@@ -54,8 +54,8 @@
 
 
 /* Only for 32 bit numbers. Ignore the negative sign. */
-static const char LONG_MIN_REP[] = "2147483648";
-static const char I64_MIN_REP[] = "9223372036854775808";
+//static const char LONG_MIN_REP[] = "2147483648";
+//static const char I64_MIN_REP[] = "9223372036854775808";
 
 
 U_NAMESPACE_BEGIN
index 0f5ba326fc89eba528b12d2ff79c84eb0dbea8eb..e0a9165d1534bb8002c2e257065ebf3366869087 100644 (file)
@@ -171,9 +171,9 @@ static const char gNamesNumericTag[]="numeric";
 static const char gAmPmMarkersTag[]="AmPmMarkers";
 static const char gQuartersTag[]="quarters";
 
-static const char gZoneStringsTag[]="zoneStrings";
+// static const char gZoneStringsTag[]="zoneStrings";
 
-static const char gLocalPatternCharsTag[]="localPatternChars";
+// static const char gLocalPatternCharsTag[]="localPatternChars";
 
 static const char gContextTransformsTag[]="contextTransforms";
 
index b4e39b50870116afa05da59cd59d221ecec26fe7..3cbfb19535646651f8106ec9f386b245b875500c 100644 (file)
@@ -217,7 +217,7 @@ static const char* const Resource_Fields[] = {
 static const UChar UDATPG_ItemFormat[]= {0x7B, 0x30, 0x7D, 0x20, 0x251C, 0x7B, 0x32, 0x7D, 0x3A,
     0x20, 0x7B, 0x31, 0x7D, 0x2524, 0};  // {0} \u251C{2}: {1}\u2524
 
-static const UChar repeatedPatterns[6]={CAP_G, CAP_E, LOW_Z, LOW_V, CAP_Q, 0}; // "GEzvQ"
+//static const UChar repeatedPatterns[6]={CAP_G, CAP_E, LOW_Z, LOW_V, CAP_Q, 0}; // "GEzvQ"
 
 static const char DT_DateTimePatternsTag[]="DateTimePatterns";
 static const char DT_DateTimeCalendarTag[]="calendar";
index bec283a08a06145582fb726e4e6cd9b1ec9e20d2..9575f8e03c14062e339685c51afc01973e3517f6 100644 (file)
@@ -1734,6 +1734,15 @@ Format* MessageFormat::DummyFormat::clone() const {
     return new DummyFormat();
 }
 
+UnicodeString& MessageFormat::DummyFormat::format(const Formattable& obj,
+                          UnicodeString& appendTo,
+                          UErrorCode& status) const {
+    if (U_SUCCESS(status)) {
+        status = U_UNSUPPORTED_ERROR;
+    }
+    return appendTo;
+}
+
 UnicodeString& MessageFormat::DummyFormat::format(const Formattable&,
                           UnicodeString& appendTo,
                           FieldPosition&,
@@ -1744,6 +1753,16 @@ UnicodeString& MessageFormat::DummyFormat::format(const Formattable&,
     return appendTo;
 }
 
+UnicodeString& MessageFormat::DummyFormat::format(const Formattable&,
+                          UnicodeString& appendTo,
+                          FieldPositionIterator* posIter,
+                          UErrorCode& status) const {
+    if (U_SUCCESS(status)) {
+        status = U_UNSUPPORTED_ERROR;
+    }
+    return appendTo;
+}
+
 void MessageFormat::DummyFormat::parseObject(const UnicodeString&,
                                                      Formattable&,
                                                      ParsePosition& ) const {
index e343fef14811f87cd4b526ae5d10ed165d0430b6..2f80a54ec439335a79c5725e41dadc09fd3fcae7 100644 (file)
@@ -700,11 +700,10 @@ PluralRules::getRuleFromResource(const Locale& locale, UPluralType type, UErrorC
         UErrorCode status = U_ZERO_ERROR;
         char parentLocaleName[ULOC_FULLNAME_CAPACITY];
         const char *curLocaleName=locale.getName();
-        int32_t localeNameLen=0;
         uprv_strcpy(parentLocaleName, curLocaleName);
 
-        while ((localeNameLen=uloc_getParent(parentLocaleName, parentLocaleName,
-                                       ULOC_FULLNAME_CAPACITY, &status)) > 0) {
+        while (uloc_getParent(parentLocaleName, parentLocaleName,
+                                       ULOC_FULLNAME_CAPACITY, &status) > 0) {
             resLen=0;
             s = ures_getStringByKey(locRes.getAlias(), parentLocaleName, &resLen, &status);
             if (s != NULL) {
@@ -1292,7 +1291,6 @@ RuleParser::getNextToken(const UnicodeString& ruleData,
                     return;
                  }
              }
-             break;
          default:
              status = U_UNEXPECTED_TOKEN;
              return;
index 146d73cfafe6c46787d59824670a73702c344688..b17ef53c93d73df4603bf422b1a619a0c085c5b8 100644 (file)
@@ -3595,10 +3595,10 @@ static const UChar      chDigit7    = 0x37;      // '9'
 static const UChar      chColon     = 0x3A;      // ':'
 static const UChar      chE         = 0x45;      // 'E'
 static const UChar      chQ         = 0x51;      // 'Q'
-static const UChar      chN         = 0x4E;      // 'N'
+//static const UChar      chN         = 0x4E;      // 'N'
 static const UChar      chP         = 0x50;      // 'P'
 static const UChar      chBackSlash = 0x5c;      // '\'  introduces a char escape
-static const UChar      chLBracket  = 0x5b;      // '['
+//static const UChar      chLBracket  = 0x5b;      // '['
 static const UChar      chRBracket  = 0x5d;      // ']'
 static const UChar      chUp        = 0x5e;      // '^'
 static const UChar      chLowerP    = 0x70;
index 60b1372cdaa425999b3bd81770bae9360d344bbc..b416f16c811136b58f28147fe4e6f336cd647cde 100644 (file)
@@ -3099,7 +3099,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
         case URX_BACKSLASH_B:          // Test for word boundaries
             {
                 UBool success = isWordBoundary(fp->fInputIdx);
-                success ^= (opValue != 0);     // flip sense for \B
+                success ^= (UBool)(opValue != 0);     // flip sense for \B
                 if (!success) {
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
                 }
@@ -3110,7 +3110,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
         case URX_BACKSLASH_BU:          // Test for word boundaries, Unicode-style
             {
                 UBool success = isUWordBoundary(fp->fInputIdx);
-                success ^= (opValue != 0);     // flip sense for \B
+                success ^= (UBool)(opValue != 0);     // flip sense for \B
                 if (!success) {
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
                 }
@@ -3131,7 +3131,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
                 UChar32 c = UTEXT_NEXT32(fInputText);
                 int8_t ctype = u_charType(c);     // TODO:  make a unicode set for this.  Will be faster.
                 UBool success = (ctype == U_DECIMAL_DIGIT_NUMBER);
-                success ^= (opValue != 0);        // flip sense for \D
+                success ^= (UBool)(opValue != 0);        // flip sense for \D
                 if (success) {
                     fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
                 } else {
@@ -4588,7 +4588,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
         case URX_BACKSLASH_B:          // Test for word boundaries
             {
                 UBool success = isChunkWordBoundary((int32_t)fp->fInputIdx);
-                success ^= (opValue != 0);     // flip sense for \B
+                success ^= (UBool)(opValue != 0);     // flip sense for \B
                 if (!success) {
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
                 }
@@ -4599,7 +4599,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
         case URX_BACKSLASH_BU:          // Test for word boundaries, Unicode-style
             {
                 UBool success = isUWordBoundary(fp->fInputIdx);
-                success ^= (opValue != 0);     // flip sense for \B
+                success ^= (UBool)(opValue != 0);     // flip sense for \B
                 if (!success) {
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
                 }
@@ -4619,7 +4619,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
                 U16_NEXT(inputBuf, fp->fInputIdx, fActiveLimit, c);
                 int8_t ctype = u_charType(c);     // TODO:  make a unicode set for this.  Will be faster.
                 UBool success = (ctype == U_DECIMAL_DIGIT_NUMBER);
-                success ^= (opValue != 0);        // flip sense for \D
+                success ^= (UBool)(opValue != 0);        // flip sense for \D
                 if (!success) {
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
                 }
index 040c361c3a57a88d869c903ba7cab3a172a310bf..01b819d22779c564ee9460936881c3b76564b4ea 100644 (file)
@@ -78,16 +78,17 @@ static const UChar PATTERN_CHAR_BASE = 0x40;
 // For time zones that have no names, use strings GMT+minutes and
 // GMT-minutes. For instance, in France the time zone is GMT+60.
 // Also accepted are GMT+H:MM or GMT-H:MM.
-static const UChar gGmt[]      = {0x0047, 0x004D, 0x0054, 0x0000};         // "GMT"
-static const UChar gGmtPlus[]  = {0x0047, 0x004D, 0x0054, 0x002B, 0x0000}; // "GMT+"
-static const UChar gGmtMinus[] = {0x0047, 0x004D, 0x0054, 0x002D, 0x0000}; // "GMT-"
-static const UChar gDefGmtPat[]       = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0x0000}; /* GMT{0} */
-static const UChar gDefGmtNegHmsPat[] = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* -HH:mm:ss */
-static const UChar gDefGmtNegHmPat[]  = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* -HH:mm */
-static const UChar gDefGmtPosHmsPat[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* +HH:mm:ss */
-static const UChar gDefGmtPosHmPat[]  = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* +HH:mm */
-static const UChar gUt[]       = {0x0055, 0x0054, 0x0000};  // "UT"
-static const UChar gUtc[]      = {0x0055, 0x0054, 0x0043, 0x0000};  // "UT"
+// Currently not being used
+//static const UChar gGmt[]      = {0x0047, 0x004D, 0x0054, 0x0000};         // "GMT"
+//static const UChar gGmtPlus[]  = {0x0047, 0x004D, 0x0054, 0x002B, 0x0000}; // "GMT+"
+//static const UChar gGmtMinus[] = {0x0047, 0x004D, 0x0054, 0x002D, 0x0000}; // "GMT-"
+//static const UChar gDefGmtPat[]       = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0x0000}; /* GMT{0} */
+//static const UChar gDefGmtNegHmsPat[] = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* -HH:mm:ss */
+//static const UChar gDefGmtNegHmPat[]  = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* -HH:mm */
+//static const UChar gDefGmtPosHmsPat[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* +HH:mm:ss */
+//static const UChar gDefGmtPosHmPat[]  = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* +HH:mm */
+//static const UChar gUt[]       = {0x0055, 0x0054, 0x0000};  // "UT"
+//static const UChar gUtc[]      = {0x0055, 0x0054, 0x0043, 0x0000};  // "UT"
 
 typedef enum GmtPatSize {
     kGmtLen = 3,
@@ -157,7 +158,7 @@ static const UChar SUPPRESS_NEGATIVE_PREFIX[] = {0xAB00, 0};
  */
 static const char gDateTimePatternsTag[]="DateTimePatterns";
 
-static const UChar gEtcUTC[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x54, 0x43, 0x00}; // "Etc/UTC"
+//static const UChar gEtcUTC[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x54, 0x43, 0x00}; // "Etc/UTC"
 static const UChar QUOTE = 0x27; // Single quote
 
 /*
index 799de79c0556bf066fa67f1d34e2a03fcaf2bceb..429068e54b746e34cb178e5a8af3ae4c96a6113a 100644 (file)
@@ -106,14 +106,6 @@ static const UChar         WORLD[] = {0x30, 0x30, 0x31, 0x00}; /* "001" */
 
 static const UChar         GMT_ID[] = {0x47, 0x4D, 0x54, 0x00}; /* "GMT" */
 static const UChar         UNKNOWN_ZONE_ID[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0x00}; /* "Etc/Unknown" */
-static const UChar         Z_STR[] = {0x7A, 0x00}; /* "z" */
-static const UChar         ZZZZ_STR[] = {0x7A, 0x7A, 0x7A, 0x7A, 0x00}; /* "zzzz" */
-static const UChar         Z_UC_STR[] = {0x5A, 0x00}; /* "Z" */
-static const UChar         ZZZZ_UC_STR[] = {0x5A, 0x5A, 0x5A, 0x5A, 0x00}; /* "ZZZZ" */
-static const UChar         V_STR[] = {0x76, 0x00}; /* "v" */
-static const UChar         VVVV_STR[] = {0x76, 0x76, 0x76, 0x76, 0x00}; /* "vvvv" */
-static const UChar         V_UC_STR[] = {0x56, 0x00}; /* "V" */
-static const UChar         VVVV_UC_STR[] = {0x56, 0x56, 0x56, 0x56, 0x00}; /* "VVVV" */
 static const int32_t       GMT_ID_LENGTH = 3;
 static const int32_t       UNKNOWN_ZONE_ID_LENGTH = 11;
 
index 79210ad0e27e78dfd6f284de0102b7ab1af33567..131d30b7ba0ba33708a5407baf6bf8124b22f36a 100644 (file)
@@ -36,7 +36,7 @@ static const char gHourFormatTag[]= "hourFormat";
 static const UChar TZID_GMT[] = {0x0045, 0x0074, 0x0063, 0x002F, 0x0047, 0x004D, 0x0054, 0};    // Etc/GMT
 
 static const UChar DEFAULT_GMT_PATTERN[] = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0}; // GMT{0}
-static const UChar DEFAULT_GMT_ZERO[] = {0x0047, 0x004D, 0x0054, 0}; // GMT
+//static const UChar DEFAULT_GMT_ZERO[] = {0x0047, 0x004D, 0x0054, 0}; // GMT
 static const UChar DEFAULT_GMT_POSITIVE_HM[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // +HH:mm
 static const UChar DEFAULT_GMT_POSITIVE_HMS[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0}; // +HH:mm:ss
 static const UChar DEFAULT_GMT_NEGATIVE_HM[] = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // -HH:mm
@@ -1691,7 +1691,7 @@ TimeZoneFormat::parseAbuttingAsciiOffsetFields(const UnicodeString& text, ParseP
 
     U_ASSERT(maxDigits <= MAX_OFFSET_DIGITS);
 
-    int32_t digits[MAX_OFFSET_DIGITS];
+    int32_t digits[MAX_OFFSET_DIGITS] = {};
     int32_t numDigits = 0;
     int32_t idx = start;
     while (numDigits < maxDigits && idx < text.length()) {
index 74940a7b153c44047c0814260211caff6e194948..e4d237b8afcf5e7b16a43b66cded9f055e981608 100644 (file)
@@ -3577,7 +3577,7 @@ uint32_t ucol_prv_getSpecialPrevCE(const UCollator *coll, UChar ch, uint32_t CE,
 
             IInit_collIterate(coll, UCharOffset, noChars, &temp, status);
             if(U_FAILURE(*status)) {
-                return UCOL_NULLORDER;
+                return (uint32_t)UCOL_NULLORDER;
             }
             temp.flags &= ~UCOL_ITER_NORM;
             temp.flags |= source->flags & UCOL_FORCE_HAN_IMPLICIT;
@@ -3954,7 +3954,7 @@ uint32_t ucol_prv_getSpecialPrevCE(const UCollator *coll, UChar ch, uint32_t CE,
                     // The total size for our collation key is half of endIndex, rounded up.
                     int32_t size = (endIndex+1)/2;
                     if(!ensureCEsCapacity(source, size)) {
-                        return UCOL_NULLORDER;
+                        return (uint32_t)UCOL_NULLORDER;
                     }
                     *(source->CEpos++) = (((numTempBuf[0] << 8) | numTempBuf[1]) << UCOL_PRIMARYORDERSHIFT) | //Primary weight
                         (UCOL_BYTE_COMMON << UCOL_SECONDARYORDERSHIFT) | // Secondary weight
@@ -6060,7 +6060,7 @@ saveState:
 
     // If we are doing French, we need to store whether we have just finished the French level
     if(level == UCOL_PSK_SECONDARY && doingFrench) {
-        state[1] |= (((state[0] == 0) & UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_MASK) << UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_SHIFT);
+        state[1] |= (((int32_t)(state[0] == 0) & UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_MASK) << UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_SHIFT);
     } else {
         state[1] |= ((byteCountOrFrenchDone & UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_MASK) << UCOL_PSK_BYTE_COUNT_OR_FRENCH_DONE_SHIFT);
     }
index 2f7304695613095c1a2d1b67a7ed2b218b997384..f1d0235c511209d95a9ffd2bb296dfcc6907cd30 100644 (file)
@@ -453,6 +453,8 @@ ucol_openRulesForImport( const UChar        *rules,
             }
             result->hasRealData = TRUE;
             result->freeImageOnClose = TRUE;
+        } else {
+            goto cleanup;
         }
     } else { /* no rules, but no error either */
         // must be only options
index 707aa480a95c2602302b272d4a65dc3d5e67c8cb..b86f8e288c6989a3d443c6024dcb2f4197593ca5 100644 (file)
@@ -223,8 +223,8 @@ idForLocale(const char* locale, char* countryAndVariant, int capacity, UErrorCod
     uloc_getCountry(locale, countryAndVariant, capacity, ec);
     uloc_getVariant(locale, variant, sizeof(variant), ec);
     if (variant[0] != 0) {
-        variantType = (0 == uprv_strcmp(variant, VAR_EURO))
-                   | ((0 == uprv_strcmp(variant, VAR_PRE_EURO)) << 1);
+        variantType = (uint32_t)(0 == uprv_strcmp(variant, VAR_EURO))
+                   | ((uint32_t)(0 == uprv_strcmp(variant, VAR_PRE_EURO)) << 1);
         if (variantType)
         {
             uprv_strcat(countryAndVariant, VAR_DELIM_STR);
index 7c5cb0ddff403ea2277edb06315f06c73569ac0c..60ba15385747dd447e5aa6a9f0c0fc1563b8383f 100644 (file)
@@ -1073,10 +1073,17 @@ private:
     public:
         virtual UBool operator==(const Format&) const;
         virtual Format* clone() const;
+        virtual UnicodeString& format(const Formattable& obj,
+                              UnicodeString& appendTo,
+                              UErrorCode& status) const;
         virtual UnicodeString& format(const Formattable&,
                                       UnicodeString& appendTo,
                                       FieldPosition&,
                                       UErrorCode& status) const;
+        virtual UnicodeString& format(const Formattable& obj,
+                                      UnicodeString& appendTo,
+                                      FieldPositionIterator* posIter,
+                                      UErrorCode& status) const;
         virtual void parseObject(const UnicodeString&,
                                  Formattable&,
                                  ParsePosition&) const;
index b2dfa1b74d408fd891e454d52c5c2d735d4438d3..8486f996e0249a298b6f32fdcbc7fb278ee89723 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-2011, International Business Machines
+*   Copyright (C) 1998-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -29,7 +29,6 @@
 #include "unicode/ustring.h"
 #include "unicode/uloc.h"
 
-static UBool isFormatsInitialized = FALSE;
 static UNumberFormat *gPosixNumberFormat[ULOCALEBUNDLE_NUMBERFORMAT_COUNT];
 
 U_CDECL_BEGIN
@@ -39,7 +38,6 @@ static UBool U_CALLCONV locbund_cleanup(void) {
         unum_close(gPosixNumberFormat[style]);
         gPosixNumberFormat[style] = NULL;
     }
-    isFormatsInitialized = FALSE;
     return TRUE;
 }
 U_CDECL_END
index 042958521938ffb8a07e29692957060f72dd1bb7..4f9d97c58d14b4c8e769abe965a95b5d493a025d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2012 - All Rights Reserved
  *
  */
 
@@ -199,6 +199,11 @@ LookupProcessor::LookupProcessor(const char *baseAddress,
         featureReferences += SWAPW(featureTable->lookupCount);
     }
 
+    if (!featureTable) {
+        success = LE_INTERNAL_ERROR;
+        return;
+    }
+
     if (requiredFeatureIndex != 0xFFFF) {
         requiredFeatureTable = featureListTable->getFeatureTable(requiredFeatureIndex, &requiredFeatureTag);
         featureReferences += SWAPW(featureTable->lookupCount);
index 474e75423e9d4317424569e74577e71a3a1d7932..6e79261f904ee0950ec0d63c5081f793f5c492b9 100644 (file)
@@ -1182,7 +1182,7 @@ setTestOption ( int32_t testOption, int32_t value) {
             REPEAT_TESTS = value;
             break;
         case ICU_TRACE_OPTION:
-            ICU_TRACE = value;
+            ICU_TRACE = (UTraceLevel)value;
             break;
         default :
             break;
index 0f0a915887b0004f8801dc1b9d04395edb3cdd99..12718cd7beeb5f32a5fee23377d4db620d7c34fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2011, International Business Machines
+*   Copyright (C) 1999-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -644,7 +644,6 @@ addToKnownAliases(const char *alias) {
 static uint16_t
 addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool defaultName) {
     uint32_t idx, idx2;
-    UBool dupFound = FALSE;
     UBool startEmptyWithoutDefault = FALSE;
     AliasList *aliasList;
 
@@ -713,7 +712,6 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
                             GET_ALIAS_STR(converters[converter].converter),
                             GET_ALIAS_STR(converters[idx].converter));
                     }
-                    dupFound = TRUE;
                     break;
                 }
             }
index b9e393c2881e8b88305fa2b51d272a44a14e7203..f5a5fd779ae9ab2ec158bf23368bb0b068e7c098 100644 (file)
@@ -73,7 +73,7 @@ const char *tokenNames[TOK_TOKEN_COUNT] =
 };
 
 /* Just to store "TRUE" */
-static const UChar trueValue[] = {0x0054, 0x0052, 0x0055, 0x0045, 0x0000};
+//static const UChar trueValue[] = {0x0054, 0x0052, 0x0055, 0x0045, 0x0000};
 
 typedef struct {
     struct Lookahead  lookahead[MAX_LOOKAHEAD + 1];
@@ -283,7 +283,6 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
     char              filename[256] = { '\0' };
     char              cs[128]       = { '\0' };
     uint32_t          line;
-    int               len=0;
     UBool quoted = FALSE;
     UCHARBUF *ucbuf=NULL;
     UChar32   c     = 0;
@@ -363,7 +362,7 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
              * append at the end of the loop
              */
             while(c != ENDCOMMAND) {
-                U_APPEND_CHAR32(c, target,len);
+                U_APPEND_CHAR32_ONLY(c, target);
                 c = ucbuf_getc(ucbuf, status);
             }
         }
@@ -396,7 +395,7 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
         /* Append UChar * after dissembling if c > 0xffff*/
         if (c != (UChar32)U_EOF)
         {
-            U_APPEND_CHAR32(c, target,len);
+            U_APPEND_CHAR32_ONLY(c, target);
         }
         else
         {
index b2d597256bd0f580aee04dfa407eb9ea377cdd2e..05a446ea0e58ad9e51fd3b64e56ee103d8fa3a17 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-2011, International Business Machines
+*   Copyright (C) 1998-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
     }                                                           \
 }
 
+#define U_APPEND_CHAR32_ONLY(c,target) {                             \
+    if (c <= 0xffff)                                            \
+    {                                                           \
+        *(target)++ = (UChar) c;                                \
+    }                                                           \
+    else                                                        \
+    {                                                           \
+        target[0] = U16_LEAD(c);                                \
+        target[1] = U16_TRAIL(c);                               \
+        target +=2;                                             \
+    }                                                           \
+}
+
 /* A C representation of a string "object" (to avoid realloc all the time) */
 struct UString {
   UChar *fChars;
index ff6f63b030c8aaa8bb6a84f4520f1735a80f7d24..6239569d85e8939ccd8c6fe7642220108051c5e2 100644 (file)
@@ -82,7 +82,7 @@ static int tabCount = 3;
 
 static FileStream* out=NULL;
 static struct SRBRoot* srBundle ;
-static const char* outDir = NULL;
+/*static const char* outDir = NULL;*/
 
 static const char* bName=NULL;
 static const char* pName=NULL;
@@ -621,7 +621,7 @@ bundle_write_java(struct SRBRoot *bundle, const char *outputDir,const char* outp
     char className[256]={'\0'};
     /*char constructor[1000] = { 0 };*/
     /*UBool j1 =FALSE;*/
-    outDir = outputDir;
+    /*outDir = outputDir;*/
 
     start = TRUE;                        /* Reset the start indictor*/
 
index 5c4c911b37724ca8a8e9f3790639cee97d676bd0..556d813941989ba33f1b1d713029c14dfe4f4653 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2000-2011, International Business Machines
+*   Copyright (C) 2000-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -399,7 +399,7 @@ MBCSAddToUnicode(MBCSData *mbcsData,
             offset+=MBCS_ENTRY_TRANSITION_OFFSET(entry);
         } else {
             if(i<length) {
-                fprintf(stderr, "error: byte sequence too long by %d bytes, final state %hu: 0x%s (U+%x)\n",
+                fprintf(stderr, "error: byte sequence too long by %d bytes, final state %u: 0x%s (U+%x)\n",
                     (int)(length-i), state, printBytes(buffer, bytes, length), (int)c);
                 return FALSE;
             }
@@ -1064,7 +1064,7 @@ MBCSAddTable(NewConverter *cnvData, UCMTable *table, UConverterStaticData *stati
 static UBool
 transformEUC(MBCSData *mbcsData) {
     uint8_t *p8;
-    uint32_t i, value, oldLength, old3Top, new3Top;
+    uint32_t i, value, oldLength, old3Top;
     uint8_t b;
 
     oldLength=mbcsData->ucm->states.maxCharLength;
@@ -1097,7 +1097,7 @@ transformEUC(MBCSData *mbcsData) {
 
     /* modify outputType and adjust stage3Top */
     mbcsData->ucm->states.outputType=(int8_t)(MBCS_OUTPUT_3_EUC+oldLength-3);
-    mbcsData->stage3Top=new3Top=(old3Top*(oldLength-1))/oldLength;
+    mbcsData->stage3Top=(old3Top*(oldLength-1))/oldLength;
 
     /*
      * EUC-encode all byte sequences;
index 09cd9c8bb78927affae465bb9e806b152690820e..424c962251138ce7dc9de7cb865fe198d689f0d6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  ********************************************************************************
  *
- *   Copyright (C) 1998-2011, International Business Machines
+ *   Copyright (C) 1998-2012, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *
  ********************************************************************************
@@ -245,7 +245,7 @@ int main(int argc, char* argv[])
     }
 
     if(options[OPT_VERSION].doesOccur) {
-        printf("makeconv version %hu.%hu, ICU tool to read .ucm codepage mapping files and write .cnv files\n",
+        printf("makeconv version %u.%u, ICU tool to read .ucm codepage mapping files and write .cnv files\n",
                dataInfo.formatVersion[0], dataInfo.formatVersion[1]);
         printf("%s\n", U_COPYRIGHT_STRING);
         exit(0);
@@ -293,7 +293,7 @@ int main(int argc, char* argv[])
         arg = getLongPathname(*argv);
 
         /* Check for potential buffer overflow */
-        if(strlen(arg) > UCNV_MAX_FULL_FILE_NAME_LENGTH)
+        if(strlen(arg) >= UCNV_MAX_FULL_FILE_NAME_LENGTH)
         {
             fprintf(stderr, "%s\n", u_errorName(U_BUFFER_OVERFLOW_ERROR));
             return U_BUFFER_OVERFLOW_ERROR;
index 0ec63db42cc7f01e7f5d7640d6570e09952c5a59..44c1a388d6bb94de3d15fe0f9676f77ef13cf6fc 100644 (file)
@@ -1117,13 +1117,17 @@ static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, c
     }
 #ifndef U_WINDOWS_WITH_MSVC
     char buffer[SMALL_BUFFER_MAX_SIZE] = "";
+    int32_t bufferLength = 0;
 
     FileStream *f = T_FileStream_open(fileListName, "r");
     if (f != NULL) {
         for(;;) {
             if (T_FileStream_readLine(f, buffer, SMALL_BUFFER_MAX_SIZE) != NULL) {
+                bufferLength = uprv_strlen(buffer);
                 /* Remove new line character. */
-                buffer[uprv_strlen(buffer)-1] = 0;
+                if (bufferLength > 0) {
+                    buffer[bufferLength-1] = 0;
+                }
 
                 sprintf(cmd, "%s %s%s%s %s%s%s",
                         pkgDataFlags[INSTALL_CMD],
@@ -2011,6 +2015,7 @@ static void loadLists(UPKGOptions *o, UErrorCode *status)
     option->doesOccur = TRUE;
 
     return 0;
-#endif
+#else
     return -1;
+#endif
 }
index e0e91bdefea8394ca328afe16e4ff40529ccd264..dc87188a22c6e5b56e21a036ff2e5f6e46f87951 100644 (file)
@@ -1012,7 +1012,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
 
     /* deal with options, files and the entry point name */
     getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
-    printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%hu\n", cpu, bits, makeBigEndian);
+    printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian);
 #if U_PLATFORM_HAS_WIN32_API
     if(cpu==IMAGE_FILE_MACHINE_I386) {
         entryOffset=1;
index ced82138d2e0cf553e5363ff76bc1cba071b8b8e..25f36088a0f8f4ccf3f712362854f62d8194a592 100644 (file)
@@ -203,9 +203,7 @@ createCommonDataFile(const char *destDir, const char *name, const char *entrypoi
         addFile(getLongPathname(line), name, source, sourceTOC, verbose);
     }
 
-    if (linePtr) {
-      uprv_free(linePtr);
-    }
+    uprv_free(linePtr);
 
     if(in!=T_FileStream_stdin()) {
         T_FileStream_close(in);
index c2a1b77d4b7dc5b1e6ff1269f2bb484244f3eaec..f1c711c8e87ae96436865bc3147c4afac6998f40 100644 (file)
@@ -71,7 +71,7 @@ PreparsedUCD::PreparsedUCD(const char *filename, UErrorCode &errorCode)
     }
     if(file==NULL) {
         perror("error opening preparsed UCD");
-        fprintf(stderr, "error opening preparsed UCD file %s\n", filename);
+        fprintf(stderr, "error opening preparsed UCD file %s\n", filename ? filename : "\"no file name given\"");
         errorCode=U_FILE_ACCESS_ERROR;
         return;
     }
@@ -327,6 +327,11 @@ PreparsedUCD::parseProperty(UniProps &props, const char *field, UnicodeSet &newV
                 "for non-binary property on line %ld\n",
                 field, (long)lineNumber);
         errorCode=U_PARSE_ERROR;
+    } else if (prop < UCHAR_INT_START) {
+        fprintf(stderr,
+                "error in preparsed UCD: prop value is invalid: '%d' for line %ld\n",
+                prop, (long)lineNumber);
+        errorCode=U_PARSE_ERROR;
     } else if(prop<UCHAR_INT_LIMIT) {
         int32_t value=pnames->getPropertyValueEnum(prop, v);
         if(value==UCHAR_INVALID_CODE && prop==UCHAR_CANONICAL_COMBINING_CLASS) {
index 90c1eb41e059c4a9869c194a869122a3683bc7b9..5b67b0fd524cd155bbe5e7cc6919464a5b9c0aef 100644 (file)
@@ -653,7 +653,7 @@ test_swap(const UDataSwapper *ds,
     /* udata_swapDataHeader checks the arguments */
     headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode);
     if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
-        udata_printError(ds, "test_swap(): data header swap failed %s\n", u_errorName(*pErrorCode));
+        udata_printError(ds, "test_swap(): data header swap failed %s\n", pErrorCode != NULL ? u_errorName(*pErrorCode) : "pErrorCode is NULL");
         return 0;
     }
 
index 5d8c87773563cf6df075e0f35e0b6bfc48b1596b..ee07a4ca772228f2970ac68daa994747292f9570 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2003-2011, International Business Machines
+*   Copyright (C) 2003-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -1028,7 +1028,7 @@ ucm_countChars(UCMStates *states,
     }
 
     if(offset!=0) {
-        fprintf(stderr, "ucm error: byte sequence too short, ends in non-final state %hu\n", state);
+        fprintf(stderr, "ucm error: byte sequence too short, ends in non-final state %u\n", state);
         return -1;
     }
 
index 3d098cbfac81b58096c0e6bf2dbdb3442c85ff48..5878597ad35384c954d090eada311edce2b68b18 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2000-2011, International Business Machines
+*   Copyright (C) 2000-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -245,6 +245,7 @@ u_parseString(const char *s,
     }
     if(s==NULL || destCapacity<0 || (destCapacity>0 && dest==NULL)) {
         *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
+        return 0;
     }
 
     if(pFirst!=NULL) {