mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-6799 fix many warnings, improve tests
X-SVN-Rev: 25772
This commit is contained in:
parent
06ecf2a685
commit
9eb9dd4c83
55 changed files with 471 additions and 338 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1996-2006, International Business Machines
|
||||
* Copyright (C) 1996-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
|
@ -798,13 +798,13 @@ U_CAPI const char *
|
|||
uprv_convertToPosix(uint32_t hostid, UErrorCode* status)
|
||||
{
|
||||
uint16_t langID = LANGUAGE_LCID(hostid);
|
||||
uint32_t index;
|
||||
uint32_t localeIndex;
|
||||
|
||||
for (index = 0; index < gLocaleCount; index++)
|
||||
for (localeIndex = 0; localeIndex < gLocaleCount; localeIndex++)
|
||||
{
|
||||
if (langID == gPosixIDmap[index].regionMaps->hostID)
|
||||
if (langID == gPosixIDmap[localeIndex].regionMaps->hostID)
|
||||
{
|
||||
return getPosixID(&gPosixIDmap[index], hostid);
|
||||
return getPosixID(&gPosixIDmap[localeIndex], hostid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2008, International Business Machines
|
||||
* Copyright (C) 1999-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -1563,7 +1563,7 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
|||
int32_t visualLength, i, j, visualStart, logicalStart,
|
||||
runCount, runLength, addedRuns, insertRemove,
|
||||
start, limit, step, indexOddBit, logicalPos,
|
||||
index, index1;
|
||||
index0, index1;
|
||||
uint32_t saveOptions;
|
||||
|
||||
pBiDi->reorderingMode=UBIDI_REORDER_DEFAULT;
|
||||
|
@ -1642,9 +1642,9 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
|||
}
|
||||
logicalStart=GET_INDEX(runs[i].logicalStart);
|
||||
for(j=logicalStart+1; j<logicalStart+runLength; j++) {
|
||||
index=visualMap[j];
|
||||
index0=visualMap[j];
|
||||
index1=visualMap[j-1];
|
||||
if((BIDI_ABS(index-index1)!=1) || (saveLevels[index]!=saveLevels[index1])) {
|
||||
if((BIDI_ABS(index0-index1)!=1) || (saveLevels[index0]!=saveLevels[index1])) {
|
||||
addedRuns++;
|
||||
}
|
||||
}
|
||||
|
@ -1687,10 +1687,10 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
|||
step=-1;
|
||||
}
|
||||
for(j=start; j!=limit; j+=step) {
|
||||
index=visualMap[j];
|
||||
index0=visualMap[j];
|
||||
index1=visualMap[j+step];
|
||||
if((BIDI_ABS(index-index1)!=1) || (saveLevels[index]!=saveLevels[index1])) {
|
||||
logicalPos=BIDI_MIN(visualMap[start], index);
|
||||
if((BIDI_ABS(index0-index1)!=1) || (saveLevels[index0]!=saveLevels[index1])) {
|
||||
logicalPos=BIDI_MIN(visualMap[start], index0);
|
||||
runs[i+addedRuns].logicalStart=MAKE_INDEX_ODD_PAIR(logicalPos,
|
||||
saveLevels[logicalPos]^indexOddBit);
|
||||
runs[i+addedRuns].visualLimit=runs[i].visualLimit;
|
||||
|
|
|
@ -274,7 +274,7 @@ _toTitle(UCaseMap *csm,
|
|||
UText utext=UTEXT_INITIALIZER;
|
||||
const UChar *s;
|
||||
UChar32 c;
|
||||
int32_t prev, titleStart, titleLimit, index, destIndex, length;
|
||||
int32_t prev, titleStart, titleLimit, idx, destIndex, length;
|
||||
UBool isFirstIndex;
|
||||
|
||||
utext_openUTF8(&utext, (const char *)src, srcLength, pErrorCode);
|
||||
|
@ -302,12 +302,12 @@ _toTitle(UCaseMap *csm,
|
|||
/* find next index where to titlecase */
|
||||
if(isFirstIndex) {
|
||||
isFirstIndex=FALSE;
|
||||
index=ubrk_first(csm->iter);
|
||||
idx=ubrk_first(csm->iter);
|
||||
} else {
|
||||
index=ubrk_next(csm->iter);
|
||||
idx=ubrk_next(csm->iter);
|
||||
}
|
||||
if(index==UBRK_DONE || index>srcLength) {
|
||||
index=srcLength;
|
||||
if(idx==UBRK_DONE || idx>srcLength) {
|
||||
idx=srcLength;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -323,22 +323,22 @@ _toTitle(UCaseMap *csm,
|
|||
* b) first case letter (titlecase) [titleStart..titleLimit[
|
||||
* c) subsequent characters (lowercase) [titleLimit..index[
|
||||
*/
|
||||
if(prev<index) {
|
||||
if(prev<idx) {
|
||||
/* find and copy uncased characters [prev..titleStart[ */
|
||||
titleStart=titleLimit=prev;
|
||||
U8_NEXT(src, titleLimit, index, c);
|
||||
U8_NEXT(src, titleLimit, idx, c);
|
||||
if((csm->options&U_TITLECASE_NO_BREAK_ADJUSTMENT)==0 && UCASE_NONE==ucase_getType(csm->csp, c)) {
|
||||
/* Adjust the titlecasing index (titleStart) to the next cased character. */
|
||||
for(;;) {
|
||||
titleStart=titleLimit;
|
||||
if(titleLimit==index) {
|
||||
if(titleLimit==idx) {
|
||||
/*
|
||||
* only uncased characters in [prev..index[
|
||||
* stop with titleStart==titleLimit==index
|
||||
*/
|
||||
break;
|
||||
}
|
||||
U8_NEXT(src, titleLimit, index, c);
|
||||
U8_NEXT(src, titleLimit, idx, c);
|
||||
if(UCASE_NONE!=ucase_getType(csm->csp, c)) {
|
||||
break; /* cased letter at [titleStart..titleLimit[ */
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ _toTitle(UCaseMap *csm,
|
|||
|
||||
|
||||
/* Special case Dutch IJ titlecasing */
|
||||
if ( titleStart+1 < index &&
|
||||
if ( titleStart+1 < idx &&
|
||||
ucase_getCaseLocale(csm->locale,&csm->locCache) == UCASE_LOC_DUTCH &&
|
||||
( src[titleStart] == 0x0049 || src[titleStart] == 0x0069 ) &&
|
||||
( src[titleStart+1] == 0x004A || src[titleStart+1] == 0x006A )) {
|
||||
|
@ -370,7 +370,7 @@ _toTitle(UCaseMap *csm,
|
|||
titleLimit++;
|
||||
}
|
||||
/* lowercase [titleLimit..index[ */
|
||||
if(titleLimit<index) {
|
||||
if(titleLimit<idx) {
|
||||
if((csm->options&U_TITLECASE_NO_LOWERCASE)==0) {
|
||||
/* Normal operation: Lowercase the rest of the word. */
|
||||
destIndex+=
|
||||
|
@ -378,11 +378,11 @@ _toTitle(UCaseMap *csm,
|
|||
csm, ucase_toFullLower,
|
||||
dest+destIndex, destCapacity-destIndex,
|
||||
src, csc,
|
||||
titleLimit, index,
|
||||
titleLimit, idx,
|
||||
pErrorCode);
|
||||
} else {
|
||||
/* Optionally just copy the rest of the word unchanged. */
|
||||
length=index-titleLimit;
|
||||
length=idx-titleLimit;
|
||||
if((destIndex+length)<=destCapacity) {
|
||||
uprv_memcpy(dest+destIndex, src+titleLimit, length);
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ _toTitle(UCaseMap *csm,
|
|||
}
|
||||
}
|
||||
|
||||
prev=index;
|
||||
prev=idx;
|
||||
}
|
||||
|
||||
if(destIndex>destCapacity) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003-2008, International Business Machines
|
||||
* Copyright (C) 2003-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -125,7 +125,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
|
|||
const uint32_t *toUTable, *toUSection;
|
||||
|
||||
uint32_t value, matchValue;
|
||||
int32_t i, j, index, length, matchLength;
|
||||
int32_t i, j, idx, length, matchLength;
|
||||
uint8_t b;
|
||||
|
||||
if(cx==NULL || cx[UCNV_EXT_TO_U_LENGTH]<=0) {
|
||||
|
@ -134,7 +134,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
|
|||
|
||||
/* initialize */
|
||||
toUTable=UCNV_EXT_ARRAY(cx, UCNV_EXT_TO_U_INDEX, uint32_t);
|
||||
index=0;
|
||||
idx=0;
|
||||
|
||||
matchValue=0;
|
||||
i=j=matchLength=0;
|
||||
|
@ -158,7 +158,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
|
|||
/* match input units until there is a full match or the input is consumed */
|
||||
for(;;) {
|
||||
/* go to the next section */
|
||||
toUSection=toUTable+index;
|
||||
toUSection=toUTable+idx;
|
||||
|
||||
/* read first pair of the section */
|
||||
value=*toUSection++;
|
||||
|
@ -202,7 +202,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
|
|||
} else {
|
||||
if(UCNV_EXT_TO_U_IS_PARTIAL(value)) {
|
||||
/* partial match, continue */
|
||||
index=(int32_t)UCNV_EXT_TO_U_GET_PARTIAL_INDEX(value);
|
||||
idx=(int32_t)UCNV_EXT_TO_U_GET_PARTIAL_INDEX(value);
|
||||
} else {
|
||||
if( (UCNV_EXT_TO_U_IS_ROUNDTRIP(value) ||
|
||||
TO_U_USE_FALLBACK(useFallback)) &&
|
||||
|
@ -528,7 +528,7 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
const uint32_t *fromUTableValues, *fromUSectionValues;
|
||||
|
||||
uint32_t value, matchValue;
|
||||
int32_t i, j, index, length, matchLength;
|
||||
int32_t i, j, idx, length, matchLength;
|
||||
UChar c;
|
||||
|
||||
if(cx==NULL) {
|
||||
|
@ -536,17 +536,17 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
}
|
||||
|
||||
/* trie lookup of firstCP */
|
||||
index=firstCP>>10; /* stage 1 index */
|
||||
if(index>=cx[UCNV_EXT_FROM_U_STAGE_1_LENGTH]) {
|
||||
idx=firstCP>>10; /* stage 1 index */
|
||||
if(idx>=cx[UCNV_EXT_FROM_U_STAGE_1_LENGTH]) {
|
||||
return 0; /* the first code point is outside the trie */
|
||||
}
|
||||
|
||||
stage12=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_STAGE_12_INDEX, uint16_t);
|
||||
stage3=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_STAGE_3_INDEX, uint16_t);
|
||||
index=UCNV_EXT_FROM_U(stage12, stage3, index, firstCP);
|
||||
idx=UCNV_EXT_FROM_U(stage12, stage3, idx, firstCP);
|
||||
|
||||
stage3b=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_STAGE_3B_INDEX, uint32_t);
|
||||
value=stage3b[index];
|
||||
value=stage3b[idx];
|
||||
if(value==0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
|
||||
if(UCNV_EXT_TO_U_IS_PARTIAL(value)) {
|
||||
/* partial match, enter the loop below */
|
||||
index=(int32_t)UCNV_EXT_FROM_U_GET_PARTIAL_INDEX(value);
|
||||
idx=(int32_t)UCNV_EXT_FROM_U_GET_PARTIAL_INDEX(value);
|
||||
|
||||
/* initialize */
|
||||
fromUTableUChars=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_UCHARS_INDEX, UChar);
|
||||
|
@ -573,8 +573,8 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
/* match input units until there is a full match or the input is consumed */
|
||||
for(;;) {
|
||||
/* go to the next section */
|
||||
fromUSectionUChars=fromUTableUChars+index;
|
||||
fromUSectionValues=fromUTableValues+index;
|
||||
fromUSectionUChars=fromUTableUChars+idx;
|
||||
fromUSectionValues=fromUTableValues+idx;
|
||||
|
||||
/* read first pair of the section */
|
||||
length=*fromUSectionUChars++;
|
||||
|
@ -610,15 +610,15 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
}
|
||||
|
||||
/* search for the current UChar */
|
||||
index=ucnv_extFindFromU(fromUSectionUChars, length, c);
|
||||
if(index<0) {
|
||||
idx=ucnv_extFindFromU(fromUSectionUChars, length, c);
|
||||
if(idx<0) {
|
||||
/* no match here, stop with the longest match so far */
|
||||
break;
|
||||
} else {
|
||||
value=fromUSectionValues[index];
|
||||
value=fromUSectionValues[idx];
|
||||
if(UCNV_EXT_FROM_U_IS_PARTIAL(value)) {
|
||||
/* partial match, continue */
|
||||
index=(int32_t)UCNV_EXT_FROM_U_GET_PARTIAL_INDEX(value);
|
||||
idx=(int32_t)UCNV_EXT_FROM_U_GET_PARTIAL_INDEX(value);
|
||||
} else {
|
||||
if( (UCNV_EXT_FROM_U_IS_ROUNDTRIP(value) ||
|
||||
FROM_U_USE_FALLBACK(useFallback, firstCP)) &&
|
||||
|
|
|
@ -2678,7 +2678,7 @@ static void _load_installedLocales()
|
|||
UMTX_CHECK(NULL, _installedLocales != NULL, localesLoaded);
|
||||
|
||||
if (localesLoaded == FALSE) {
|
||||
UResourceBundle *index = NULL;
|
||||
UResourceBundle *indexLocale = NULL;
|
||||
UResourceBundle installed;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char ** temp;
|
||||
|
@ -2686,8 +2686,8 @@ static void _load_installedLocales()
|
|||
int32_t localeCount;
|
||||
|
||||
ures_initStackObject(&installed);
|
||||
index = ures_openDirect(NULL, _kIndexLocaleName, &status);
|
||||
ures_getByKey(index, _kIndexTag, &installed, &status);
|
||||
indexLocale = ures_openDirect(NULL, _kIndexLocaleName, &status);
|
||||
ures_getByKey(indexLocale, _kIndexTag, &installed, &status);
|
||||
|
||||
if(U_SUCCESS(status)) {
|
||||
localeCount = ures_getSize(&installed);
|
||||
|
@ -2714,7 +2714,7 @@ static void _load_installedLocales()
|
|||
}
|
||||
}
|
||||
ures_close(&installed);
|
||||
ures_close(index);
|
||||
ures_close(indexLocale);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1273,7 +1273,7 @@ _appendKeywordsToLanguageTag(const char* localeID, char* appendAt, int32_t capac
|
|||
return u_terminateChars(appendAt, capacity, reslen, status);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Append keywords parsed from LDML extension value
|
||||
* e.g. "u-ca-gregory-co-trad" -> {calendar = gregorian} {collation = traditional}
|
||||
* Note: char* buf is used for storing keywords
|
||||
|
@ -1283,7 +1283,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT
|
|||
const char *p, *pNext, *pSep;
|
||||
const char *pBcpKey, *pBcpType;
|
||||
const char *pKey, *pType;
|
||||
int32_t bcpKeyLen, bcpTypeLen;
|
||||
int32_t bcpKeyLen = 0, bcpTypeLen;
|
||||
ExtensionListEntry *kwd, *nextKwd;
|
||||
ExtensionListEntry *kwdFirst = NULL;
|
||||
int32_t bufIdx = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2008, International Business Machines
|
||||
* Copyright (C) 1999-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -972,7 +972,7 @@ enumAlgNames(AlgorithmicRange *range,
|
|||
uint16_t count=range->variant;
|
||||
const char *s=(const char *)(factors+count);
|
||||
char *suffix, *t;
|
||||
uint16_t prefixLength, i, index;
|
||||
uint16_t prefixLength, i, idx;
|
||||
|
||||
char c;
|
||||
|
||||
|
@ -1002,10 +1002,10 @@ enumAlgNames(AlgorithmicRange *range,
|
|||
/* increment the indexes in lexical order bound by the factors */
|
||||
i=count;
|
||||
for (;;) {
|
||||
index=(uint16_t)(indexes[--i]+1);
|
||||
if(index<factors[i]) {
|
||||
idx=(uint16_t)(indexes[--i]+1);
|
||||
if(idx<factors[i]) {
|
||||
/* skip one index and its element string */
|
||||
indexes[i]=index;
|
||||
indexes[i]=idx;
|
||||
s=elements[i];
|
||||
while(*s++!=0) {
|
||||
}
|
||||
|
@ -1101,7 +1101,7 @@ findAlgName(AlgorithmicRange *range, UCharNameChoice nameChoice, const char *oth
|
|||
uint16_t count=range->variant;
|
||||
const char *s=(const char *)(factors+count), *t;
|
||||
UChar32 start, limit;
|
||||
uint16_t i, index;
|
||||
uint16_t i, idx;
|
||||
|
||||
char c;
|
||||
|
||||
|
@ -1131,10 +1131,10 @@ findAlgName(AlgorithmicRange *range, UCharNameChoice nameChoice, const char *oth
|
|||
/* increment the indexes in lexical order bound by the factors */
|
||||
i=count;
|
||||
for (;;) {
|
||||
index=(uint16_t)(indexes[--i]+1);
|
||||
if(index<factors[i]) {
|
||||
idx=(uint16_t)(indexes[--i]+1);
|
||||
if(idx<factors[i]) {
|
||||
/* skip one index and its element string */
|
||||
indexes[i]=index;
|
||||
indexes[i]=idx;
|
||||
s=elements[i];
|
||||
while(*s++!=0) {}
|
||||
elements[i]=s;
|
||||
|
|
|
@ -693,7 +693,7 @@ ures_close(UResourceBundle* resB)
|
|||
}
|
||||
|
||||
static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r,
|
||||
const char *key, int32_t index, UResourceDataEntry *realData,
|
||||
const char *key, int32_t idx, UResourceDataEntry *realData,
|
||||
const UResourceBundle *parent, int32_t noAlias,
|
||||
UResourceBundle *resB, UErrorCode *status)
|
||||
{
|
||||
|
@ -833,13 +833,13 @@ static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r,
|
|||
uprv_memcpy(chAlias, key, len);
|
||||
aKey = chAlias;
|
||||
r = res_findResource(&(mainRes->fResData), r, &aKey, &temp);
|
||||
} else if(index != -1) {
|
||||
} else if(idx != -1) {
|
||||
/* if there is no key, but there is an index, try to get by the index */
|
||||
/* here we have either a table or an array, so get the element */
|
||||
if(RES_GET_TYPE(r) == URES_TABLE || RES_GET_TYPE(r) == URES_TABLE32) {
|
||||
r = res_getTableItemByIndex(&(mainRes->fResData), r, index, (const char **)&aKey);
|
||||
r = res_getTableItemByIndex(&(mainRes->fResData), r, idx, (const char **)&aKey);
|
||||
} else { /* array */
|
||||
r = res_getArrayItem(&(mainRes->fResData), r, index);
|
||||
r = res_getArrayItem(&(mainRes->fResData), r, idx);
|
||||
}
|
||||
}
|
||||
if(r != RES_BOGUS) {
|
||||
|
@ -966,9 +966,9 @@ static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r,
|
|||
if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) {
|
||||
ures_appendResPath(resB, RES_PATH_SEPARATOR_S, 1, status);
|
||||
}
|
||||
} else if(index >= 0) {
|
||||
} else if(idx >= 0) {
|
||||
char buf[256];
|
||||
int32_t len = T_CString_integerToString(buf, index, 10);
|
||||
int32_t len = T_CString_integerToString(buf, idx, 10);
|
||||
ures_appendResPath(resB, buf, len, status);
|
||||
if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) {
|
||||
ures_appendResPath(resB, RES_PATH_SEPARATOR_S, 1, status);
|
||||
|
@ -1441,12 +1441,12 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB,
|
|||
|
||||
U_CAPI const char * U_EXPORT2
|
||||
ures_getUTF8StringByIndex(const UResourceBundle *resB,
|
||||
int32_t index,
|
||||
int32_t idx,
|
||||
char *dest, int32_t *pLength,
|
||||
UBool forceCopy,
|
||||
UErrorCode *status) {
|
||||
int32_t length16;
|
||||
const UChar *s16 = ures_getStringByIndex(resB, index, &length16, status);
|
||||
const UChar *s16 = ures_getStringByIndex(resB, idx, &length16, status);
|
||||
return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
|
||||
}
|
||||
|
||||
|
@ -2154,7 +2154,7 @@ static const UEnumeration gLocalesEnum = {
|
|||
U_CAPI UEnumeration* U_EXPORT2
|
||||
ures_openAvailableLocales(const char *path, UErrorCode *status)
|
||||
{
|
||||
UResourceBundle *index = NULL;
|
||||
UResourceBundle *idx = NULL;
|
||||
UEnumeration *en = NULL;
|
||||
ULocalesContext *myContext = NULL;
|
||||
|
||||
|
@ -2173,8 +2173,8 @@ ures_openAvailableLocales(const char *path, UErrorCode *status)
|
|||
|
||||
ures_initStackObject(&myContext->installed);
|
||||
ures_initStackObject(&myContext->curr);
|
||||
index = ures_openDirect(path, INDEX_LOCALE_NAME, status);
|
||||
ures_getByKey(index, INDEX_TAG, &myContext->installed, status);
|
||||
idx = ures_openDirect(path, INDEX_LOCALE_NAME, status);
|
||||
ures_getByKey(idx, INDEX_TAG, &myContext->installed, status);
|
||||
if(U_SUCCESS(*status)) {
|
||||
#if defined(URES_TREE_DEBUG)
|
||||
fprintf(stderr, "Got %s::%s::[%s] : %s\n",
|
||||
|
@ -2191,7 +2191,7 @@ ures_openAvailableLocales(const char *path, UErrorCode *status)
|
|||
en = NULL;
|
||||
}
|
||||
|
||||
ures_close(index);
|
||||
ures_close(idx);
|
||||
|
||||
return en;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1999-2006, International Business Machines Corporation *
|
||||
* Copyright (C) 1999-2009, International Business Machines Corporation *
|
||||
* and others. All Rights Reserved. *
|
||||
* *
|
||||
*******************************************************************************
|
||||
|
@ -117,7 +117,7 @@ _res_getTable32Item(const Resource *pRoot, const Resource res, int32_t indexR) {
|
|||
|
||||
static Resource
|
||||
_res_findTableItem(const Resource *pRoot, const Resource res, const char *key,
|
||||
int32_t *index, const char **realKey) {
|
||||
int32_t *idx, const char **realKey) {
|
||||
const uint16_t *p=(const uint16_t *)RES_GET_POINTER(pRoot, res);
|
||||
uint32_t mid, start, limit;
|
||||
uint32_t lastMid;
|
||||
|
@ -143,7 +143,7 @@ _res_findTableItem(const Resource *pRoot, const Resource res, const char *key,
|
|||
start = mid;
|
||||
} else {
|
||||
/* We found it! */
|
||||
*index=mid;
|
||||
*idx=mid;
|
||||
*realKey=RES_GET_KEY(pRoot, p[mid]);
|
||||
limit=*(p-1); /* itemCount */
|
||||
return ((const Resource *)(p+limit+(~limit&1)))[mid];
|
||||
|
@ -151,13 +151,13 @@ _res_findTableItem(const Resource *pRoot, const Resource res, const char *key,
|
|||
}
|
||||
}
|
||||
|
||||
*index=URESDATA_ITEM_NOT_FOUND;
|
||||
*idx=URESDATA_ITEM_NOT_FOUND;
|
||||
return RES_BOGUS; /* not found or table is empty. */
|
||||
}
|
||||
|
||||
static Resource
|
||||
_res_findTable32Item(const Resource *pRoot, const Resource res, const char *key,
|
||||
int32_t *index, const char **realKey) {
|
||||
int32_t *idx, const char **realKey) {
|
||||
const int32_t *p=(const int32_t *)RES_GET_POINTER(pRoot, res);
|
||||
int32_t mid, start, limit;
|
||||
int32_t lastMid;
|
||||
|
@ -183,14 +183,14 @@ _res_findTable32Item(const Resource *pRoot, const Resource res, const char *key,
|
|||
start = mid;
|
||||
} else {
|
||||
/* We found it! */
|
||||
*index=mid;
|
||||
*idx=mid;
|
||||
*realKey=RES_GET_KEY(pRoot, p[mid]);
|
||||
return ((const Resource *)(p+(*(p-1))))[mid];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*index=URESDATA_ITEM_NOT_FOUND;
|
||||
*idx=URESDATA_ITEM_NOT_FOUND;
|
||||
return RES_BOGUS; /* not found or table is empty. */
|
||||
}
|
||||
|
||||
|
@ -359,12 +359,12 @@ res_countArrayItems(const ResourceData *pResData, const Resource res) {
|
|||
|
||||
U_CFUNC Resource
|
||||
res_getResource(const ResourceData *pResData, const char *key) {
|
||||
int32_t index;
|
||||
int32_t idx;
|
||||
const char *realKey;
|
||||
if(RES_GET_TYPE(pResData->rootRes)==URES_TABLE) {
|
||||
return _res_findTableItem(pResData->pRoot, pResData->rootRes, key, &index, &realKey);
|
||||
return _res_findTableItem(pResData->pRoot, pResData->rootRes, key, &idx, &realKey);
|
||||
} else {
|
||||
return _res_findTable32Item(pResData->pRoot, pResData->rootRes, key, &index, &realKey);
|
||||
return _res_findTable32Item(pResData->pRoot, pResData->rootRes, key, &idx, &realKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1999-2004, International Business Machines
|
||||
* Copyright (C) 1999-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
|
@ -161,25 +161,25 @@ getPairIndex(UChar32 ch)
|
|||
int32_t pairedCharExtra = pairedCharCount - pairedCharPower;
|
||||
|
||||
int32_t probe = pairedCharPower;
|
||||
int32_t index = 0;
|
||||
int32_t pairIndex = 0;
|
||||
|
||||
if (ch >= pairedChars[pairedCharExtra]) {
|
||||
index = pairedCharExtra;
|
||||
pairIndex = pairedCharExtra;
|
||||
}
|
||||
|
||||
while (probe > (1 << 0)) {
|
||||
probe >>= 1;
|
||||
|
||||
if (ch >= pairedChars[index + probe]) {
|
||||
index += probe;
|
||||
if (ch >= pairedChars[pairIndex + probe]) {
|
||||
pairIndex += probe;
|
||||
}
|
||||
}
|
||||
|
||||
if (pairedChars[index] != ch) {
|
||||
index = -1;
|
||||
if (pairedChars[pairIndex] != ch) {
|
||||
pairIndex = -1;
|
||||
}
|
||||
|
||||
return index;
|
||||
return pairIndex;
|
||||
}
|
||||
|
||||
static UBool
|
||||
|
|
|
@ -217,7 +217,7 @@ _toTitle(UCaseMap *csm,
|
|||
UErrorCode *pErrorCode) {
|
||||
const UChar *s;
|
||||
UChar32 c;
|
||||
int32_t prev, titleStart, titleLimit, index, destIndex, length;
|
||||
int32_t prev, titleStart, titleLimit, idx, destIndex, length;
|
||||
UBool isFirstIndex;
|
||||
|
||||
if(csm->iter!=NULL) {
|
||||
|
@ -241,12 +241,12 @@ _toTitle(UCaseMap *csm,
|
|||
/* find next index where to titlecase */
|
||||
if(isFirstIndex) {
|
||||
isFirstIndex=FALSE;
|
||||
index=ubrk_first(csm->iter);
|
||||
idx=ubrk_first(csm->iter);
|
||||
} else {
|
||||
index=ubrk_next(csm->iter);
|
||||
idx=ubrk_next(csm->iter);
|
||||
}
|
||||
if(index==UBRK_DONE || index>srcLength) {
|
||||
index=srcLength;
|
||||
if(idx==UBRK_DONE || idx>srcLength) {
|
||||
idx=srcLength;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -262,22 +262,22 @@ _toTitle(UCaseMap *csm,
|
|||
* b) first case letter (titlecase) [titleStart..titleLimit[
|
||||
* c) subsequent characters (lowercase) [titleLimit..index[
|
||||
*/
|
||||
if(prev<index) {
|
||||
if(prev<idx) {
|
||||
/* find and copy uncased characters [prev..titleStart[ */
|
||||
titleStart=titleLimit=prev;
|
||||
U16_NEXT(src, titleLimit, index, c);
|
||||
U16_NEXT(src, titleLimit, idx, c);
|
||||
if((csm->options&U_TITLECASE_NO_BREAK_ADJUSTMENT)==0 && UCASE_NONE==ucase_getType(csm->csp, c)) {
|
||||
/* Adjust the titlecasing index (titleStart) to the next cased character. */
|
||||
for(;;) {
|
||||
titleStart=titleLimit;
|
||||
if(titleLimit==index) {
|
||||
if(titleLimit==idx) {
|
||||
/*
|
||||
* only uncased characters in [prev..index[
|
||||
* stop with titleStart==titleLimit==index
|
||||
*/
|
||||
break;
|
||||
}
|
||||
U16_NEXT(src, titleLimit, index, c);
|
||||
U16_NEXT(src, titleLimit, idx, c);
|
||||
if(UCASE_NONE!=ucase_getType(csm->csp, c)) {
|
||||
break; /* cased letter at [titleStart..titleLimit[ */
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ _toTitle(UCaseMap *csm,
|
|||
destIndex=appendResult(dest, destIndex, destCapacity, c, s);
|
||||
|
||||
/* Special case Dutch IJ titlecasing */
|
||||
if ( titleStart+1 < index &&
|
||||
if ( titleStart+1 < idx &&
|
||||
ucase_getCaseLocale(csm->locale,&csm->locCache) == UCASE_LOC_DUTCH &&
|
||||
( src[titleStart] == (UChar32) 0x0049 || src[titleStart] == (UChar32) 0x0069 ) &&
|
||||
( src[titleStart+1] == (UChar32) 0x004A || src[titleStart+1] == (UChar32) 0x006A )) {
|
||||
|
@ -309,7 +309,7 @@ _toTitle(UCaseMap *csm,
|
|||
}
|
||||
|
||||
/* lowercase [titleLimit..index[ */
|
||||
if(titleLimit<index) {
|
||||
if(titleLimit<idx) {
|
||||
if((csm->options&U_TITLECASE_NO_LOWERCASE)==0) {
|
||||
/* Normal operation: Lowercase the rest of the word. */
|
||||
destIndex+=
|
||||
|
@ -317,11 +317,11 @@ _toTitle(UCaseMap *csm,
|
|||
csm, ucase_toFullLower,
|
||||
dest+destIndex, destCapacity-destIndex,
|
||||
src, csc,
|
||||
titleLimit, index,
|
||||
titleLimit, idx,
|
||||
pErrorCode);
|
||||
} else {
|
||||
/* Optionally just copy the rest of the word unchanged. */
|
||||
length=index-titleLimit;
|
||||
length=idx-titleLimit;
|
||||
if((destIndex+length)<=destCapacity) {
|
||||
uprv_memcpy(dest+destIndex, src+titleLimit, length*U_SIZEOF_UCHAR);
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ _toTitle(UCaseMap *csm,
|
|||
}
|
||||
}
|
||||
|
||||
prev=index;
|
||||
prev=idx;
|
||||
}
|
||||
|
||||
if(destIndex>destCapacity) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1998-2008, International Business Machines
|
||||
* Copyright (C) 1998-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -536,9 +536,9 @@ endloop:
|
|||
U_CAPI UChar * U_EXPORT2
|
||||
u_strpbrk(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
int32_t index = _matchFromSet(string, matchSet, TRUE);
|
||||
if(index >= 0) {
|
||||
return (UChar *)string + index;
|
||||
int32_t idx = _matchFromSet(string, matchSet, TRUE);
|
||||
if(idx >= 0) {
|
||||
return (UChar *)string + idx;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -548,11 +548,11 @@ u_strpbrk(const UChar *string, const UChar *matchSet)
|
|||
U_CAPI int32_t U_EXPORT2
|
||||
u_strcspn(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
int32_t index = _matchFromSet(string, matchSet, TRUE);
|
||||
if(index >= 0) {
|
||||
return index;
|
||||
int32_t idx = _matchFromSet(string, matchSet, TRUE);
|
||||
if(idx >= 0) {
|
||||
return idx;
|
||||
} else {
|
||||
return -index - 1; /* == u_strlen(string) */
|
||||
return -idx - 1; /* == u_strlen(string) */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,11 +560,11 @@ u_strcspn(const UChar *string, const UChar *matchSet)
|
|||
U_CAPI int32_t U_EXPORT2
|
||||
u_strspn(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
int32_t index = _matchFromSet(string, matchSet, FALSE);
|
||||
if(index >= 0) {
|
||||
return index;
|
||||
int32_t idx = _matchFromSet(string, matchSet, FALSE);
|
||||
if(idx >= 0) {
|
||||
return idx;
|
||||
} else {
|
||||
return -index - 1; /* == u_strlen(string) */
|
||||
return -idx - 1; /* == u_strlen(string) */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -902,14 +902,14 @@ void fragment {
|
|||
c1-=0x2800;
|
||||
}
|
||||
} else if(c1<=0xdfff) {
|
||||
int32_t index=iter1->getIndex(iter1, UITER_CURRENT);
|
||||
int32_t idx=iter1->getIndex(iter1, UITER_CURRENT);
|
||||
iter1->previous(iter1); /* ==c1 */
|
||||
if(!UTF_IS_LEAD(iter1->previous(iter1))) {
|
||||
/* trail surrogate code point - make <d800 */
|
||||
c1-=0x2800;
|
||||
}
|
||||
/* go back to behind where the difference is */
|
||||
iter1->move(iter1, index, UITER_ZERO);
|
||||
iter1->move(iter1, idx, UITER_ZERO);
|
||||
} else /* 0xe000<=c1<=0xffff */ {
|
||||
/* BMP code point - make <d800 */
|
||||
c1-=0x2800;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2001-2008, International Business Machines
|
||||
* Copyright (C) 2001-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -372,13 +372,13 @@ utrie_setRange32(UNewTrie *trie, UChar32 start, UChar32 limit, uint32_t value, U
|
|||
}
|
||||
|
||||
static int32_t
|
||||
_findSameIndexBlock(const int32_t *index, int32_t indexLength,
|
||||
_findSameIndexBlock(const int32_t *idx, int32_t indexLength,
|
||||
int32_t otherBlock) {
|
||||
int32_t block, i;
|
||||
|
||||
for(block=UTRIE_BMP_INDEX_LENGTH; block<indexLength; block+=UTRIE_SURROGATE_BLOCK_COUNT) {
|
||||
for(i=0; i<UTRIE_SURROGATE_BLOCK_COUNT; ++i) {
|
||||
if(index[block+i]!=index[otherBlock+i]) {
|
||||
if(idx[block+i]!=idx[otherBlock+i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ _findSameIndexBlock(const int32_t *index, int32_t indexLength,
|
|||
static void
|
||||
utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *pErrorCode) {
|
||||
int32_t leadIndexes[UTRIE_SURROGATE_BLOCK_COUNT];
|
||||
int32_t *index;
|
||||
int32_t *idx;
|
||||
uint32_t value;
|
||||
UChar32 c;
|
||||
int32_t indexLength, block;
|
||||
|
@ -410,10 +410,10 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
|
|||
int countLeadCUWithData=0;
|
||||
#endif
|
||||
|
||||
index=trie->index;
|
||||
idx=trie->index;
|
||||
|
||||
/* copy the lead surrogate indexes into a temporary array */
|
||||
uprv_memcpy(leadIndexes, index+(0xd800>>UTRIE_SHIFT), 4*UTRIE_SURROGATE_BLOCK_COUNT);
|
||||
uprv_memcpy(leadIndexes, idx+(0xd800>>UTRIE_SHIFT), 4*UTRIE_SURROGATE_BLOCK_COUNT);
|
||||
|
||||
/*
|
||||
* set all values for lead surrogate code *units* to leadUnitValue
|
||||
|
@ -453,7 +453,7 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
|
|||
|
||||
/* search for any index (stage 1) entries for supplementary code points */
|
||||
for(c=0x10000; c<0x110000;) {
|
||||
if(index[c>>UTRIE_SHIFT]!=0) {
|
||||
if(idx[c>>UTRIE_SHIFT]!=0) {
|
||||
/* there is data, treat the full block for a lead surrogate */
|
||||
c&=~0x3ff;
|
||||
|
||||
|
@ -463,7 +463,7 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
|
|||
#endif
|
||||
|
||||
/* is there an identical index block? */
|
||||
block=_findSameIndexBlock(index, indexLength, c>>UTRIE_SHIFT);
|
||||
block=_findSameIndexBlock(idx, indexLength, c>>UTRIE_SHIFT);
|
||||
|
||||
/*
|
||||
* get a folded value for [c..c+0x400[ and,
|
||||
|
@ -481,8 +481,8 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
|
|||
/* if we did not find an identical index block... */
|
||||
if(block==indexLength) {
|
||||
/* move the actual index (stage 1) entries from the supplementary position to the new one */
|
||||
uprv_memmove(index+indexLength,
|
||||
index+(c>>UTRIE_SHIFT),
|
||||
uprv_memmove(idx+indexLength,
|
||||
idx+(c>>UTRIE_SHIFT),
|
||||
4*UTRIE_SURROGATE_BLOCK_COUNT);
|
||||
indexLength+=UTRIE_SURROGATE_BLOCK_COUNT;
|
||||
}
|
||||
|
@ -516,10 +516,10 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
|
|||
* make space for the lead surrogate index block and
|
||||
* insert it between the BMP indexes and the folded ones
|
||||
*/
|
||||
uprv_memmove(index+UTRIE_BMP_INDEX_LENGTH+UTRIE_SURROGATE_BLOCK_COUNT,
|
||||
index+UTRIE_BMP_INDEX_LENGTH,
|
||||
uprv_memmove(idx+UTRIE_BMP_INDEX_LENGTH+UTRIE_SURROGATE_BLOCK_COUNT,
|
||||
idx+UTRIE_BMP_INDEX_LENGTH,
|
||||
4*(indexLength-UTRIE_BMP_INDEX_LENGTH));
|
||||
uprv_memcpy(index+UTRIE_BMP_INDEX_LENGTH,
|
||||
uprv_memcpy(idx+UTRIE_BMP_INDEX_LENGTH,
|
||||
leadIndexes,
|
||||
4*UTRIE_SURROGATE_BLOCK_COUNT);
|
||||
indexLength+=UTRIE_SURROGATE_BLOCK_COUNT;
|
||||
|
@ -1057,7 +1057,7 @@ U_CAPI void U_EXPORT2
|
|||
utrie_enum(const UTrie *trie,
|
||||
UTrieEnumValue *enumValue, UTrieEnumRange *enumRange, const void *context) {
|
||||
const uint32_t *data32;
|
||||
const uint16_t *index;
|
||||
const uint16_t *idx;
|
||||
|
||||
uint32_t value, prevValue, initialValue;
|
||||
UChar32 c, prev;
|
||||
|
@ -1071,7 +1071,7 @@ utrie_enum(const UTrie *trie,
|
|||
enumValue=enumSameValue;
|
||||
}
|
||||
|
||||
index=trie->index;
|
||||
idx=trie->index;
|
||||
data32=trie->data32;
|
||||
|
||||
/* get the enumeration value that corresponds to an initial-value trie data entry */
|
||||
|
@ -1098,7 +1098,7 @@ utrie_enum(const UTrie *trie,
|
|||
i=c>>UTRIE_SHIFT;
|
||||
}
|
||||
|
||||
block=index[i]<<UTRIE_INDEX_SHIFT;
|
||||
block=idx[i]<<UTRIE_INDEX_SHIFT;
|
||||
if(block==prevBlock) {
|
||||
/* the block is the same as the previous one, and filled with value */
|
||||
c+=UTRIE_DATA_BLOCK_LENGTH;
|
||||
|
@ -1118,7 +1118,7 @@ utrie_enum(const UTrie *trie,
|
|||
} else {
|
||||
prevBlock=block;
|
||||
for(j=0; j<UTRIE_DATA_BLOCK_LENGTH; ++j) {
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : index[block+j]);
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : idx[block+j]);
|
||||
if(value!=prevValue) {
|
||||
if(prev<c) {
|
||||
if(!enumRange(context, prev, c, prevValue)) {
|
||||
|
@ -1140,7 +1140,7 @@ utrie_enum(const UTrie *trie,
|
|||
/* enumerate supplementary code points */
|
||||
for(l=0xd800; l<0xdc00;) {
|
||||
/* lead surrogate access */
|
||||
offset=index[l>>UTRIE_SHIFT]<<UTRIE_INDEX_SHIFT;
|
||||
offset=idx[l>>UTRIE_SHIFT]<<UTRIE_INDEX_SHIFT;
|
||||
if(offset==nullBlock) {
|
||||
/* no entries for a whole block of lead surrogates */
|
||||
if(prevValue!=initialValue) {
|
||||
|
@ -1159,7 +1159,7 @@ utrie_enum(const UTrie *trie,
|
|||
continue;
|
||||
}
|
||||
|
||||
value= data32!=NULL ? data32[offset+(l&UTRIE_MASK)] : index[offset+(l&UTRIE_MASK)];
|
||||
value= data32!=NULL ? data32[offset+(l&UTRIE_MASK)] : idx[offset+(l&UTRIE_MASK)];
|
||||
|
||||
/* enumerate trail surrogates for this lead surrogate */
|
||||
offset=trie->getFoldingOffset(value);
|
||||
|
@ -1184,7 +1184,7 @@ utrie_enum(const UTrie *trie,
|
|||
offset+=UTRIE_SURROGATE_BLOCK_COUNT;
|
||||
do {
|
||||
/* copy of most of the body of the BMP loop */
|
||||
block=index[i]<<UTRIE_INDEX_SHIFT;
|
||||
block=idx[i]<<UTRIE_INDEX_SHIFT;
|
||||
if(block==prevBlock) {
|
||||
/* the block is the same as the previous one, and filled with value */
|
||||
c+=UTRIE_DATA_BLOCK_LENGTH;
|
||||
|
@ -1204,7 +1204,7 @@ utrie_enum(const UTrie *trie,
|
|||
} else {
|
||||
prevBlock=block;
|
||||
for(j=0; j<UTRIE_DATA_BLOCK_LENGTH; ++j) {
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : index[block+j]);
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : idx[block+j]);
|
||||
if(value!=prevValue) {
|
||||
if(prev<c) {
|
||||
if(!enumRange(context, prev, c, prevValue)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2001-2008, International Business Machines
|
||||
* Copyright (C) 2001-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -81,12 +81,12 @@ utrie2_get32FromLeadSurrogateCodeUnit(const UTrie2 *trie, UChar32 c) {
|
|||
|
||||
static U_INLINE int32_t
|
||||
u8Index(const UTrie2 *trie, UChar32 c, int32_t i) {
|
||||
int32_t index=
|
||||
int32_t idx=
|
||||
_UTRIE2_INDEX_FROM_CP(
|
||||
trie,
|
||||
trie->data32==NULL ? trie->indexLength : 0,
|
||||
c);
|
||||
return (index<<3)|i;
|
||||
return (idx<<3)|i;
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
|
@ -509,7 +509,7 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
UChar32 start, UChar32 limit,
|
||||
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange, const void *context) {
|
||||
const uint32_t *data32;
|
||||
const uint16_t *index;
|
||||
const uint16_t *idx;
|
||||
|
||||
uint32_t value, prevValue, initialValue;
|
||||
UChar32 c, prev, highStart;
|
||||
|
@ -524,14 +524,14 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
|
||||
if(trie->newTrie==NULL) {
|
||||
/* frozen trie */
|
||||
index=trie->index;
|
||||
idx=trie->index;
|
||||
data32=trie->data32;
|
||||
|
||||
index2NullOffset=trie->index2NullOffset;
|
||||
nullBlock=trie->dataNullOffset;
|
||||
} else {
|
||||
/* unfrozen, mutable trie */
|
||||
index=NULL;
|
||||
idx=NULL;
|
||||
data32=trie->newTrie->data;
|
||||
|
||||
index2NullOffset=trie->newTrie->index2NullOffset;
|
||||
|
@ -576,8 +576,8 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
}
|
||||
} else {
|
||||
/* supplementary code points */
|
||||
if(index!=NULL) {
|
||||
i2Block=index[(UTRIE2_INDEX_1_OFFSET-UTRIE2_OMITTED_BMP_INDEX_1_LENGTH)+
|
||||
if(idx!=NULL) {
|
||||
i2Block=idx[(UTRIE2_INDEX_1_OFFSET-UTRIE2_OMITTED_BMP_INDEX_1_LENGTH)+
|
||||
(c>>UTRIE2_SHIFT_1)];
|
||||
} else {
|
||||
i2Block=trie->newTrie->index1[c>>UTRIE2_SHIFT_1];
|
||||
|
@ -614,8 +614,8 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
i2Limit=UTRIE2_INDEX_2_BLOCK_LENGTH;
|
||||
}
|
||||
for(; i2<i2Limit; ++i2) {
|
||||
if(index!=NULL) {
|
||||
block=(int32_t)index[i2Block+i2]<<UTRIE2_INDEX_SHIFT;
|
||||
if(idx!=NULL) {
|
||||
block=(int32_t)idx[i2Block+i2]<<UTRIE2_INDEX_SHIFT;
|
||||
} else {
|
||||
block=trie->newTrie->index2[i2Block+i2];
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
c+=UTRIE2_DATA_BLOCK_LENGTH;
|
||||
} else {
|
||||
for(j=0; j<UTRIE2_DATA_BLOCK_LENGTH; ++j) {
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : index[block+j]);
|
||||
value=enumValue(context, data32!=NULL ? data32[block+j] : idx[block+j]);
|
||||
if(value!=prevValue) {
|
||||
if(prev<c && !enumRange(context, prev, c-1, prevValue)) {
|
||||
return;
|
||||
|
@ -657,11 +657,11 @@ enumEitherTrie(const UTrie2 *trie,
|
|||
} else if(c<limit) {
|
||||
/* c==highStart<limit */
|
||||
uint32_t highValue;
|
||||
if(index!=NULL) {
|
||||
if(idx!=NULL) {
|
||||
highValue=
|
||||
data32!=NULL ?
|
||||
data32[trie->highValueIndex] :
|
||||
index[trie->highValueIndex];
|
||||
idx[trie->highValueIndex];
|
||||
} else {
|
||||
highValue=trie->newTrie->data[trie->newTrie->dataLength-UTRIE2_DATA_GRANULARITY];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2001-2008, International Business Machines
|
||||
* Copyright (C) 2001-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -862,14 +862,14 @@ equal_uint32(const uint32_t *s, const uint32_t *t, int32_t length) {
|
|||
}
|
||||
|
||||
static int32_t
|
||||
findSameIndex2Block(const int32_t *index, int32_t index2Length, int32_t otherBlock) {
|
||||
findSameIndex2Block(const int32_t *idx, int32_t index2Length, int32_t otherBlock) {
|
||||
int32_t block;
|
||||
|
||||
/* ensure that we do not even partially get past index2Length */
|
||||
index2Length-=UTRIE2_INDEX_2_BLOCK_LENGTH;
|
||||
|
||||
for(block=0; block<=index2Length; ++block) {
|
||||
if(equal_int32(index+block, index+otherBlock, UTRIE2_INDEX_2_BLOCK_LENGTH)) {
|
||||
if(equal_int32(idx+block, idx+otherBlock, UTRIE2_INDEX_2_BLOCK_LENGTH)) {
|
||||
return block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -704,7 +704,7 @@ void BoyerMooreSearch::setTargetString(const UnicodeString *targetString, UError
|
|||
*/
|
||||
UBool BoyerMooreSearch::search(int32_t offset, int32_t &start, int32_t &end)
|
||||
{
|
||||
UCollator *coll = data->getCollator();
|
||||
/*UCollator *coll =*/ data->getCollator();
|
||||
int32_t plen = patCEs->size();
|
||||
int32_t tlen = target->stringLength();
|
||||
int32_t maxSkip = badCharacterTable->getMaxSkip();
|
||||
|
|
|
@ -262,7 +262,7 @@ static ECalType getCalendarTypeForLocale(const char *locid) {
|
|||
// the first calender type is the default for the region
|
||||
int32_t len = 0;
|
||||
const UChar *uCalType = ures_getStringByIndex(order, 0, &len, &status);
|
||||
if (len < sizeof(calTypeBuf)) {
|
||||
if (len < (int32_t)sizeof(calTypeBuf)) {
|
||||
u_UCharsToChars(uCalType, calTypeBuf, len);
|
||||
*(calTypeBuf + len) = 0; // terminate;
|
||||
calType = getCalendarType(calTypeBuf);
|
||||
|
|
|
@ -73,7 +73,7 @@ CECalendar::operator=(const CECalendar& right)
|
|||
//-------------------------------------------------------------------------
|
||||
|
||||
int32_t
|
||||
CECalendar::handleComputeMonthStart(int32_t eyear,int32_t emonth, UBool useMonth) const
|
||||
CECalendar::handleComputeMonthStart(int32_t eyear,int32_t emonth, UBool /*useMonth*/) const
|
||||
{
|
||||
return ceToJD(eyear, emonth, 0, getJDEpochOffset());
|
||||
}
|
||||
|
|
|
@ -467,10 +467,9 @@ private:
|
|||
UHashtable *cache;
|
||||
};
|
||||
|
||||
U_CFUNC void deleteChars(void *obj)
|
||||
U_CFUNC void deleteChars(void */*obj*/)
|
||||
{
|
||||
char *chars = (char *) obj;
|
||||
|
||||
// char *chars = (char *) obj;
|
||||
// All the key strings are owned by the
|
||||
// CollData objects and don't need to
|
||||
// be freed here.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2003 - 2008, International Business Machines Corporation and *
|
||||
* Copyright (C) 2003 - 2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -73,7 +73,7 @@ CopticCalendar::handleGetExtendedYear()
|
|||
}
|
||||
|
||||
void
|
||||
CopticCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status)
|
||||
CopticCalendar::handleComputeFields(int32_t julianDay, UErrorCode &/*status*/)
|
||||
{
|
||||
int32_t eyear, month, day, era, year;
|
||||
jdToCE(julianDay, getJDEpochOffset(), eyear, month, day);
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
U_CDECL_BEGIN
|
||||
|
||||
/**
|
||||
|
@ -79,7 +78,6 @@ static UBool U_CALLCONV AffixPatternValueComparator(UHashTok val1, UHashTok val2
|
|||
|
||||
U_CDECL_END
|
||||
|
||||
|
||||
UBool
|
||||
U_CALLCONV AffixValueComparator(UHashTok val1, UHashTok val2) {
|
||||
const DecimalFormat::AffixesForCurrency* affix_1 =
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2003 - 2008, International Business Machines Corporation and *
|
||||
* Copyright (C) 2003 - 2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -99,7 +99,7 @@ EthiopicCalendar::handleGetExtendedYear()
|
|||
}
|
||||
|
||||
void
|
||||
EthiopicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status)
|
||||
EthiopicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &/*status*/)
|
||||
{
|
||||
int32_t eyear, month, day, era, year;
|
||||
jdToCE(julianDay, getJDEpochOffset(), eyear, month, day);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2008, International Business Machines Corporation
|
||||
* Copyright (C) 2003-2009, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
******************************************************************************
|
||||
*
|
||||
|
@ -237,7 +237,7 @@ static double IndianToJD(int32_t year, int32_t month, int32_t date) {
|
|||
* @param eyear The year in Indian Calendar measured from Saka Era (78 AD).
|
||||
* @param month The month in Indian calendar
|
||||
*/
|
||||
int32_t IndianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const {
|
||||
int32_t IndianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, UBool /* useMonth */ ) const {
|
||||
|
||||
//month is 0 based; converting it to 1-based
|
||||
int32_t imonth;
|
||||
|
@ -288,7 +288,7 @@ int32_t IndianCalendar::handleGetExtendedYear() {
|
|||
* method is called. The getGregorianXxx() methods return Gregorian
|
||||
* calendar equivalents for the given Julian day.
|
||||
*/
|
||||
void IndianCalendar::handleComputeFields(int32_t julianDay, UErrorCode& status) {
|
||||
void IndianCalendar::handleComputeFields(int32_t julianDay, UErrorCode& /* status */) {
|
||||
double jdAtStartOfGregYear;
|
||||
int32_t leapMonth, IndianYear, yday, IndianMonth, IndianDayOfMonth, mday;
|
||||
int32_t gregorianYear; // Stores gregorian date corresponding to Julian day;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2003-2008, International Business Machines Corporation and *
|
||||
* Copyright (C) 2003-2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*
|
||||
|
@ -278,7 +278,10 @@ static const struct {
|
|||
|
||||
#define kEraCount (sizeof(kEraInfo)/sizeof(kEraInfo[0]))
|
||||
|
||||
static const uint32_t kCurrentEra = (kEraCount-1);
|
||||
/**
|
||||
* The current era, for reference.
|
||||
*/
|
||||
static const int32_t kCurrentEra = (kEraCount-1); // int32_t to match the calendar field type
|
||||
|
||||
static const int32_t kGregorianEpoch = 1970; // used as the default value of EXTENDED_YEAR
|
||||
|
||||
|
|
|
@ -1327,7 +1327,7 @@ SimpleDateFormat::processOverrideString(const Locale &locale, const UnicodeStrin
|
|||
int32_t nsNameHash = nsName.hashCode();
|
||||
// See if the numbering system is in the override list, if not, then add it.
|
||||
NSOverride *cur = fOverrideList;
|
||||
NumberFormat *nf;
|
||||
NumberFormat *nf = NULL;
|
||||
UBool found = FALSE;
|
||||
while ( cur && !found ) {
|
||||
if ( cur->hash == nsNameHash ) {
|
||||
|
|
|
@ -561,7 +561,7 @@ static const char * const CAL_TYPES[] = {
|
|||
};
|
||||
|
||||
U_CAPI UEnumeration* U_EXPORT2
|
||||
ucal_getKeywordValuesForLocale(const char *key, const char* locale, UBool commonlyUsed, UErrorCode *status) {
|
||||
ucal_getKeywordValuesForLocale(const char * /* key */, const char* locale, UBool commonlyUsed, UErrorCode *status) {
|
||||
// Resolve region
|
||||
char prefRegion[ULOC_FULLNAME_CAPACITY] = "";
|
||||
int32_t prefRegionLength = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2006, International Business Machines
|
||||
* Copyright (C) 1999-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -60,19 +60,19 @@ setWeightTrail(uint32_t weight, int32_t length, uint32_t trail) {
|
|||
}
|
||||
|
||||
static U_INLINE uint32_t
|
||||
getWeightByte(uint32_t weight, int32_t index) {
|
||||
return getWeightTrail(weight, index); /* same calculation */
|
||||
getWeightByte(uint32_t weight, int32_t idx) {
|
||||
return getWeightTrail(weight, idx); /* same calculation */
|
||||
}
|
||||
|
||||
static U_INLINE uint32_t
|
||||
setWeightByte(uint32_t weight, int32_t index, uint32_t byte) {
|
||||
setWeightByte(uint32_t weight, int32_t idx, uint32_t byte) {
|
||||
uint32_t mask; /* 0xffffffff except a 00 "hole" for the index-th byte */
|
||||
|
||||
index*=8;
|
||||
mask=((uint32_t)0xffffffff)>>index;
|
||||
index=32-index;
|
||||
mask|=0xffffff00<<index;
|
||||
return (uint32_t)((weight&mask)|(byte<<index));
|
||||
idx*=8;
|
||||
mask=((uint32_t)0xffffffff)>>idx;
|
||||
idx=32-idx;
|
||||
mask|=0xffffff00<<idx;
|
||||
return (uint32_t)((weight&mask)|(byte<<idx));
|
||||
}
|
||||
|
||||
static U_INLINE uint32_t
|
||||
|
|
|
@ -40,7 +40,6 @@ union UHashTok;
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
U_CDECL_BEGIN
|
||||
|
||||
/**
|
||||
|
|
|
@ -813,13 +813,13 @@ ucal_setAttribute(UCalendar* cal,
|
|||
* Get a locale for which calendars are available.
|
||||
* A UCalendar in a locale returned by this function will contain the correct
|
||||
* day and month names for the locale.
|
||||
* @param index The index of the desired locale.
|
||||
* @param localeIndex The index of the desired locale.
|
||||
* @return A locale for which calendars are available, or 0 if none.
|
||||
* @see ucal_countAvailable
|
||||
* @stable ICU 2.0
|
||||
*/
|
||||
U_STABLE const char* U_EXPORT2
|
||||
ucal_getAvailable(int32_t index);
|
||||
ucal_getAvailable(int32_t localeIndex);
|
||||
|
||||
/**
|
||||
* Determine how many locales have calendars available.
|
||||
|
|
|
@ -693,13 +693,13 @@ udat_setNumberFormat( UDateFormat* fmt,
|
|||
* Get a locale for which date/time formatting patterns are available.
|
||||
* A UDateFormat in a locale returned by this function will perform the correct
|
||||
* formatting and parsing for the locale.
|
||||
* @param index The index of the desired locale.
|
||||
* @param localeIndex The index of the desired locale.
|
||||
* @return A locale for which date/time formatting patterns are available, or 0 if none.
|
||||
* @see udat_countAvailable
|
||||
* @stable ICU 2.0
|
||||
*/
|
||||
U_STABLE const char* U_EXPORT2
|
||||
udat_getAvailable(int32_t index);
|
||||
udat_getAvailable(int32_t localeIndex);
|
||||
|
||||
/**
|
||||
* Determine how many locales have date/time formatting patterns available.
|
||||
|
@ -833,7 +833,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols;
|
|||
* @param fmt The formatter to query.
|
||||
* @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
|
||||
* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS
|
||||
* @param index The desired symbol of type type.
|
||||
* @param symbolIndex The desired symbol of type type.
|
||||
* @param result A pointer to a buffer to receive the pattern.
|
||||
* @param resultLength The maximum size of result.
|
||||
* @param status A pointer to an UErrorCode to receive any errors
|
||||
|
@ -845,7 +845,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols;
|
|||
U_STABLE int32_t U_EXPORT2
|
||||
udat_getSymbols(const UDateFormat *fmt,
|
||||
UDateFormatSymbolType type,
|
||||
int32_t index,
|
||||
int32_t symbolIndex,
|
||||
UChar *result,
|
||||
int32_t resultLength,
|
||||
UErrorCode *status);
|
||||
|
@ -873,7 +873,7 @@ udat_countSymbols( const UDateFormat *fmt,
|
|||
* @param format The formatter to set
|
||||
* @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS,
|
||||
* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS
|
||||
* @param index The index of the symbol to set of type type.
|
||||
* @param symbolIndex The index of the symbol to set of type type.
|
||||
* @param value The new value
|
||||
* @param valueLength The length of value, or -1 if null-terminated
|
||||
* @param status A pointer to an UErrorCode to receive any errors
|
||||
|
@ -884,7 +884,7 @@ udat_countSymbols( const UDateFormat *fmt,
|
|||
U_STABLE void U_EXPORT2
|
||||
udat_setSymbols( UDateFormat *format,
|
||||
UDateFormatSymbolType type,
|
||||
int32_t index,
|
||||
int32_t symbolIndex,
|
||||
UChar *value,
|
||||
int32_t valueLength,
|
||||
UErrorCode *status);
|
||||
|
|
|
@ -512,13 +512,13 @@ unum_applyPattern( UNumberFormat *format,
|
|||
* A UNumberFormat in a locale returned by this function will perform the correct
|
||||
* formatting and parsing for the locale. The results of this call are not
|
||||
* valid for rule-based number formats.
|
||||
* @param index The index of the desired locale.
|
||||
* @param localeIndex The index of the desired locale.
|
||||
* @return A locale for which number formatting patterns are available, or 0 if none.
|
||||
* @see unum_countAvailable
|
||||
* @stable ICU 2.0
|
||||
*/
|
||||
U_STABLE const char* U_EXPORT2
|
||||
unum_getAvailable(int32_t index);
|
||||
unum_getAvailable(int32_t localeIndex);
|
||||
|
||||
/**
|
||||
* Determine how many locales have decimal formatting patterns available. The
|
||||
|
|
|
@ -1019,7 +1019,7 @@ le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount,
|
|||
|
||||
IndicReorderingOutput output(outChars, glyphStorage, NULL);
|
||||
le_int32 i, firstConsonant, baseConsonant, secondConsonant, inv_count = 0, beginSyllable = 0;
|
||||
le_bool lastInWord = FALSE;
|
||||
//le_bool lastInWord = FALSE;
|
||||
|
||||
while (beginSyllable < charCount) {
|
||||
le_int32 nextSyllable = findSyllable(classTable, chars, beginSyllable, charCount);
|
||||
|
@ -1139,7 +1139,7 @@ le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount,
|
|||
}
|
||||
|
||||
|
||||
void IndicReordering::getDynamicProperties( DynamicProperties *dProps, const IndicClassTable *classTable ) {
|
||||
void IndicReordering::getDynamicProperties( DynamicProperties */*dProps*/, const IndicClassTable *classTable ) {
|
||||
|
||||
|
||||
LEUnicode currentChar;
|
||||
|
@ -1149,7 +1149,7 @@ void IndicReordering::getDynamicProperties( DynamicProperties *dProps, const Ind
|
|||
|
||||
IndicReorderingOutput workOutput(workChars, workGlyphs, NULL);
|
||||
|
||||
le_int32 offset = 0;
|
||||
//le_int32 offset = 0;
|
||||
|
||||
// First find the relevant virama for the script we are dealing with
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1998-2004, International Business Machines Corporation
|
||||
* Copyright (C) 1998-2009, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
|
@ -304,13 +304,13 @@ static void get_symbols(const UDateFormat *fmt,
|
|||
}
|
||||
|
||||
for(i = 0; i < arrayLength; i++) {
|
||||
int32_t index = (i + firstIndex) % arrayLength;
|
||||
int32_t size = 1 + udat_getSymbols(fmt, type, index + lowestIndex, NULL, 0, status);
|
||||
int32_t idx = (i + firstIndex) % arrayLength;
|
||||
int32_t size = 1 + udat_getSymbols(fmt, type, idx + lowestIndex, NULL, 0, status);
|
||||
|
||||
array[index] = (UChar *) malloc(sizeof(UChar) * size);
|
||||
array[idx] = (UChar *) malloc(sizeof(UChar) * size);
|
||||
|
||||
*status = U_ZERO_ERROR;
|
||||
udat_getSymbols(fmt, type, index + lowestIndex, array[index], size, status);
|
||||
udat_getSymbols(fmt, type, idx + lowestIndex, array[idx], size, status);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ CollationAPITest::TestProperty(/* char* par */)
|
|||
doAssert((col->compare("black bird", "black-bird") == Collator::LESS), "black bird > black-bird comparison failed");
|
||||
doAssert((col->compare("Hello", "hello") == Collator::GREATER), "Hello > hello comparison failed");
|
||||
|
||||
doAssert((col->compareUTF8("\x61\x62\xc3\xa4", "\x61\x62\xc3\x9f", success) == Collator::LESS), "ab a-umlaut < ab sharp-s UTF-8 comparison failed");
|
||||
doAssert((col->compareUTF8("\x61\x62\xc3\xa4", "\x61\x62\xc3\x9f", success) == UCOL_LESS), "ab a-umlaut < ab sharp-s UTF-8 comparison failed");
|
||||
success = U_ZERO_ERROR;
|
||||
{
|
||||
UnicodeString abau=UNICODE_STRING_SIMPLE("\\x61\\x62\\xe4").unescape();
|
||||
|
@ -141,7 +141,7 @@ CollationAPITest::TestProperty(/* char* par */)
|
|||
UCharIterator abauIter, abssIter;
|
||||
uiter_setReplaceable(&abauIter, &abau);
|
||||
uiter_setReplaceable(&abssIter, &abss);
|
||||
doAssert((col->compare(abauIter, abssIter, success) == Collator::LESS), "ab a-umlaut < ab sharp-s UCharIterator comparison failed");
|
||||
doAssert((col->compare(abauIter, abssIter, success) == UCOL_LESS), "ab a-umlaut < ab sharp-s UCharIterator comparison failed");
|
||||
success = U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -1911,7 +1911,7 @@ void CalendarTest::TestDebug()
|
|||
continue;
|
||||
}
|
||||
for(int32_t i=0;i<=count;i++) {
|
||||
if(i<count) {
|
||||
if(t<=UDBG_HIGHEST_CONTIGUOUS_ENUM && i<count) {
|
||||
if( i!=udbg_enumArrayValue((UDebugEnumType)t, i)) {
|
||||
errln("FAIL: udbg_enumArrayValue(%d,%d) returned %d, expected %d", t, i, udbg_enumArrayValue((UDebugEnumType)t,i), i);
|
||||
}
|
||||
|
@ -1920,7 +1920,7 @@ void CalendarTest::TestDebug()
|
|||
}
|
||||
const char *name = udbg_enumName((UDebugEnumType)t,i);
|
||||
if(name==NULL) {
|
||||
if(i==count) {
|
||||
if(i==count || t>UDBG_HIGHEST_CONTIGUOUS_ENUM ) {
|
||||
logln(" null name - expected.\n");
|
||||
} else {
|
||||
errln("FAIL: udbg_enumName(%d,%d) returned NULL", t, i);
|
||||
|
@ -1931,7 +1931,7 @@ void CalendarTest::TestDebug()
|
|||
name, udbg_enumArrayValue((UDebugEnumType)t,i));
|
||||
logln("udbg_enumString = " + udbg_enumString((UDebugEnumType)t,i));
|
||||
}
|
||||
if(udbg_enumExpectedCount((UDebugEnumType)t) != count) {
|
||||
if(udbg_enumExpectedCount((UDebugEnumType)t) != count && t<=UDBG_HIGHEST_CONTIGUOUS_ENUM) {
|
||||
errln("FAIL: udbg_enumExpectedCount(%d): %d, != UCAL_FIELD_COUNT=%d ", t, udbg_enumExpectedCount((UDebugEnumType)t), count);
|
||||
} else {
|
||||
logln("udbg_ucal_fieldCount: %d, UCAL_FIELD_COUNT=udbg_enumCount %d ", udbg_enumExpectedCount((UDebugEnumType)t), count);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2008, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
|
||||
|
@ -196,10 +196,10 @@ void DataDrivenFormatTest::testConvertDate(TestData *testData,
|
|||
cal->setTime(now, status);
|
||||
for (int q=0; q<UCAL_FIELD_COUNT; q++) {
|
||||
if (fromSet.isSet((UCalendarDateFields)q)) {
|
||||
int32_t oldv = cal->get((UCalendarDateFields)q, status);
|
||||
//int32_t oldv = cal->get((UCalendarDateFields)q, status);
|
||||
cal->add((UCalendarDateFields)q,
|
||||
fromSet.get((UCalendarDateFields)q), status);
|
||||
int32_t newv = cal->get((UCalendarDateFields)q, status);
|
||||
//int32_t newv = cal->get((UCalendarDateFields)q, status);
|
||||
}
|
||||
}
|
||||
fromDate = cal->getTime(status);
|
||||
|
|
|
@ -3147,7 +3147,7 @@ void DateFormatTest::Test6338(void)
|
|||
void DateFormatTest::Test6726(void)
|
||||
{
|
||||
// status
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
// UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
// fmtf, fmtl, fmtm, fmts;
|
||||
UnicodeString strf, strl, strm, strs;
|
||||
|
|
|
@ -150,8 +150,8 @@ void DateIntervalFormatTest::testAPI() {
|
|||
|
||||
status = U_ZERO_ERROR;
|
||||
logln("Testing DateIntervalFormat getDateFormat");
|
||||
const DateFormat* fmt = another->getDateFormat();
|
||||
/*
|
||||
const DateFormat* fmt = another->getDateFormat();
|
||||
dtitvfmt->setDateFormat(*fmt, status);
|
||||
const DateFormat* anotherFmt = dtitvfmt->getDateFormat();
|
||||
if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
|
||||
|
@ -165,6 +165,7 @@ void DateIntervalFormatTest::testAPI() {
|
|||
if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
|
||||
dataerrln("ERROR: adoptDateFormat failed");
|
||||
}
|
||||
delete fmt;
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ void IntlTestUtilities::runIndexedTest( int32_t index, UBool exec, const char* &
|
|||
}
|
||||
}
|
||||
|
||||
void ErrorCodeTest::runIndexedTest(int32_t index, UBool exec, const char* &name, char* par) {
|
||||
void ErrorCodeTest::runIndexedTest(int32_t index, UBool exec, const char* &name, char* /*par*/) {
|
||||
if (exec) logln("TestSuite Utilities: ");
|
||||
switch (index) {
|
||||
case 0: name = "TestErrorCode"; if (exec) TestErrorCode(); break;
|
||||
|
|
|
@ -2664,6 +2664,7 @@ void NumberFormatTest::TestNumberingSystems() {
|
|||
delete fmt1;
|
||||
delete fmt2;
|
||||
delete fmt3;
|
||||
delete fmt4;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2008, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
|
||||
|
@ -409,7 +409,7 @@ void IntlTestCollator::backAndForth(CollationElementIterator &iter)
|
|||
|
||||
while ((o = iter.previous(status)) != CollationElementIterator::NULLORDER)
|
||||
{
|
||||
int32_t offset = iter.getOffset();
|
||||
/*int32_t offset = */iter.getOffset();
|
||||
|
||||
if (index == 0) {
|
||||
if(o == 0) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 2007-2008, International Business Machines Corporation and
|
||||
* Copyright (c) 2007-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
|
||||
|
@ -98,7 +98,9 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByString(UDebugEnumType type, cons
|
|||
// initialize array
|
||||
udbg_enumString(type,0);
|
||||
// search
|
||||
/// printf("type=%d\n", type); fflush(stdout);
|
||||
for(int i=0;i<udbg_enumCount(type);i++) {
|
||||
// printf("i=%d/%d\n", i, udbg_enumCount(type)); fflush(stdout);
|
||||
if(string == (strs[type][i])) {
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -1,37 +1,79 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 2007, International Business Machines Corporation and
|
||||
* Copyright (c) 2007-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
|
||||
#include "unicode/udbgutil.h"
|
||||
|
||||
/*
|
||||
To add a new enum type
|
||||
(For example: UShoeSize with values USHOE_WIDE=0, USHOE_REGULAR, USHOE_NARROW, USHOE_COUNT)
|
||||
|
||||
1. udbgutil.h: add UDBG_UShoeSize to the UDebugEnumType enum before UDBG_ENUM_COUNT
|
||||
( The subsequent steps involve this file, udbgutil.cpp )
|
||||
2. Find the marker "Add new enum types above this line"
|
||||
3. Before that marker, add a #include of any header file you need.
|
||||
4. Each enum type has three things in this section: a #define, a count_, and an array of Fields.
|
||||
It may help to copy and paste a previous definition.
|
||||
5. In the case of the USHOE_... strings above, "USHOE_" is common to all values- six characters
|
||||
" #define LEN_USHOE 6 "
|
||||
6 characters will strip off "USHOE_" leaving enum values of WIDE, REGULAR, and NARROW.
|
||||
6. Define the 'count_' variable, with the number of enum values. If the enum has a _MAX or _COUNT value,
|
||||
that can be helpful for automatically defining the count. Otherwise define it manually.
|
||||
" static const int32_t count_UShoeSize = USHOE_COUNT; "
|
||||
7. Define the field names, in order.
|
||||
" static const Field names_UShoeSize[] = {
|
||||
" FIELD_NAME_STR( LEN_USHOE, USHOE_WIDE ),
|
||||
" FIELD_NAME_STR( LEN_USHOE, USHOE_REGULAR ),
|
||||
" FIELD_NAME_STR( LEN_USHOE, USHOE_NARROW ),
|
||||
" };
|
||||
( The following command was usedfor converting ucol.h into partially correct entities )
|
||||
grep "^[ ]*UCOL" < unicode/ucol.h |
|
||||
sed -e 's%^[ ]*\([A-Z]*\)_\([A-Z_]*\).*% FIELD_NAME_STR( LEN_\1, \1_\2 ),%g'
|
||||
8. Now, a bit farther down, add the name of the enum itself to the end of names_UDebugEnumType
|
||||
( UDebugEnumType is an enum, too!)
|
||||
names_UDebugEnumType[] { ...
|
||||
" FIELD_NAME_STR( LEN_UDBG, UDBG_UShoeSize ), "
|
||||
9. Find the function _udbg_enumCount and add the count macro:
|
||||
" COUNT_CASE(UShoeSize)
|
||||
10. Find the function _udbg_enumFields and add the field macro:
|
||||
" FIELD_CASE(UShoeSize)
|
||||
11. verify that your test code, and Java data generation, works properly.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Structure representing an enum value
|
||||
*/
|
||||
struct Field {
|
||||
int32_t prefix; /* how many characters to remove - i.e. UCHAR_ = 5 */
|
||||
const char *str;
|
||||
int32_t num;
|
||||
int32_t prefix; /**< how many characters to remove in the prefix - i.e. UCHAR_ = 5 */
|
||||
const char *str; /**< The actual string value */
|
||||
int32_t num; /**< The numeric value */
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate the size of an array.
|
||||
*/
|
||||
#define DBG_ARRAY_COUNT(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
|
||||
// The fields
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/ucal.h"
|
||||
// Calendar
|
||||
|
||||
|
||||
// 'UCAL_' = 5
|
||||
/**
|
||||
* Define another field name. Used in an array of Field s
|
||||
* @param y the common prefix length (i.e. 6 for "USHOE_" )
|
||||
* @param x the actual enum value - it will be copied in both string and symbolic form.
|
||||
* @see Field
|
||||
*/
|
||||
#define FIELD_NAME_STR(y,x) { y, #x, x }
|
||||
|
||||
|
||||
// TODO: Currently, this whole functionality goes away with UCONFIG_NO_FORMATTING. Should be split up.
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
// Calendar
|
||||
#include "unicode/ucal.h"
|
||||
|
||||
// 'UCAL_' = 5
|
||||
#define LEN_UCAL 5 /* UCAL_ */
|
||||
|
||||
static const int32_t count_UCalendarDateFields = UCAL_FIELD_COUNT;
|
||||
|
||||
static const Field names_UCalendarDateFields[] =
|
||||
{
|
||||
FIELD_NAME_STR( LEN_UCAL, UCAL_ERA ),
|
||||
|
@ -61,7 +103,6 @@ static const Field names_UCalendarDateFields[] =
|
|||
|
||||
|
||||
static const int32_t count_UCalendarMonths = UCAL_UNDECIMBER+1;
|
||||
|
||||
static const Field names_UCalendarMonths[] =
|
||||
{
|
||||
FIELD_NAME_STR( LEN_UCAL, UCAL_JANUARY ),
|
||||
|
@ -82,9 +123,7 @@ static const Field names_UCalendarMonths[] =
|
|||
#include "unicode/udat.h"
|
||||
|
||||
#define LEN_UDAT 5 /* "UDAT_" */
|
||||
|
||||
static const int32_t count_UDateFormatStyle = UDAT_SHORT+1;
|
||||
|
||||
static const Field names_UDateFormatStyle[] =
|
||||
{
|
||||
FIELD_NAME_STR( LEN_UDAT, UDAT_FULL ),
|
||||
|
@ -98,38 +137,70 @@ static const Field names_UDateFormatStyle[] =
|
|||
FIELD_NAME_STR( LEN_UDAT, UDAT_IGNORE ),
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
|
||||
#define LEN_UAR 12 /* "ULOC_ACCEPT_" */
|
||||
static const int32_t count_UAcceptResult = 3;
|
||||
static const Field names_UAcceptResult[] =
|
||||
{
|
||||
FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_FAILED ),
|
||||
FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_VALID ),
|
||||
FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_FALLBACK ),
|
||||
};
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
#include "unicode/ucol.h"
|
||||
#define LEN_UCOL 5 /* UCOL_ */
|
||||
static const int32_t count_UColAttributeValue = UCOL_ATTRIBUTE_VALUE_COUNT;
|
||||
static const Field names_UColAttributeValue[] = {
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_PRIMARY ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_SECONDARY ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_TERTIARY ),
|
||||
// FIELD_NAME_STR( LEN_UCOL, UCOL_CE_STRENGTH_LIMIT ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_QUATERNARY ),
|
||||
// gap
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_IDENTICAL ),
|
||||
// FIELD_NAME_STR( LEN_UCOL, UCOL_STRENGTH_LIMIT ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_OFF ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_ON ),
|
||||
// gap
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_SHIFTED ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_NON_IGNORABLE ),
|
||||
// gap
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_LOWER_FIRST ),
|
||||
FIELD_NAME_STR( LEN_UCOL, UCOL_UPPER_FIRST ),
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define LEN_UDBG 5 /* "UDBG_" */
|
||||
|
||||
static const int32_t count_UDebugEnumType = UDBG_ENUM_COUNT;
|
||||
|
||||
static const Field names_UDebugEnumType[] =
|
||||
{
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UDebugEnumType ),
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UCalendarDateFields ),
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UCalendarMonths ),
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UDateFormatStyle ),
|
||||
#endif
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UAcceptResult ),
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
FIELD_NAME_STR( LEN_UDBG, UDBG_UColAttributeValue ),
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
// --- Add new enum types above this line ---
|
||||
|
||||
#define COUNT_CASE(x) case UDBG_##x: return (actual?count_##x:DBG_ARRAY_COUNT(names_##x));
|
||||
#define COUNT_FAIL_CASE(x) case UDBG_##x: return -1;
|
||||
|
||||
#define FIELD_CASE(x) case UDBG_##x: return names_##x;
|
||||
#define FIELD_FAIL_CASE(x) case UDBG_##x: return NULL;
|
||||
|
||||
#else
|
||||
|
||||
#define COUNT_CASE(x)
|
||||
#define COUNT_FAIL_CASE(x)
|
||||
|
||||
#define FIELD_CASE(X)
|
||||
#define FIELD_FAIL_CASE(x)
|
||||
|
||||
#endif
|
||||
|
||||
// low level
|
||||
|
||||
/**
|
||||
|
@ -139,9 +210,15 @@ static const Field names_UDebugEnumType[] =
|
|||
static int32_t _udbg_enumCount(UDebugEnumType type, UBool actual) {
|
||||
switch(type) {
|
||||
COUNT_CASE(UDebugEnumType)
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
COUNT_CASE(UCalendarDateFields)
|
||||
COUNT_CASE(UCalendarMonths)
|
||||
COUNT_CASE(UDateFormatStyle)
|
||||
#endif
|
||||
COUNT_CASE(UAcceptResult)
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
COUNT_CASE(UColAttributeValue)
|
||||
#endif
|
||||
// COUNT_FAIL_CASE(UNonExistentEnum)
|
||||
default:
|
||||
return -1;
|
||||
|
@ -151,10 +228,16 @@ static int32_t _udbg_enumCount(UDebugEnumType type, UBool actual) {
|
|||
static const Field* _udbg_enumFields(UDebugEnumType type) {
|
||||
switch(type) {
|
||||
FIELD_CASE(UDebugEnumType)
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
FIELD_CASE(UCalendarDateFields)
|
||||
FIELD_CASE(UCalendarMonths)
|
||||
FIELD_CASE(UDateFormatStyle)
|
||||
#endif
|
||||
FIELD_CASE(UAcceptResult)
|
||||
// FIELD_FAIL_CASE(UNonExistentEnum)
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
FIELD_CASE(UColAttributeValue)
|
||||
#endif
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -195,5 +278,25 @@ int32_t udbg_enumArrayValue(UDebugEnumType type, int32_t field) {
|
|||
} else {
|
||||
return fields[field].num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32_t udbg_enumByName(UDebugEnumType type, const char *value) {
|
||||
if(type<0||type>=_udbg_enumCount(UDBG_UDebugEnumType, TRUE)) {
|
||||
return -1; // type out of range
|
||||
}
|
||||
const Field *fields = _udbg_enumFields(type);
|
||||
for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
|
||||
if(!strcmp(value, fields[field].str + fields[field].prefix)) {
|
||||
return fields[field].num;
|
||||
}
|
||||
}
|
||||
// try with the prefix
|
||||
for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
|
||||
if(!strcmp(value, fields[field].str)) {
|
||||
return fields[field].num;
|
||||
}
|
||||
}
|
||||
// fail
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
************************************************************************
|
||||
* Copyright (c) 2008, International Business Machines
|
||||
* Copyright (c) 2008-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
************************************************************************
|
||||
*/
|
||||
|
@ -16,10 +16,21 @@
|
|||
|
||||
enum UDebugEnumType {
|
||||
UDBG_UDebugEnumType = 0, /* Self-referential, strings for UDebugEnumType. Count=ENUM_COUNT. */
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
UDBG_UCalendarDateFields, /* UCalendarDateFields. Count=UCAL_FIELD_COUNT. Unsupported if UCONFIG_NO_FORMATTING. */
|
||||
UDBG_UCalendarMonths, /* UCalendarMonths. Count= (UCAL_UNDECIMBER+1) */
|
||||
UDBG_UDateFormatStyle, /* Count = UDAT_SHORT=1 */
|
||||
#endif
|
||||
|
||||
UDBG_UAcceptResult, /* Count = ULOC_ACCEPT_FALLBACK+1=3 */
|
||||
|
||||
/* All following enums may be discontiguous. */
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
UDBG_UColAttributeValue, /* UCOL_ATTRIBUTE_VALUE_COUNT */
|
||||
#endif
|
||||
UDBG_ENUM_COUNT,
|
||||
UDBG_HIGHEST_CONTIGUOUS_ENUM = UDBG_UAcceptResult, /**< last enum in this list with contiguous (testable) values. */
|
||||
UDBG_INVALID_ENUM = -1 /** Invalid enum value **/
|
||||
};
|
||||
|
||||
|
@ -56,4 +67,12 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumExpectedCount(UDebugEnumType type);
|
|||
*/
|
||||
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumArrayValue(UDebugEnumType type, int32_t field);
|
||||
|
||||
/**
|
||||
* Locate the specified field value by name.
|
||||
* @param type which type
|
||||
* @param name name of string (case sensitive)
|
||||
* @return should be a field value or -1 if not found.
|
||||
*/
|
||||
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByName(UDebugEnumType type, const char *name);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2008, International Business Machines
|
||||
* Copyright (C) 1999-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -142,6 +142,12 @@ static UConverterAliasOptions tableOptions = {
|
|||
1 /* containsCnvOptionInfo */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* path to convrtrs.txt
|
||||
*/
|
||||
const char *path;
|
||||
|
||||
/* prototypes --------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
|
@ -212,7 +218,6 @@ static UOption options[]={
|
|||
extern int
|
||||
main(int argc, char* argv[]) {
|
||||
char pathBuf[512];
|
||||
const char *path;
|
||||
FileStream *in;
|
||||
UNewDataMemory *out;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
@ -276,7 +281,7 @@ main(int argc, char* argv[]) {
|
|||
|
||||
in=T_FileStream_open(path, "r");
|
||||
if(in==NULL) {
|
||||
fprintf(stderr, "gencnval: unable to open input file convrtrs.txt\n");
|
||||
fprintf(stderr, "gencnval: unable to open input file %s\n", path);
|
||||
exit(U_FILE_ACCESS_ERROR);
|
||||
}
|
||||
parseFile(in);
|
||||
|
@ -337,11 +342,11 @@ parseFile(FileStream *in) {
|
|||
|
||||
if (validParse || lineSize > 0) {
|
||||
if (isspace(*line)) {
|
||||
fprintf(stderr, "error(line %d): cannot start an alias with a space\n", lineNum-1);
|
||||
fprintf(stderr, "%s:%d: error: cannot start an alias with a space\n", path, lineNum-1);
|
||||
exit(U_PARSE_ERROR);
|
||||
} else if (line[0] == '{') {
|
||||
if (!standardTagsUsed && line[lineSize - 1] != '}') {
|
||||
fprintf(stderr, "error(line %d): alias needs to start with a converter name\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: alias needs to start with a converter name\n", path, lineNum);
|
||||
exit(U_PARSE_ERROR);
|
||||
}
|
||||
addOfficialTaggedStandards(line, lineSize);
|
||||
|
@ -351,7 +356,7 @@ parseFile(FileStream *in) {
|
|||
parseLine(line);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "error(line %d): alias table needs to start a list of standard tags\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: alias table needs to start a list of standard tags\n", path, lineNum);
|
||||
exit(U_PARSE_ERROR);
|
||||
}
|
||||
}
|
||||
|
@ -492,7 +497,7 @@ parseLine(const char *line) {
|
|||
if (line[pos] == '}') {
|
||||
++pos;
|
||||
} else {
|
||||
fprintf(stderr, "error(line %d): Unterminated tag list\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: Unterminated tag list\n", path, lineNum);
|
||||
exit(U_UNMATCHED_BRACES);
|
||||
}
|
||||
} else {
|
||||
|
@ -508,7 +513,7 @@ getTagNumber(const char *tag, uint16_t tagLen) {
|
|||
UBool preferredName = ((tagLen > 0) ? (tag[tagLen - 1] == '*') : (FALSE));
|
||||
|
||||
if (tagCount >= MAX_TAG_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many tags\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: too many tags\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
||||
|
@ -526,7 +531,7 @@ getTagNumber(const char *tag, uint16_t tagLen) {
|
|||
|
||||
/* we need to add this tag */
|
||||
if (tagCount >= MAX_TAG_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many tags\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: too many tags\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
||||
|
@ -534,13 +539,13 @@ getTagNumber(const char *tag, uint16_t tagLen) {
|
|||
atag = allocString(&tagBlock, tag, tagLen);
|
||||
|
||||
if (standardTagsUsed) {
|
||||
fprintf(stderr, "error(line %d): Tag \"%s\" is not declared at the beginning of the alias table.\n",
|
||||
lineNum, atag);
|
||||
fprintf(stderr, "%s:%d: error: Tag \"%s\" is not declared at the beginning of the alias table.\n",
|
||||
path, lineNum, atag);
|
||||
exit(1);
|
||||
}
|
||||
else if (tagLen > 0 && strcmp(tag, ALL_TAG_STR) != 0) {
|
||||
fprintf(stderr, "warning(line %d): Tag \"%s\" was added to the list of standards because it was not declared at beginning of the alias table.\n",
|
||||
lineNum, atag);
|
||||
fprintf(stderr, "%s:%d: warning: Tag \"%s\" was added to the list of standards because it was not declared at beginning of the alias table.\n",
|
||||
path, lineNum, atag);
|
||||
}
|
||||
|
||||
/* add the tag to the tag table */
|
||||
|
@ -564,19 +569,19 @@ addOfficialTaggedStandards(char *line, int32_t lineLen) {
|
|||
static const char WHITESPACE[] = " \t";
|
||||
|
||||
if (tagCount > UCNV_NUM_RESERVED_TAGS) {
|
||||
fprintf(stderr, "error(line %d): official tags already added\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: official tags already added\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
tag = strchr(line, '{');
|
||||
if (tag == NULL) {
|
||||
/* Why were we called? */
|
||||
fprintf(stderr, "error(line %d): Missing start of tag group\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: Missing start of tag group\n", path, lineNum);
|
||||
exit(U_PARSE_ERROR);
|
||||
}
|
||||
tag++;
|
||||
endTagExp = strchr(tag, '}');
|
||||
if (endTagExp == NULL) {
|
||||
fprintf(stderr, "error(line %d): Missing end of tag group\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: Missing end of tag group\n", path, lineNum);
|
||||
exit(U_PARSE_ERROR);
|
||||
}
|
||||
endTagExp[0] = 0;
|
||||
|
@ -607,7 +612,7 @@ addToKnownAliases(const char *alias) {
|
|||
if (knownAliases[idx] != num
|
||||
&& uprv_strcmp(alias, GET_ALIAS_STR(knownAliases[idx])) == 0)
|
||||
{
|
||||
fprintf(stderr, "warning(line %d): duplicate alias %s and %s found\n",
|
||||
fprintf(stderr, "%s:%d: warning: duplicate alias %s and %s found\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(knownAliases[idx]));
|
||||
duplicateKnownAliasesCount++;
|
||||
break;
|
||||
|
@ -616,7 +621,7 @@ addToKnownAliases(const char *alias) {
|
|||
&& ucnv_compareNames(alias, GET_ALIAS_STR(knownAliases[idx])) == 0)
|
||||
{
|
||||
if (verbose) {
|
||||
fprintf(stderr, "information(line %d): duplicate alias %s and %s found\n",
|
||||
fprintf(stderr, "%s:%d: information: duplicate alias %s and %s found\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(knownAliases[idx]));
|
||||
}
|
||||
duplicateKnownAliasesCount++;
|
||||
|
@ -625,8 +630,8 @@ addToKnownAliases(const char *alias) {
|
|||
}
|
||||
*/
|
||||
if (knownAliasesCount >= MAX_ALIAS_COUNT) {
|
||||
fprintf(stderr, "warning(line %d): Too many aliases defined for all converters\n",
|
||||
lineNum);
|
||||
fprintf(stderr, "%s:%d: warning: Too many aliases defined for all converters\n",
|
||||
path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
/* TODO: We could try to unlist exact duplicates. */
|
||||
|
@ -644,22 +649,22 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
|
|||
AliasList *aliasList;
|
||||
|
||||
if(standard>=MAX_TAG_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many standard tags\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: too many standard tags\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
if(converter>=MAX_CONV_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many converter names\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: too many converter names\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
aliasList = &tags[standard].aliasList[converter];
|
||||
|
||||
if (strchr(alias, '}')) {
|
||||
fprintf(stderr, "error(line %d): unmatched } found\n",
|
||||
fprintf(stderr, "%s:%d: error: unmatched } found\n", path,
|
||||
lineNum);
|
||||
}
|
||||
|
||||
if(aliasList->aliasCount + 1 >= MAX_TC_ALIAS_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many aliases for alias %s and converter %s\n",
|
||||
fprintf(stderr, "%s:%d: error: too many aliases for alias %s and converter %s\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(converters[converter].converter));
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
@ -696,13 +701,13 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
|
|||
* not just a lenient-match duplicate.
|
||||
*/
|
||||
if (verbose || 0 == uprv_strcmp(alias, GET_ALIAS_STR(aliasNum))) {
|
||||
fprintf(stderr, "warning(line %d): duplicate aliases %s and %s found for standard %s and converter %s\n",
|
||||
fprintf(stderr, "%s:%d: warning: duplicate aliases %s and %s found for standard %s and converter %s\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(aliasNum),
|
||||
GET_TAG_STR(tags[standard].tag),
|
||||
GET_ALIAS_STR(converters[converter].converter));
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "warning(line %d): duplicate aliases %s and %s found for standard tag %s between converter %s and converter %s\n",
|
||||
fprintf(stderr, "%s:%d: warning: duplicate aliases %s and %s found for standard tag %s between converter %s and converter %s\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(aliasNum),
|
||||
GET_TAG_STR(tags[standard].tag),
|
||||
GET_ALIAS_STR(converters[converter].converter),
|
||||
|
@ -723,7 +728,7 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
|
|||
if (aliasNum
|
||||
&& ucnv_compareNames(alias, GET_ALIAS_STR(aliasNum)) == 0)
|
||||
{
|
||||
fprintf(stderr, "warning(line %d): duplicate alias %s found for converter %s and standard tag %s\n",
|
||||
fprintf(stderr, "%s:%d: warning: duplicate alias %s found for converter %s and standard tag %s\n", path,
|
||||
lineNum, alias, GET_ALIAS_STR(converters[converter].converter), GET_TAG_STR(tags[standard].tag));
|
||||
break;
|
||||
}
|
||||
|
@ -742,7 +747,7 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
|
|||
}
|
||||
if (defaultName) {
|
||||
if (aliasList->aliases[0] != 0) {
|
||||
fprintf(stderr, "error(line %d): Alias %s and %s cannot both be the default alias for standard tag %s and converter %s\n",
|
||||
fprintf(stderr, "%s:%d: error: Alias %s and %s cannot both be the default alias for standard tag %s and converter %s\n", path,
|
||||
lineNum,
|
||||
alias,
|
||||
GET_ALIAS_STR(aliasList->aliases[0]),
|
||||
|
@ -766,13 +771,13 @@ static uint16_t
|
|||
addConverter(const char *converter) {
|
||||
uint32_t idx;
|
||||
if(converterCount>=MAX_CONV_COUNT) {
|
||||
fprintf(stderr, "error(line %d): too many converters\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: too many converters\n", path, lineNum);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
||||
for (idx = 0; idx < converterCount; idx++) {
|
||||
if (ucnv_compareNames(converter, GET_ALIAS_STR(converters[idx].converter)) == 0) {
|
||||
fprintf(stderr, "error(line %d): duplicate converter %s found!\n", lineNum, converter);
|
||||
fprintf(stderr, "%s:%d: error: duplicate converter %s found!\n", path, lineNum, converter);
|
||||
exit(U_PARSE_ERROR);
|
||||
break;
|
||||
}
|
||||
|
@ -816,7 +821,8 @@ resolveAliasToConverter(uint16_t alias, uint16_t *tagNum, uint16_t *converterNum
|
|||
}
|
||||
*tagNum = UINT16_MAX;
|
||||
*converterNum = UINT16_MAX;
|
||||
fprintf(stderr, "warning: alias %s not found\n",
|
||||
fprintf(stderr, "%s: warning: alias %s not found\n",
|
||||
path,
|
||||
GET_ALIAS_STR(alias));
|
||||
return;
|
||||
}
|
||||
|
@ -916,14 +922,15 @@ createOneAliasList(uint16_t *aliasArrLists, uint32_t tag, uint32_t converter, ui
|
|||
} else {
|
||||
value = 0;
|
||||
if (tag != 0) { /* Only show the warning when it's not the leftover tag. */
|
||||
printf("warning: tag %s does not have a default alias for %s\n",
|
||||
fprintf(stderr, "%s: warning: tag %s does not have a default alias for %s\n",
|
||||
path,
|
||||
GET_TAG_STR(tags[tag].tag),
|
||||
GET_ALIAS_STR(converters[converter].converter));
|
||||
}
|
||||
}
|
||||
aliasLists[aliasListsSize++] = value;
|
||||
if (aliasListsSize >= MAX_LIST_SIZE) {
|
||||
fprintf(stderr, "error: Too many alias lists\n");
|
||||
fprintf(stderr, "%s: error: Too many alias lists\n", path);
|
||||
exit(U_BUFFER_OVERFLOW_ERROR);
|
||||
}
|
||||
|
||||
|
@ -1068,7 +1075,7 @@ allocString(StringBlock *block, const char *s, int32_t length) {
|
|||
top=block->top + (uint32_t)((length + 1 + 1) & ~1);
|
||||
|
||||
if(top >= block->max) {
|
||||
fprintf(stderr, "error(line %d): out of memory\n", lineNum);
|
||||
fprintf(stderr, "%s:%d: error: out of memory\n", path, lineNum);
|
||||
exit(U_MEMORY_ALLOCATION_ERROR);
|
||||
}
|
||||
|
||||
|
@ -1082,7 +1089,7 @@ allocString(StringBlock *block, const char *s, int32_t length) {
|
|||
|
||||
/* check for invariant characters now that we have a NUL-terminated string for easy output */
|
||||
if(!uprv_isInvariantString(p, length)) {
|
||||
fprintf(stderr, "error(line %d): the name %s contains not just invariant characters\n", lineNum, p);
|
||||
fprintf(stderr, "%s:%d: error: the name %s contains not just invariant characters\n", path, lineNum, p);
|
||||
exit(U_INVALID_TABLE_FORMAT);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2002-2008, International Business Machines
|
||||
* Copyright (C) 2002-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -700,7 +700,7 @@ numericLineFn(void *context,
|
|||
|
||||
U_CFUNC int32_t
|
||||
writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROPS_INDEX_COUNT]) {
|
||||
uint32_t *pvArray;
|
||||
const uint32_t *pvArray;
|
||||
int32_t pvRows, pvCount;
|
||||
int32_t length;
|
||||
UErrorCode errorCode;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1998-2008, International Business Machines
|
||||
* Copyright (C) 1998-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -351,13 +351,13 @@ static UChar32 getNextChar(UCHARBUF* buf,
|
|||
seekUntilNewline(buf, NULL, status);
|
||||
break;
|
||||
|
||||
case ASTERISK: /* "/*" */
|
||||
c2 = ucbuf_getc(buf, status); /* "/*c" */
|
||||
if(c2 == ASTERISK){ /* "/**" */
|
||||
case ASTERISK: /* " / * " */
|
||||
c2 = ucbuf_getc(buf, status); /* "/ * c" */
|
||||
if(c2 == ASTERISK){ /* "/ * *" */
|
||||
/* parse multi-line comment and store it in token*/
|
||||
seekUntilEndOfComment(buf, token, status);
|
||||
} else {
|
||||
ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/*". Include c2 back in buffer. */
|
||||
ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/ *". Include c2 back in buffer. */
|
||||
seekUntilEndOfComment(buf, NULL, status);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2000-2008, International Business Machines
|
||||
* Copyright (C) 2000-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -74,11 +74,11 @@ static const char* javaClass1= " extends ListResourceBundle {\n\n"
|
|||
" return contents;\n"
|
||||
" }\n\n"
|
||||
" private static Object[][] contents = {\n";
|
||||
static const char* javaClassICU= " extends ListResourceBundle {\n\n"
|
||||
/*static const char* javaClassICU= " extends ListResourceBundle {\n\n"
|
||||
" public %s () {\n"
|
||||
" super.contents = data;\n"
|
||||
" }\n"
|
||||
" static final Object[][] data = new Object[][] { \n";
|
||||
" static final Object[][] data = new Object[][] { \n";*/
|
||||
static int tabCount = 3;
|
||||
|
||||
static FileStream* out=NULL;
|
||||
|
@ -259,11 +259,11 @@ str_write_java( uint16_t* src, int32_t srcLen, UBool printEndLine, UErrorCode *s
|
|||
add = columnCount-(tabCount*4)-5/* for ", +\n */;
|
||||
current = buf +len;
|
||||
if (add < (bufLen-len)) {
|
||||
uint32_t index = strrch(current,add,'\\');
|
||||
if (index > add) {
|
||||
index = add;
|
||||
uint32_t idx = strrch(current,add,'\\');
|
||||
if (idx > add) {
|
||||
idx = add;
|
||||
} else {
|
||||
int32_t num =index-1;
|
||||
int32_t num =idx-1;
|
||||
uint32_t seqLen;
|
||||
while(num>0){
|
||||
if(current[num]=='\\'){
|
||||
|
@ -272,12 +272,12 @@ str_write_java( uint16_t* src, int32_t srcLen, UBool printEndLine, UErrorCode *s
|
|||
break;
|
||||
}
|
||||
}
|
||||
if ((index-num)%2==0) {
|
||||
index--;
|
||||
if ((idx-num)%2==0) {
|
||||
idx--;
|
||||
}
|
||||
seqLen = (current[index+1]=='u') ? 6 : 2;
|
||||
if ((add-index) < seqLen) {
|
||||
add = index + seqLen;
|
||||
seqLen = (current[idx+1]=='u') ? 6 : 2;
|
||||
if ((add-idx) < seqLen) {
|
||||
add = idx + seqLen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ res_write_java(struct SResource *res,UErrorCode *status) {
|
|||
string_write_java (res, status);
|
||||
return;
|
||||
case URES_ALIAS:
|
||||
printf("Encountered unsupported resource type of alias\n", res->fType);
|
||||
printf("Encountered unsupported resource type %d of alias\n", res->fType);
|
||||
*status = U_UNSUPPORTED_ERROR;
|
||||
return;
|
||||
case URES_INT_VECTOR:
|
||||
|
@ -621,8 +621,8 @@ bundle_write_java(struct SRBRoot *bundle, const char *outputDir,const char* outp
|
|||
|
||||
char fileName[256] = {'\0'};
|
||||
char className[256]={'\0'};
|
||||
char constructor[1000] = { 0 };
|
||||
UBool j1 =FALSE;
|
||||
/*char constructor[1000] = { 0 };*/
|
||||
/*UBool j1 =FALSE;*/
|
||||
outDir = outputDir;
|
||||
|
||||
start = TRUE; /* Reset the start indictor*/
|
||||
|
|
|
@ -171,7 +171,7 @@ static void strnrepchr(char* src, int32_t srcLen, char s, char r){
|
|||
* If it fails to get the language information from the filename,
|
||||
* use "en" as the default value for language
|
||||
*/
|
||||
static char* parseFilename(const char* id, char* lang) {
|
||||
static char* parseFilename(const char* id, char* /*lang*/) {
|
||||
int idLen = (int) uprv_strlen(id);
|
||||
char* localeID = (char*) uprv_malloc(idLen);
|
||||
int pos = 0;
|
||||
|
@ -448,7 +448,7 @@ printNoteElements(struct UString *src, UErrorCode *status){
|
|||
|
||||
}
|
||||
|
||||
static void printAttribute(const char *name, const char *value, int32_t len)
|
||||
static void printAttribute(const char *name, const char *value, int32_t /*len*/)
|
||||
{
|
||||
write_utf8_file(out, UnicodeString(" "));
|
||||
write_utf8_file(out, UnicodeString(name));
|
||||
|
@ -457,7 +457,7 @@ static void printAttribute(const char *name, const char *value, int32_t len)
|
|||
write_utf8_file(out, UnicodeString("\""));
|
||||
}
|
||||
|
||||
static void printAttribute(const char *name, const UnicodeString value, int32_t len)
|
||||
static void printAttribute(const char *name, const UnicodeString value, int32_t /*len*/)
|
||||
{
|
||||
write_utf8_file(out, UnicodeString(" "));
|
||||
write_utf8_file(out, UnicodeString(name));
|
||||
|
@ -600,7 +600,7 @@ static const char *intvector_restype = "x-icu-intvector";
|
|||
static const char *table_restype = "x-icu-table";
|
||||
|
||||
static void
|
||||
string_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
|
||||
string_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
|
||||
|
||||
char *sid = NULL;
|
||||
char* buf = NULL;
|
||||
|
@ -637,7 +637,7 @@ string_write_xml(struct SResource *res, const char* id, const char* language, UE
|
|||
}
|
||||
|
||||
static void
|
||||
alias_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
|
||||
alias_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
|
||||
char *sid = NULL;
|
||||
char* buf = NULL;
|
||||
int32_t bufLen=0;
|
||||
|
@ -707,7 +707,7 @@ array_write_xml(struct SResource *res, const char* id, const char* language, UEr
|
|||
}
|
||||
|
||||
static void
|
||||
intvector_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
|
||||
intvector_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
|
||||
char* sid = NULL;
|
||||
char* ivd = NULL;
|
||||
uint32_t i=0;
|
||||
|
@ -756,7 +756,7 @@ intvector_write_xml(struct SResource *res, const char* id, const char* language,
|
|||
}
|
||||
|
||||
static void
|
||||
int_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
|
||||
int_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
|
||||
char* sid = NULL;
|
||||
char buf[256] = {0};
|
||||
uint32_t len = 0;
|
||||
|
@ -784,7 +784,7 @@ int_write_xml(struct SResource *res, const char* id, const char* language, UErro
|
|||
}
|
||||
|
||||
static void
|
||||
bin_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
|
||||
bin_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
|
||||
const char* m_type = application_mimetype;
|
||||
char* sid = NULL;
|
||||
uint32_t crc = 0xFFFFFFFF;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2005-2008, International Business Machines
|
||||
* Copyright (C) 2005-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -129,7 +129,7 @@ printUsage(const char *pname, UBool isHelp) {
|
|||
"\tComments begin with # and are ignored. Empty lines are ignored.\n"
|
||||
"\tLines where the first non-whitespace character is one of %s\n"
|
||||
"\tare also ignored, to reserve for future syntax.\n",
|
||||
reservedChars);
|
||||
U_PKG_RESERVED_CHARS);
|
||||
fprintf(where,
|
||||
"\tItems for removal or extraction may contain a single '*' wildcard\n"
|
||||
"\tcharacter. The '*' matches zero or more characters.\n"
|
||||
|
|
|
@ -462,7 +462,7 @@ main(int argc, char* argv[]) {
|
|||
static int32_t pkg_executeOptions(UPKGOptions *o) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t result = 0;
|
||||
char cmd[SMALL_BUFFER_MAX_SIZE] = "";
|
||||
// char cmd[SMALL_BUFFER_MAX_SIZE] = "";
|
||||
const char mode = o->mode[0];
|
||||
char targetDir[SMALL_BUFFER_MAX_SIZE] = "";
|
||||
char tmpDir[SMALL_BUFFER_MAX_SIZE] = "";
|
||||
|
@ -1138,7 +1138,7 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U
|
|||
}
|
||||
#endif
|
||||
|
||||
static void pkg_checkFlag(UPKGOptions *o) {
|
||||
static void pkg_checkFlag(UPKGOptions */*o*/) {
|
||||
#ifdef U_AIX
|
||||
/* AIX needs a map file. */
|
||||
char *flag = NULL;
|
||||
|
|
|
@ -207,17 +207,6 @@ static const struct AssemblyType {
|
|||
static int32_t assemblyHeaderIndex = -1;
|
||||
static int32_t hexType = HEX_0X;
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
printAssemblyHeadersToStdErr() {
|
||||
int32_t idx;
|
||||
fprintf(stderr, "%s", assemblyHeader[0].name);
|
||||
for (idx = 1; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
|
||||
fprintf(stderr, ", %s", assemblyHeader[idx].name);
|
||||
}
|
||||
fprintf(stderr,
|
||||
")\n");
|
||||
}
|
||||
|
||||
U_CAPI UBool U_EXPORT2
|
||||
checkAssemblyHeaderName(const char* optAssembly) {
|
||||
int32_t idx;
|
||||
|
@ -233,6 +222,18 @@ checkAssemblyHeaderName(const char* optAssembly) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
printAssemblyHeadersToStdErr(void) {
|
||||
int32_t idx;
|
||||
fprintf(stderr, "%s", assemblyHeader[0].name);
|
||||
for (idx = 1; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
|
||||
fprintf(stderr, ", %s", assemblyHeader[idx].name);
|
||||
}
|
||||
fprintf(stderr,
|
||||
")\n");
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath) {
|
||||
uint32_t column = MAX_COLUMN;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2008, International Business Machines
|
||||
* Copyright (C) 2008-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -9,19 +9,19 @@
|
|||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
U_INTERNAL void U_EXPORT2
|
||||
printAssemblyHeadersToStdErr();
|
||||
|
||||
U_CAPI UBool U_EXPORT2
|
||||
U_INTERNAL UBool U_EXPORT2
|
||||
checkAssemblyHeaderName(const char* optAssembly);
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
U_INTERNAL void U_EXPORT2
|
||||
writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath);
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
U_INTERNAL void U_EXPORT2
|
||||
writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath);
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
U_INTERNAL void U_EXPORT2
|
||||
writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2008, International Business Machines
|
||||
* Copyright (C) 2008-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -101,7 +101,7 @@ readList(const char *filesPath, const char *listname, UBool readContents) {
|
|||
// skip empty lines and
|
||||
// skip lines starting with reserved characters
|
||||
start=u_skipWhitespace(line);
|
||||
if(*start==0 || NULL!=strchr(reservedChars, *start)) {
|
||||
if(*start==0 || NULL!=strchr(U_PKG_RESERVED_CHARS, *start)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2008, International Business Machines
|
||||
* Copyright (C) 2008-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
static const char *reservedChars="\"%&'()*+,-./:;<=>?_";
|
||||
#define U_PKG_RESERVED_CHARS "\"%&'()*+,-./:;<=>?_"
|
||||
|
||||
U_CAPI int U_EXPORT2
|
||||
writePackageDatFile(const char *outFilename, const char *outComment,
|
||||
|
|
Loading…
Add table
Reference in a new issue