mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-535 fixed some compiler warnings
X-SVN-Rev: 2164
This commit is contained in:
parent
b05b16141b
commit
a34fe9a10a
15 changed files with 80 additions and 80 deletions
|
@ -369,7 +369,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, UTextOffset length,
|
|||
switch(direction) {
|
||||
case UBIDI_LTR:
|
||||
/* make sure paraLevel is even */
|
||||
pBiDi->paraLevel=(pBiDi->paraLevel+1)&~1;
|
||||
pBiDi->paraLevel=(UBiDiLevel)((pBiDi->paraLevel+1)&~1);
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for ubidi_getLevels()) */
|
||||
pBiDi->trailingWSStart=0;
|
||||
|
@ -633,7 +633,7 @@ resolveExplicitLevels(UBiDi *pBiDi) {
|
|||
case LRE:
|
||||
case LRO:
|
||||
/* (X3, X5) */
|
||||
newLevel=(embeddingLevel+2)&~(UBIDI_LEVEL_OVERRIDE|1); /* least greater even level */
|
||||
newLevel=(UBiDiLevel)((embeddingLevel+2)&~(UBIDI_LEVEL_OVERRIDE|1)); /* least greater even level */
|
||||
if(newLevel<=UBIDI_MAX_EXPLICIT_LEVEL) {
|
||||
stack[stackTop]=embeddingLevel;
|
||||
++stackTop;
|
||||
|
@ -653,7 +653,7 @@ resolveExplicitLevels(UBiDi *pBiDi) {
|
|||
case RLE:
|
||||
case RLO:
|
||||
/* (X2, X4) */
|
||||
newLevel=((embeddingLevel&~UBIDI_LEVEL_OVERRIDE)+1)|1; /* least greater odd level */
|
||||
newLevel=(UBiDiLevel)(((embeddingLevel&~UBIDI_LEVEL_OVERRIDE)+1)|1); /* least greater odd level */
|
||||
if(newLevel<=UBIDI_MAX_EXPLICIT_LEVEL) {
|
||||
stack[stackTop]=embeddingLevel;
|
||||
++stackTop;
|
||||
|
@ -854,7 +854,7 @@ resolveImplicitLevels(UBiDi *pBiDi,
|
|||
}
|
||||
} else {
|
||||
/* normal BiDi: least greater even level */
|
||||
numberLevel=(levels[start]+2)&~1;
|
||||
numberLevel=(UBiDiLevel)((levels[start]+2)&~1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -155,7 +155,7 @@ ubidi_setLine(const UBiDi *pParaBiDi,
|
|||
pLineBiDi->direction=(UBiDiDirection)(pLineBiDi->paraLevel&1);
|
||||
} else {
|
||||
/* get the level of the first character */
|
||||
level=levels[0]&1;
|
||||
level=(UBiDiLevel)(levels[0]&1);
|
||||
|
||||
/* if there is anything of a different level, then the line is mixed */
|
||||
if(trailingWSStart<length && (pLineBiDi->paraLevel&1)!=level) {
|
||||
|
@ -181,7 +181,7 @@ ubidi_setLine(const UBiDi *pParaBiDi,
|
|||
switch(pLineBiDi->direction) {
|
||||
case UBIDI_LTR:
|
||||
/* make sure paraLevel is even */
|
||||
pLineBiDi->paraLevel=(pLineBiDi->paraLevel+1)&~1;
|
||||
pLineBiDi->paraLevel=(UBiDiLevel)((pLineBiDi->paraLevel+1)&~1);
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for ubidi_getLevels()) */
|
||||
pLineBiDi->trailingWSStart=0;
|
||||
|
|
|
@ -274,9 +274,9 @@ loadPropsData() {
|
|||
|
||||
/* initialize some variables */
|
||||
uprv_memcpy(indexes, propsTable, 16);
|
||||
stage23Bits=indexes[INDEX_STAGE_2_BITS]+indexes[INDEX_STAGE_3_BITS];
|
||||
stage2Mask=(1<<indexes[INDEX_STAGE_2_BITS])-1;
|
||||
stage3Mask=(1<<indexes[INDEX_STAGE_3_BITS])-1;
|
||||
stage23Bits=(uint16_t)(indexes[INDEX_STAGE_2_BITS]+indexes[INDEX_STAGE_3_BITS]);
|
||||
stage2Mask=(uint16_t)((1<<indexes[INDEX_STAGE_2_BITS])-1);
|
||||
stage3Mask=(uint16_t)((1<<indexes[INDEX_STAGE_3_BITS])-1);
|
||||
havePropsData=1;
|
||||
|
||||
/* if a different thread set it first, then close the extra data */
|
||||
|
|
|
@ -161,7 +161,7 @@ UCharCharacterIterator::nextPostInc() {
|
|||
|
||||
UBool
|
||||
UCharCharacterIterator::hasNext() {
|
||||
return pos < end ? TRUE : FALSE;
|
||||
return (UBool)(pos < end ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
UChar
|
||||
|
@ -175,7 +175,7 @@ UCharCharacterIterator::previous() {
|
|||
|
||||
UBool
|
||||
UCharCharacterIterator::hasPrevious() {
|
||||
return pos > begin ? TRUE : FALSE;
|
||||
return (UBool)(pos > begin ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
UChar32
|
||||
|
|
|
@ -97,7 +97,7 @@ static UBool
|
|||
isCnvAcceptable(void *context,
|
||||
const char *type, const char *name,
|
||||
const UDataInfo *pInfo) {
|
||||
return
|
||||
return (UBool)(
|
||||
pInfo->size>=20 &&
|
||||
pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
|
||||
pInfo->charsetFamily==U_CHARSET_FAMILY &&
|
||||
|
@ -106,7 +106,7 @@ isCnvAcceptable(void *context,
|
|||
pInfo->dataFormat[1]==0x6e &&
|
||||
pInfo->dataFormat[2]==0x76 &&
|
||||
pInfo->dataFormat[3]==0x74 &&
|
||||
pInfo->formatVersion[0]==5;
|
||||
pInfo->formatVersion[0]==5);
|
||||
}
|
||||
|
||||
#define DATA_TYPE "cnv"
|
||||
|
|
|
@ -820,7 +820,7 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs* args,
|
|||
if (uniChar <= ULMBCS_C0END)
|
||||
{
|
||||
*pLMBCS++ = ULMBCS_GRP_CTRL;
|
||||
*pLMBCS++ = ULMBCS_CTRLOFFSET + (ulmbcs_byte_t ) uniChar;
|
||||
*pLMBCS++ = (ulmbcs_byte_t)(ULMBCS_CTRLOFFSET + uniChar);
|
||||
}
|
||||
else if (uniChar >= ULMBCS_C1START && uniChar <= ULMBCS_C1START + ULMBCS_CTRLOFFSET)
|
||||
{
|
||||
|
@ -873,12 +873,12 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs* args,
|
|||
ulmbcs_byte_t grp_start;
|
||||
ulmbcs_byte_t grp_end;
|
||||
ulmbcs_byte_t grp_ix;
|
||||
grp_start = (group == ULMBCS_AMBIGUOUS_MBCS)
|
||||
grp_start = (ulmbcs_byte_t)((group == ULMBCS_AMBIGUOUS_MBCS)
|
||||
? ULMBCS_DOUBLEOPTGROUP_START
|
||||
: ULMBCS_GRP_L1;
|
||||
grp_end = (group == ULMBCS_AMBIGUOUS_MBCS)
|
||||
: ULMBCS_GRP_L1);
|
||||
grp_end = (ulmbcs_byte_t)((group == ULMBCS_AMBIGUOUS_MBCS)
|
||||
? ULMBCS_GRP_LAST
|
||||
: ULMBCS_GRP_TH;
|
||||
: ULMBCS_GRP_TH);
|
||||
for (grp_ix = grp_start;
|
||||
grp_ix <= grp_end && !bytes_written;
|
||||
grp_ix++)
|
||||
|
@ -929,7 +929,7 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs* args,
|
|||
*/
|
||||
uint8_t * pErrorBuffer = args->converter->charErrorBuffer;
|
||||
*err = U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
args->converter->charErrorBufferLength = bytes_written;
|
||||
args->converter->charErrorBufferLength = (int8_t)bytes_written;
|
||||
while (bytes_written--)
|
||||
{
|
||||
*pErrorBuffer++ = *pLMBCS++;
|
||||
|
@ -954,7 +954,7 @@ GetUniFromLMBCSUni(char const ** ppLMBCSin) /* Called with LMBCS-style Unicode
|
|||
HighCh = LowCh;
|
||||
LowCh = 0; /* zero-byte in LSB special character */
|
||||
}
|
||||
return (HighCh << 8) | LowCh;
|
||||
return (UChar)((HighCh << 8) | LowCh);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs* args,
|
|||
if (*err == U_TRUNCATED_CHAR_FOUND && !args->flush)
|
||||
{
|
||||
/* evil special case: source buffers so small a char spans more than 2 buffers */
|
||||
size_t savebytes = size_old+size_new;
|
||||
int8_t savebytes = (int8_t)(size_old+size_new);
|
||||
args->converter->invalidCharLength = savebytes;
|
||||
uprv_memcpy(args->converter->invalidCharBuffer, LMBCS, savebytes);
|
||||
args->source = args->sourceLimit;
|
||||
|
@ -1271,8 +1271,8 @@ _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs* args,
|
|||
/* If character incomplete, store away partial char if more to come */
|
||||
if ((*err == U_TRUNCATED_CHAR_FOUND) && !args->flush )
|
||||
{
|
||||
size_t savebytes = args->sourceLimit - saveSource;
|
||||
args->converter->invalidCharLength = savebytes;
|
||||
int8_t savebytes = (int8_t)(args->sourceLimit - saveSource);
|
||||
args->converter->invalidCharLength = (int8_t)savebytes;
|
||||
uprv_memcpy(args->converter->invalidCharBuffer, saveSource, savebytes);
|
||||
args->source = args->sourceLimit;
|
||||
*err = U_ZERO_ERROR;
|
||||
|
|
|
@ -288,7 +288,7 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
|||
* 30..7 offset delta
|
||||
* 6..0 next state
|
||||
*/
|
||||
state=(uint8_t)entry&0x7f;
|
||||
state=(uint8_t)(entry&0x7f);
|
||||
offset+=entry>>7;
|
||||
} else {
|
||||
/*
|
||||
|
@ -300,7 +300,7 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
|||
*/
|
||||
|
||||
/* set the next state early so that we can reuse the entry variable */
|
||||
state=(uint8_t)entry&0x7f; /* typically 0 */
|
||||
state=(uint8_t)(entry&0x7f); /* typically 0 */
|
||||
|
||||
/* switch per action code */
|
||||
switch((uint32_t)entry>>27U) {
|
||||
|
@ -358,11 +358,11 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
|||
/* bits 26..7 contain the Unicode surrogate code point minus 0x10000 */
|
||||
entry=(entry>>7)&0xfffff;
|
||||
/* output surrogate pair */
|
||||
*target++=0xd800|(UChar)(entry>>10);
|
||||
*target++=(UChar)(0xd800|(UChar)(entry>>10));
|
||||
if(offsets!=NULL) {
|
||||
*offsets++=sourceIndex;
|
||||
}
|
||||
c=0xdc00|(UChar)(entry&0x3ff);
|
||||
c=(UChar)(0xdc00|(UChar)(entry&0x3ff));
|
||||
if(target<targetLimit) {
|
||||
*target++=c;
|
||||
if(offsets!=NULL) {
|
||||
|
@ -507,7 +507,7 @@ output32:
|
|||
if(offsets!=NULL) {
|
||||
*offsets++=sourceIndex;
|
||||
}
|
||||
c=0xdc00|(UChar)(entry&0x3ff);
|
||||
c=(UChar)(0xdc00|(UChar)(entry&0x3ff));
|
||||
if(target<targetLimit) {
|
||||
*target++=c;
|
||||
if(offsets!=NULL) {
|
||||
|
@ -661,7 +661,7 @@ _MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
|||
while(pArgs->source<realLimit) {
|
||||
/* feed in one byte at a time to make sure to get only one character out */
|
||||
pArgs->sourceLimit=pArgs->source+1;
|
||||
pArgs->flush= pArgs->sourceLimit==realLimit;
|
||||
pArgs->flush= (UBool)(pArgs->sourceLimit==realLimit);
|
||||
_MBCSToUnicode(pArgs, pErrorCode);
|
||||
if(U_FAILURE(*pErrorCode) && *pErrorCode!=U_INDEX_OUTOFBOUNDS_ERROR) {
|
||||
return 0xffff;
|
||||
|
@ -718,7 +718,7 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
|||
* 30..7 offset delta
|
||||
* 6..0 next state
|
||||
*/
|
||||
state=(uint8_t)entry&0x7f;
|
||||
state=(uint8_t)(entry&0x7f);
|
||||
offset+=entry>>7;
|
||||
} else {
|
||||
/*
|
||||
|
@ -790,7 +790,7 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
|||
}
|
||||
|
||||
/* state change only - prepare for a new character */
|
||||
state=(uint8_t)entry&0x7f; /* typically 0 */
|
||||
state=(uint8_t)(entry&0x7f); /* typically 0 */
|
||||
offset=0;
|
||||
}
|
||||
} while(source<(const uint8_t *)sourceLimit);
|
||||
|
@ -1266,7 +1266,7 @@ _MBCSGetStarters(const UConverter* cnv,
|
|||
|
||||
for(i=0; i<256; ++i) {
|
||||
/* all bytes that cause a state transition from state 0 are lead bytes */
|
||||
starters[i]= state0[i]>=0;
|
||||
starters[i]= (UBool)(state0[i]>=0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1276,7 +1276,7 @@ _MBCSGetStarters(const UConverter* cnv,
|
|||
*/
|
||||
U_CFUNC UBool
|
||||
_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte) {
|
||||
return sharedData->table->mbcs.stateTable[0][(uint8_t)byte]>=0;
|
||||
return (UBool)(sharedData->table->mbcs.stateTable[0][(uint8_t)byte]>=0);
|
||||
}
|
||||
|
||||
static const UConverterImpl _MBCSImpl={
|
||||
|
|
|
@ -912,7 +912,7 @@ doOpenChoice(const char *path, const char *type, const char *name,
|
|||
const char *inBasename;
|
||||
char *basename, *suffix;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
UBool isICUData= path==NULL;
|
||||
UBool isICUData= (UBool)(path==NULL);
|
||||
|
||||
/* set up the ToC names for DLL and offset-ToC lookups */
|
||||
setEntryNames(type, name, tocEntryName, dllEntryName);
|
||||
|
|
|
@ -443,7 +443,7 @@ uhash_compareUChars(const void *key1, const void *key2) {
|
|||
++p1;
|
||||
++p2;
|
||||
}
|
||||
return (*p1 == *p2);
|
||||
return (UBool)(*p1 == *p2);
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
|
@ -460,7 +460,7 @@ uhash_compareChars(const void *key1, const void *key2) {
|
|||
++p1;
|
||||
++p2;
|
||||
}
|
||||
return (*p1 == *p2);
|
||||
return (UBool)(*p1 == *p2);
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
|
@ -477,7 +477,7 @@ uhash_compareIChars(const void *key1, const void *key2) {
|
|||
++p1;
|
||||
++p2;
|
||||
}
|
||||
return (*p1 == *p2);
|
||||
return (UBool)(*p1 == *p2);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
|
@ -491,7 +491,7 @@ uhash_hashLong(const void *key) {
|
|||
|
||||
U_CAPI UBool
|
||||
uhash_compareLong(const void *key1, const void *key2) {
|
||||
return key1 == key2;
|
||||
return (UBool)(key1 == key2);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
|
|
|
@ -198,7 +198,7 @@ int16_t _findIndex(const char* list, int32_t listLength, const char* key)
|
|||
}
|
||||
list += tokenSize;
|
||||
}
|
||||
if (found == TRUE) return ((list - anchor)/tokenSize);
|
||||
if (found == TRUE) return (int16_t)((list - anchor)/tokenSize);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ uloc_getLanguage(const char* localeID,
|
|||
but only copies into the buffer as much as the buffer can bare*/
|
||||
while ((*localeID != '\0') && !_isIDSeparator(*localeID))
|
||||
{
|
||||
if (languageCapacity > i) language[i] = tolower(*localeID);
|
||||
if (languageCapacity > i) language[i] = (char)tolower(*localeID);
|
||||
i++;
|
||||
localeID++;
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ int32_t uloc_getCountry(const char* localeID,
|
|||
++localeID;
|
||||
while ((*localeID != '\0') && !_isIDSeparator(*localeID))
|
||||
{
|
||||
if (countryCapacity > i) country[i] = toupper(*localeID);
|
||||
if (countryCapacity > i) country[i] = (char)toupper(*localeID);
|
||||
i++;
|
||||
localeID++;
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ int32_t uloc_getVariant(const char* localeID,
|
|||
but only copies into the buffer as much as the buffer can bare*/
|
||||
while (*localeID != '\0')
|
||||
{
|
||||
if (variantCapacity > i) variant[i] = toupper(*localeID);
|
||||
if (variantCapacity > i) variant[i] = (char)toupper(*localeID);
|
||||
i++;
|
||||
localeID++;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ static UBool
|
|||
isAcceptable(void *context,
|
||||
const char *type, const char *name,
|
||||
const UDataInfo *pInfo) {
|
||||
return
|
||||
return (UBool)(
|
||||
pInfo->size>=20 &&
|
||||
pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
|
||||
pInfo->charsetFamily==U_CHARSET_FAMILY &&
|
||||
|
@ -182,7 +182,7 @@ isAcceptable(void *context,
|
|||
pInfo->dataFormat[1]==0x6e &&
|
||||
pInfo->dataFormat[2]==0x61 &&
|
||||
pInfo->dataFormat[3]==0x6d &&
|
||||
pInfo->formatVersion[0]==1;
|
||||
pInfo->formatVersion[0]==1);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
|
@ -196,7 +196,7 @@ getName(UCharNames *names, uint32_t code, UCharNameChoice nameChoice,
|
|||
|
||||
/* binary search for the group of names that contains the one for code */
|
||||
while(start<limit-1) {
|
||||
number=(start+limit)/2;
|
||||
number=(uint16_t)((start+limit)/2);
|
||||
if(groupMSB<groups[number].groupMSB) {
|
||||
limit=number;
|
||||
} else {
|
||||
|
@ -235,14 +235,14 @@ expandGroupName(UCharNames *names, Group *group,
|
|||
/* read even nibble - MSBs of lengthByte */
|
||||
if(length>=12) {
|
||||
/* double-nibble length spread across two bytes */
|
||||
length=((length&0x3)<<4|lengthByte>>4)+12;
|
||||
length=(uint16_t)(((length&0x3)<<4|lengthByte>>4)+12);
|
||||
lengthByte&=0xf;
|
||||
} else if((lengthByte&0xf0)>=0xc0) {
|
||||
/* double-nibble length spread across this one byte */
|
||||
length=(lengthByte&0x3f)+12;
|
||||
length=(uint16_t)((lengthByte&0x3f)+12);
|
||||
} else {
|
||||
/* single-nibble length in MSBs */
|
||||
length=lengthByte>>4;
|
||||
length=(uint16_t)(lengthByte>>4);
|
||||
lengthByte&=0xf;
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ getAlgName(AlgorithmicRange *range, uint32_t code, UCharNameChoice nameChoice,
|
|||
|
||||
for(i=count; i>0;) {
|
||||
if(--i<bufferLength) {
|
||||
c=(char)code&0xf;
|
||||
c=(char)(code&0xf);
|
||||
if(c<10) {
|
||||
c+='0';
|
||||
} else {
|
||||
|
@ -410,7 +410,7 @@ getAlgName(AlgorithmicRange *range, uint32_t code, UCharNameChoice nameChoice,
|
|||
*
|
||||
* note that for fewer operations, count is decremented here
|
||||
*/
|
||||
count=range->variant-1;
|
||||
count=(uint16_t)(range->variant-1);
|
||||
for(i=count; i>0; --i) {
|
||||
factor=factors[i];
|
||||
indeces[i]=(uint16_t)(code%factor);
|
||||
|
@ -442,7 +442,7 @@ getAlgName(AlgorithmicRange *range, uint32_t code, UCharNameChoice nameChoice,
|
|||
}
|
||||
|
||||
/* skip the rest of the strings for this factors[i] */
|
||||
factor=factors[i]-indeces[i]-1;
|
||||
factor=(uint16_t)(factors[i]-indeces[i]-1);
|
||||
while(factor>0) {
|
||||
while(*s++!=0) {}
|
||||
--factor;
|
||||
|
|
|
@ -42,7 +42,7 @@ UBool compareEntries(const void *p1, const void *p2) {
|
|||
UResourceDataEntry *b1 = (UResourceDataEntry *)p1;
|
||||
UResourceDataEntry *b2 = (UResourceDataEntry *)p2;
|
||||
|
||||
return(uhash_compareChars(b1->fName, b2->fName) &
|
||||
return (UBool)(uhash_compareChars(b1->fName, b2->fName) &
|
||||
uhash_compareChars(b1->fPath, b2->fPath));
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
UResourceDataEntry *t1 = NULL;
|
||||
UResourceDataEntry *t2 = NULL;
|
||||
UBool isDefault = FALSE;
|
||||
UBool isRoot = FALSE;
|
||||
UBool isRoot = FALSE;
|
||||
UBool hasRealData = FALSE;
|
||||
UBool hasChopped = FALSE;
|
||||
char name[96];
|
||||
|
@ -291,10 +291,10 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
umtx_lock(&resbMutex);
|
||||
r = init_entry(localeID, path, &initstatus);
|
||||
uprv_strcpy(name, r->fName);
|
||||
isDefault = (uprv_strncmp(name, uloc_getDefault(), uprv_strlen(name)) == 0);
|
||||
hasRealData = (r->fBogus == U_ZERO_ERROR);
|
||||
isDefault = (UBool)(uprv_strncmp(name, uloc_getDefault(), uprv_strlen(name)) == 0);
|
||||
hasRealData = (UBool)(r->fBogus == U_ZERO_ERROR);
|
||||
|
||||
isRoot = (uprv_strcmp(name, kRootLocaleName) == 0);
|
||||
isRoot = (UBool)(uprv_strcmp(name, kRootLocaleName) == 0);
|
||||
|
||||
/*Fallback data stuff*/
|
||||
hasChopped = chopLocale(name);
|
||||
|
@ -303,7 +303,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
while (hasChopped && !isRoot && t1->fParent == NULL) {
|
||||
/* insert regular parents */
|
||||
t2 = init_entry(name, r->fPath, status);
|
||||
hasRealData = (t2->fBogus == U_ZERO_ERROR) | hasRealData;
|
||||
hasRealData = (UBool)((t2->fBogus == U_ZERO_ERROR) | hasRealData);
|
||||
t1->fParent = t2;
|
||||
t1 = t2;
|
||||
hasChopped = chopLocale(name);
|
||||
|
@ -313,7 +313,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
/* insert default locale */
|
||||
uprv_strcpy(name, uloc_getDefault());
|
||||
t2 = init_entry(name, r->fPath, status);
|
||||
hasRealData = (t2->fBogus == U_ZERO_ERROR) | hasRealData;
|
||||
hasRealData = (UBool)((t2->fBogus == U_ZERO_ERROR) | hasRealData);
|
||||
r->fBogus = U_USING_DEFAULT_ERROR;
|
||||
isDefault = TRUE;
|
||||
t1->fParent = t2;
|
||||
|
@ -322,7 +322,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
while (hasChopped && t1->fParent == NULL) {
|
||||
/* insert chopped defaults */
|
||||
t2 = init_entry(name, r->fPath, status);
|
||||
hasRealData = (t2->fBogus == U_ZERO_ERROR) | hasRealData;
|
||||
hasRealData = (UBool)((t2->fBogus == U_ZERO_ERROR) | hasRealData);
|
||||
t1->fParent = t2;
|
||||
t1 = t2;
|
||||
hasChopped = chopLocale(name);
|
||||
|
@ -335,7 +335,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
if(!hasRealData) {
|
||||
r->fBogus = U_USING_DEFAULT_ERROR;
|
||||
}
|
||||
hasRealData = (t2->fBogus == U_ZERO_ERROR) | hasRealData;
|
||||
hasRealData = (UBool)((t2->fBogus == U_ZERO_ERROR) | hasRealData);
|
||||
t1->fParent = t2;
|
||||
t1 = t2;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
|
|||
while(!isRoot && t1->fParent != NULL) {
|
||||
t1->fParent->fCountExisting++;
|
||||
t1 = t1->fParent;
|
||||
hasRealData = (t1->fBogus == U_ZERO_ERROR) | hasRealData;
|
||||
hasRealData = (UBool)((t1->fBogus == U_ZERO_ERROR) | hasRealData);
|
||||
}
|
||||
|
||||
if(!hasRealData) {
|
||||
|
@ -568,7 +568,7 @@ U_CAPI UBool U_EXPORT2 ures_hasNext(UResourceBundle *resB) {
|
|||
if(resB == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
return(resB->fIndex < resB->fSize-1);
|
||||
return (UBool)(resB->fIndex < resB->fSize-1);
|
||||
}
|
||||
|
||||
U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resB, int32_t* len, const char ** key, UErrorCode *status) {
|
||||
|
|
|
@ -124,7 +124,7 @@ _res_findTableItem(const Resource *pRoot, const Resource res, const char *key) {
|
|||
/* do a binary search for the key */
|
||||
start=0;
|
||||
while(start<limit-1) {
|
||||
i=(start+limit)/2;
|
||||
i=(uint16_t)((start+limit)/2);
|
||||
if(uprv_strcmp(key, RES_GET_KEY(pRoot, p[i]))<0) {
|
||||
limit=i;
|
||||
} else {
|
||||
|
@ -151,7 +151,7 @@ _res_findTableIndex(const Resource *pRoot, const Resource res, const char *key)
|
|||
/* do a binary search for the key */
|
||||
start=0;
|
||||
while(start<limit-1) {
|
||||
i=(start+limit)/2;
|
||||
i=(uint16_t)((start+limit)/2);
|
||||
if(uprv_strcmp(key, RES_GET_KEY(pRoot, p[i]))<0) {
|
||||
limit=i;
|
||||
} else {
|
||||
|
@ -174,7 +174,7 @@ static UBool
|
|||
isAcceptable(void *context,
|
||||
const char *type, const char *name,
|
||||
const UDataInfo *pInfo) {
|
||||
return
|
||||
return (UBool)(
|
||||
pInfo->size>=20 &&
|
||||
pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
|
||||
pInfo->charsetFamily==U_CHARSET_FAMILY &&
|
||||
|
@ -183,7 +183,7 @@ isAcceptable(void *context,
|
|||
pInfo->dataFormat[1]==0x65 &&
|
||||
pInfo->dataFormat[2]==0x73 &&
|
||||
pInfo->dataFormat[3]==0x42 &&
|
||||
pInfo->formatVersion[0]==1;
|
||||
pInfo->formatVersion[0]==1);
|
||||
}
|
||||
|
||||
/* semi-public functions ---------------------------------------------------- */
|
||||
|
|
|
@ -384,7 +384,7 @@ enum { UNESCAPE_MAP_LENGTH = sizeof(UNESCAPE_MAP) / sizeof(UNESCAPE_MAP[0]) };
|
|||
/* Convert one octal digit to a numeric value 0..7, or -1 on failure */
|
||||
static int8_t _digit8(UChar c) {
|
||||
if (c >= 0x0030 && c <= 0x0037) {
|
||||
return c - 0x0030;
|
||||
return (int8_t)(c - 0x0030);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -392,13 +392,13 @@ static int8_t _digit8(UChar c) {
|
|||
/* Convert one hex digit to a numeric value 0..F, or -1 on failure */
|
||||
static int8_t _digit16(UChar c) {
|
||||
if (c >= 0x0030 && c <= 0x0039) {
|
||||
return c - 0x0030;
|
||||
return (int8_t)(c - 0x0030);
|
||||
}
|
||||
if (c >= 0x0041 && c <= 0x0046) {
|
||||
return c - (0x0041 - 10);
|
||||
return (int8_t)(c - (0x0041 - 10));
|
||||
}
|
||||
if (c >= 0x0061 && c <= 0x0066) {
|
||||
return c - (0x0061 - 10);
|
||||
return (int8_t)(c - (0x0061 - 10));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ u_unescapeAt(UNESCAPE_CHAR_AT charAt,
|
|||
if (minDig != 0) {
|
||||
while (*offset < length && n < maxDig) {
|
||||
c = charAt(*offset, context);
|
||||
dig = (bitsPerDigit == 3) ? _digit8(c) : _digit16(c);
|
||||
dig = (int8_t)((bitsPerDigit == 3) ? _digit8(c) : _digit16(c));
|
||||
if (dig < 0) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -164,23 +164,23 @@ U_CAPI UTextOffset U_EXPORT2
|
|||
utf8_appendCharSafeBody(uint8_t *s, UTextOffset i, UTextOffset length, UChar32 c) {
|
||||
if((c)<=0x7ff) {
|
||||
if((i)+1<(length)) {
|
||||
(s)[(i)++]=(uint8_t)((c)>>6)|0xc0;
|
||||
(s)[(i)++]=(uint8_t)(c)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)(((c)>>6)|0xc0);
|
||||
(s)[(i)++]=(uint8_t)((c)&0x3f|0x80);
|
||||
return i;
|
||||
}
|
||||
} else if((uint32_t)(c)<=0xffff) {
|
||||
if((i)+2<(length)) {
|
||||
(s)[(i)++]=(uint8_t)((c)>>12)|0xe0;
|
||||
(s)[(i)++]=(uint8_t)((c)>>6)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)(c)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)(((c)>>12)|0xe0);
|
||||
(s)[(i)++]=(uint8_t)(((c)>>6)&0x3f|0x80);
|
||||
(s)[(i)++]=(uint8_t)((c)&0x3f|0x80);
|
||||
return i;
|
||||
}
|
||||
} else if((uint32_t)(c)<=0x10ffff) {
|
||||
if((i)+3<(length)) {
|
||||
(s)[(i)++]=(uint8_t)((c)>>18)|0xf0;
|
||||
(s)[(i)++]=(uint8_t)((c)>>12)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)((c)>>6)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)(c)&0x3f|0x80;
|
||||
(s)[(i)++]=(uint8_t)(((c)>>18)|0xf0);
|
||||
(s)[(i)++]=(uint8_t)(((c)>>12)&0x3f|0x80);
|
||||
(s)[(i)++]=(uint8_t)(((c)>>6)&0x3f|0x80);
|
||||
(s)[(i)++]=(uint8_t)((c)&0x3f|0x80);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue