ICU-535 Removed a compiler warning

X-SVN-Rev: 2139
This commit is contained in:
George Rhoten 2000-08-08 23:26:10 +00:00
parent f960d434ea
commit 5a1369d8bc
14 changed files with 53 additions and 63 deletions

View File

@ -1311,7 +1311,7 @@ scsu_inDynamicWindow(const UnicodeCompressor *comp,
int32_t c,
int32_t whichWindow)
{
return (c >= comp->fOffsets[whichWindow]
return (UBool)(c >= comp->fOffsets[whichWindow]
&& c < (comp->fOffsets[whichWindow] + 0x80));
}
@ -1326,7 +1326,7 @@ static UBool
scsu_inStaticWindow(int32_t c,
int32_t whichWindow)
{
return (c >= sOffsets[whichWindow] && c < (sOffsets[whichWindow] + 0x80));
return (UBool)(c >= sOffsets[whichWindow] && c < (sOffsets[whichWindow] + 0x80));
}
/**
@ -1337,7 +1337,7 @@ scsu_inStaticWindow(int32_t c,
static UBool
scsu_isCompressible(int32_t c)
{
return (c < 0x3400 || c >= 0xE000);
return (UBool)(c < 0x3400 || c >= 0xE000);
}
/**

View File

@ -376,139 +376,142 @@ u_charType(UChar32 c) {
/* Checks if ch is a lower case letter.*/
U_CAPI UBool U_EXPORT2
u_islower(UChar32 c) {
return GET_CATEGORY(GET_PROPS(c))==U_LOWERCASE_LETTER;
return (UBool)(GET_CATEGORY(GET_PROPS(c))==U_LOWERCASE_LETTER);
}
/* Checks if ch is an upper case letter.*/
U_CAPI UBool U_EXPORT2
u_isupper(UChar32 c) {
return GET_CATEGORY(GET_PROPS(c))==U_UPPERCASE_LETTER;
return (UBool)(GET_CATEGORY(GET_PROPS(c))==U_UPPERCASE_LETTER);
}
/* Checks if ch is a title case letter; usually upper case letters.*/
U_CAPI UBool U_EXPORT2
u_istitle(UChar32 c) {
return GET_CATEGORY(GET_PROPS(c))==U_TITLECASE_LETTER;
return (UBool)(GET_CATEGORY(GET_PROPS(c))==U_TITLECASE_LETTER);
}
/* Checks if ch is a decimal digit. */
U_CAPI UBool U_EXPORT2
u_isdigit(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_OTHER_NUMBER|1UL<<U_LETTER_NUMBER)
)!=0;
)!=0);
}
/* Checks if the Unicode character is a letter.*/
U_CAPI UBool U_EXPORT2
u_isalpha(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER)
)!=0;
)!=0);
}
/* Checks if ch is a letter or a decimal digit */
U_CAPI UBool U_EXPORT2
u_isalnum(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_OTHER_NUMBER|1UL<<U_LETTER_NUMBER|
1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER)
)!=0;
)!=0);
}
/* Checks if ch is a unicode character with assigned character type.*/
U_CAPI UBool U_EXPORT2
u_isdefined(UChar32 c) {
return GET_PROPS(c)!=0;
return (UBool)(GET_PROPS(c)!=0);
}
/* Checks if the Unicode character is a base form character that can take a diacritic.*/
U_CAPI UBool U_EXPORT2
u_isbase(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_OTHER_NUMBER|1UL<<U_LETTER_NUMBER|
1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER|
1UL<<U_NON_SPACING_MARK|1UL<<U_ENCLOSING_MARK|1UL<<U_COMBINING_SPACING_MARK)
)!=0;
)!=0);
}
/* Checks if the Unicode character is a control character.*/
U_CAPI UBool U_EXPORT2
u_iscntrl(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_CONTROL_CHAR|1UL<<U_FORMAT_CHAR|1UL<<U_LINE_SEPARATOR|1UL<<U_PARAGRAPH_SEPARATOR)
)!=0;
)!=0);
}
/* Checks if the Unicode character is a space character.*/
UBool
u_isspace(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_SPACE_SEPARATOR|1UL<<U_LINE_SEPARATOR|1UL<<U_PARAGRAPH_SEPARATOR)
)!=0;
)!=0);
}
/* Checks if the Unicode character is a whitespace character.*/
U_CAPI UBool U_EXPORT2
u_isWhitespace(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_SPACE_SEPARATOR|1UL<<U_LINE_SEPARATOR|1UL<<U_PARAGRAPH_SEPARATOR)
)!=0 &&
c!=0xa0 && c!=0x202f && c!=0xfeff; /* exclude no-break spaces */
c!=0xa0 && c!=0x202f && c!=0xfeff); /* exclude no-break spaces */
}
/* Checks if the Unicode character is printable.*/
U_CAPI UBool U_EXPORT2
u_isprint(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(
((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_OTHER_NUMBER|1UL<<U_LETTER_NUMBER|
1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER|
1UL<<U_NON_SPACING_MARK|1UL<<U_ENCLOSING_MARK|1UL<<U_COMBINING_SPACING_MARK|
1UL<<U_SPACE_SEPARATOR|1UL<<U_LINE_SEPARATOR|1UL<<U_PARAGRAPH_SEPARATOR|
1UL<<U_DASH_PUNCTUATION|1UL<<U_START_PUNCTUATION|1UL<<U_END_PUNCTUATION|1UL<<U_CONNECTOR_PUNCTUATION|1UL<<U_OTHER_PUNCTUATION|
1UL<<U_MATH_SYMBOL|1UL<<U_CURRENCY_SYMBOL|1UL<<U_MODIFIER_SYMBOL|1UL<<U_OTHER_SYMBOL)
)!=0;
)!=0);
}
/* Checks if the Unicode character can start a Unicode identifier.*/
U_CAPI UBool U_EXPORT2
u_isIDStart(UChar32 c) {
/* same as u_isalpha() */
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER)
)!=0;
)!=0);
}
/* Checks if the Unicode character can be a Unicode identifier part other than starting the
identifier.*/
U_CAPI UBool U_EXPORT2
u_isIDPart(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(
((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_LETTER_NUMBER|
1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER|
1UL<<U_CONNECTOR_PUNCTUATION|1UL<<U_COMBINING_SPACING_MARK|1UL<<U_NON_SPACING_MARK)
)!=0 ||
u_isIDIgnorable(c);
u_isIDIgnorable(c));
}
/*Checks if the Unicode character can be ignorable in a Java or Unicode identifier.*/
U_CAPI UBool U_EXPORT2
u_isIDIgnorable(UChar32 c) {
return (uint32_t)c<=8 ||
return (UBool)((uint32_t)c<=8 ||
(uint32_t)(c-0xe)<=(0x1b-0xe) ||
(uint32_t)(c-0x7f)<=(0x9f-0x7f) ||
(uint32_t)(c-0x200a)<=(0x200f-0x200a) ||
(uint32_t)(c-0x206a)<=(0x206f-0x206a) ||
c==0xfeff;
c==0xfeff);
}
/*Checks if the Unicode character can start a Java identifier.*/
U_CAPI UBool U_EXPORT2
u_isJavaIDStart(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(
((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER|
1UL<<U_CURRENCY_SYMBOL|1UL<<U_CONNECTOR_PUNCTUATION)
)!=0;
)!=0);
}
/*Checks if the Unicode character can be a Java identifier part other than starting the
@ -516,13 +519,14 @@ u_isJavaIDStart(UChar32 c) {
*/
U_CAPI UBool U_EXPORT2
u_isJavaIDPart(UChar32 c) {
return ((1UL<<GET_CATEGORY(GET_PROPS(c)))&
return (UBool)(
((1UL<<GET_CATEGORY(GET_PROPS(c)))&
(1UL<<U_DECIMAL_DIGIT_NUMBER|1UL<<U_LETTER_NUMBER|
1UL<<U_UPPERCASE_LETTER|1UL<<U_LOWERCASE_LETTER|1UL<<U_TITLECASE_LETTER|1UL<<U_MODIFIER_LETTER|1UL<<U_OTHER_LETTER|
1UL<<U_CURRENCY_SYMBOL|1UL<<U_CONNECTOR_PUNCTUATION|
1UL<<U_COMBINING_SPACING_MARK|1UL<<U_NON_SPACING_MARK)
)!=0 ||
u_isIDIgnorable(c);
u_isIDIgnorable(c));
}
/* Transforms the Unicode character to its lower case equivalent.*/
@ -646,7 +650,7 @@ u_charDirection(UChar32 c) {
U_CAPI UBool U_EXPORT2
u_isMirrored(UChar32 c) {
return GET_PROPS(c)&(1UL<<MIRROR_SHIFT) ? TRUE : FALSE;
return (UBool)(GET_PROPS(c)&(1UL<<MIRROR_SHIFT) ? TRUE : FALSE);
}
U_CAPI UChar32 U_EXPORT2

View File

@ -213,7 +213,7 @@ CompactShortArray* ucmp16_openAdopt(uint16_t *indexArray,
this_obj->fBogus = FALSE;
this_obj->fArray = newValues;
this_obj->fIndex = indexArray;
this_obj->fCompact = count < UCMP16_kUnicodeCount;
this_obj->fCompact = (UBool)(count < UCMP16_kUnicodeCount);
this_obj->fStructSize = sizeof(CompactShortArray);
this_obj->kBlockShift = UCMP16_kBlockShift;
this_obj->kBlockMask = UCMP16_kBlockMask;
@ -256,7 +256,7 @@ CompactShortArray* ucmp16_openAlias(uint16_t *indexArray,
this_obj->fBogus = FALSE;
this_obj->fArray = newValues;
this_obj->fIndex = indexArray;
this_obj->fCompact = count < UCMP16_kUnicodeCount;
this_obj->fCompact = (UBool)(count < UCMP16_kUnicodeCount);
this_obj->fStructSize = sizeof(CompactShortArray);
this_obj->kBlockShift = UCMP16_kBlockShift;
this_obj->kBlockMask = UCMP16_kBlockMask;
@ -495,7 +495,7 @@ void touchBlock(CompactShortArray* this_obj,
UBool blockTouched(const CompactShortArray* this_obj, int32_t i)
{
return (this_obj->fHashes[i] != 0);
return (UBool)(this_obj->fHashes[i] != 0);
}
uint32_t ucmp16_getCount(const CompactShortArray* this_obj)

View File

@ -26,7 +26,7 @@ static int32_t ucmp32_findOverlappingPosition(CompactIntArray* this_obj, uint32_
const UChar *tempIndex,
int32_t tempIndexCount,
uint32_t cycle);
static UBool debugSmall = FALSE;
static uint32_t debugSmallLimit = 30000;
@ -82,7 +82,7 @@ char c;
}
/* char instead of int8_t for Mac compilation*/
T_FileStream_read(is, (char*)&c, sizeof(c));
this_obj->fCompact = (c != 0);
this_obj->fCompact = (UBool)(c != 0);
}
}
@ -113,7 +113,7 @@ if (!T_FileStream_error(os))
T_FileStream_write(os, &len, sizeof(len));
T_FileStream_write(os, this_obj->fIndex, sizeof(*(this_obj->fIndex)) * UCMP32_kIndexCount);
}
c = this_obj->fCompact ? 1 : 0; /* char instead of int8_t for Mac compilation*/
c = (char)(this_obj->fCompact ? 1 : 0); /* char instead of int8_t for Mac compilation*/
T_FileStream_write(os, (const char*)&c, sizeof(c));
}
}
@ -163,7 +163,7 @@ char c;
}
/* char instead of int8_t for Mac compilation*/
uprv_mstrm_read(is, (char*)&c, sizeof(c));
this_obj->fCompact = (c != 0);
this_obj->fCompact = (UBool)(c != 0);
}
}
@ -194,7 +194,7 @@ if (!uprv_mstrm_error(os))
uprv_mstrm_write(os, (uint8_t *)&len, sizeof(len));
uprv_mstrm_write(os, (uint8_t *)this_obj->fIndex, sizeof(*(this_obj->fIndex)) * UCMP32_kIndexCount);
}
c = this_obj->fCompact ? 1 : 0; /* char instead of int8_t for Mac compilation*/
c = (char)(this_obj->fCompact ? 1 : 0); /* char instead of int8_t for Mac compilation*/
uprv_mstrm_write(os, (uint8_t *)&c, sizeof(c));
}
}
@ -269,7 +269,7 @@ CompactIntArray* ucmp32_openAdopt(uint16_t *indexArray, int32_t *newValues, int3
this_obj->fBogus = FALSE;
this_obj->fArray = newValues;
this_obj->fIndex = indexArray;
this_obj->fCompact = (count < UCMP32_kUnicodeCount) ? TRUE : FALSE;
this_obj->fCompact = (UBool)((count < UCMP32_kUnicodeCount) ? TRUE : FALSE);
return this_obj;
}
@ -290,7 +290,7 @@ void ucmp32_close( CompactIntArray* this_obj)
UBool ucmp32_isBogus(const CompactIntArray* this_obj)
{
return this_obj == NULL || this_obj->fBogus;
return (UBool)(this_obj == NULL || this_obj->fBogus);
}
void ucmp32_expand(CompactIntArray* this_obj) {

View File

@ -32,7 +32,7 @@ int32_t ucmp8_getkBlockCount() { return UCMP8_kBlockCount;}
void ucmp8_initBogus(CompactByteArray* array)
{
CompactByteArray* this_obj = array;
if (this_obj == NULL) return;
this_obj->fStructSize = sizeof(CompactByteArray);
@ -187,7 +187,7 @@ CompactByteArray* ucmp8_openAdopt(uint16_t *indexArray,
this_obj->fArray = newValues;
this_obj->fIndex = indexArray;
this_obj->fCompact = (count < UCMP8_kUnicodeCount) ? TRUE : FALSE;
this_obj->fCompact = (UBool)((count < UCMP8_kUnicodeCount) ? TRUE : FALSE);
this_obj->fAlias = FALSE;
this_obj->fIAmOwned = FALSE;
@ -209,7 +209,7 @@ CompactByteArray* ucmp8_openAlias(uint16_t *indexArray,
this_obj->fArray = newValues;
this_obj->fIndex = indexArray;
this_obj->fCompact = (count < UCMP8_kUnicodeCount) ? TRUE : FALSE;
this_obj->fCompact = (UBool)((count < UCMP8_kUnicodeCount) ? TRUE : FALSE);
this_obj->fAlias = TRUE;
this_obj->fIAmOwned = FALSE;
@ -325,7 +325,7 @@ findOverlappingPosition(CompactByteArray* this_obj,
UBool
ucmp8_isBogus(const CompactByteArray* this_obj)
{
return this_obj == NULL || this_obj->fBogus;
return (UBool)(this_obj == NULL || this_obj->fBogus);
}
const int8_t*

View File

@ -77,7 +77,6 @@ void entryIncrease(UResourceDataEntry *entry) {
* Bundle, as well as in its parents
*/
const ResourceData *getFallbackData(const UResourceBundle* resBundle, const char* * resTag, UResourceDataEntry* *realData, Resource *res, UErrorCode *status) {
const ResourceData *result = NULL;
UResourceDataEntry *resB = resBundle->fData;
int32_t indexR = -1;
int32_t i = 0;
@ -241,7 +240,6 @@ UResourceDataEntry *init_entry(const char *localeID, const char *path, UErrorCod
/* handle the alias by trying to get out the %%Alias tag.*/
char aliasName[100];
int32_t aliasLen;
UErrorCode internal = U_ZERO_ERROR;
/* We'll try to get alias string from the bundle */
Resource aliasres = res_getResource(&(r->fData), "%%ALIAS");
const UChar *alias = res_getString(&(r->fData), aliasres, &aliasLen);
@ -374,7 +372,6 @@ UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode
* for initing Collation data at this point.
*/
U_CFUNC UResourceBundle* ures_openNoFallback(const char* path, const char* localeID, UErrorCode* status) {
int32_t en_US = uprv_strcmp(localeID, "en_US");
UResourceBundle *r = (UResourceBundle *)uprv_malloc(sizeof(UResourceBundle));
if(r == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
@ -1201,8 +1198,6 @@ U_CAPI int32_t ures_countArrayItems(const UResourceBundle* resourceBundle,
const char* resourceKey,
UErrorCode* status)
{
Resource res = RES_BOGUS;
UResourceBundle resData;
ures_setIsStackObject(&resData, TRUE);
if (status==NULL || U_FAILURE(*status)) {

View File

@ -165,7 +165,6 @@ ufmt_unicodeToDefaultCP(const UChar *s,
{
int32_t size;
char *target, *alias;
const UChar *consumed = 0;
UConverter *defConverter;
UErrorCode status = U_ZERO_ERROR;

View File

@ -2023,7 +2023,6 @@ DecimalFormat::toPattern(UnicodeString& result, UBool localized) const
roundingDecimalPos = fRoundingIncrement->fDecimalAt;
}
for (int32_t part=0; part<2; ++part) {
int32_t partStart = result.length();
if (padPos == kPadBeforePrefix) {
result.append(padSpec);
}

View File

@ -466,7 +466,7 @@ DateFormatSymbols::initializeData(const Locale& locale, UErrorCode& status, UBoo
if (fgLastResortZoneStringsH == 0)
{
// Initialize this -- the compiler doesn't like to do so at static init time
UnicodeString **tempH = fgLastResortZoneStringsH = new UnicodeString*[1];
fgLastResortZoneStringsH = new UnicodeString*[1];
Mutex lock; // This could be optimized but it's not worth it -- exceptional case
*fgLastResortZoneStringsH = (UnicodeString*)fgLastResortZoneStrings;

View File

@ -334,7 +334,6 @@ MessageFormat::toPattern(UnicodeString& result) const
delete integerTemplate;
}
else if (fFormats[i]->getDynamicClassID() == SimpleDateFormat::getStaticClassID()) {
UErrorCode success = U_ZERO_ERROR;
DateFormat& formatAlias = *(DateFormat*)fFormats[i];
DateFormat *defaultDateTemplate = DateFormat::createDateInstance(DateFormat::kDefault, fLocale);
DateFormat *shortDateTemplate = DateFormat::createDateInstance(DateFormat::kShort, fLocale);

View File

@ -219,8 +219,6 @@ SimpleTimeZone::operator=(const SimpleTimeZone &right)
UBool
SimpleTimeZone::operator==(const TimeZone& that) const
{
SimpleTimeZone* other = (SimpleTimeZone*)&that;
return ((this == &that) ||
(getDynamicClassID() == that.getDynamicClassID() &&
TimeZone::operator==(that) &&

View File

@ -1070,7 +1070,6 @@ SimpleDateFormat::subParseLong(const UnicodeString& text, ParsePosition& pos, in
int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count,
UBool obeyCount, UBool ambiguousYear[]) const
{
UErrorCode status = U_ZERO_ERROR;
Formattable number;
int32_t value = 0;
int32_t i;

View File

@ -1833,8 +1833,6 @@ RuleBasedCollator::build(const UnicodeString& pattern,
return;
}
Collator::ECollationStrength aStrength = Collator::IDENTICAL;
UBool isSource = TRUE;
int32_t i = 0;
UnicodeString lastGroupChars;
UnicodeString expChars;

View File

@ -748,7 +748,6 @@ void Transliterator::_unregister(const UnicodeString& ID) {
//int32_t hc = hash(ID);
CacheEntry* entry = (CacheEntry*) cache->get(ID);
if (entry != 0) {
UErrorCode status = U_ZERO_ERROR;
cache->remove(ID);
delete entry;
}