ICU-9292 Merge BEAM warning fixes from branch into trunk
X-SVN-Rev: 31792
This commit is contained in:
parent
1e26b4760c
commit
0ca13b73b0
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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";
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 ©) :
|
||||
init();
|
||||
}
|
||||
|
||||
static const UChar _NUL=0;
|
||||
|
||||
void
|
||||
Normalizer::init() {
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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);
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class U_COMMON_API IDNAInfo;
|
||||
class IDNAInfo;
|
||||
|
||||
/**
|
||||
* Abstract base class for IDNA processing.
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1998-2011, International Business Machines
|
||||
* Copyright (C) 1998-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
@ -35,6 +35,19 @@
|
||||
} \
|
||||
}
|
||||
|
||||
#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;
|
||||
|
@ -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*/
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user