ICU-2699 more gcc warnings fixes

X-SVN-Rev: 11958
This commit is contained in:
Vladimir Weinstein 2003-05-15 23:20:11 +00:00
parent 41204087aa
commit 7ec7853f1e
3 changed files with 16 additions and 5 deletions

View file

@ -256,6 +256,7 @@ CollationKey::compareTo(const CollationKey& target) const
UCollationResult
CollationKey::compareTo(const CollationKey& target, UErrorCode &status) const
{
if(U_SUCCESS(status)) {
uint8_t *src = this->fBytes;
uint8_t *tgt = target.fBytes;
@ -294,6 +295,9 @@ CollationKey::compareTo(const CollationKey& target, UErrorCode &status) const
}
return result;
} else {
return UCOL_EQUAL;
}
}
CollationKey&

View file

@ -348,7 +348,11 @@ UCollationResult RuleBasedCollator::compare(const UChar* source,
int32_t targetLength,
UErrorCode &status) const
{
return ucol_strcoll(ucollator, source, sourceLength, target, targetLength);
if(U_SUCCESS(status)) {
return ucol_strcoll(ucollator, source, sourceLength, target, targetLength);
} else {
return UCOL_EQUAL;
}
}
/**
@ -367,8 +371,12 @@ UCollationResult RuleBasedCollator::compare(
const UnicodeString& target,
UErrorCode &status) const
{
return ucol_strcoll(ucollator, source.getBuffer(), source.length(),
target.getBuffer(), target.length());
if(U_SUCCESS(status)) {
return ucol_strcoll(ucollator, source.getBuffer(), source.length(),
target.getBuffer(), target.length());
} else {
return UCOL_EQUAL;
}
}
/**

View file

@ -1636,7 +1636,7 @@ UChar peekCharacter(collIterate *source, int32_t offset) {
return (UChar)source->iterator->current(source->iterator);
}
} else {
return U_SENTINEL;
return (UChar)U_SENTINEL;
}
}
@ -6914,7 +6914,6 @@ static UCollationResult ucol_compareUsingSortKeys(collIterate *sColl,
UChar *source = NULL;
UChar *target = NULL;
UChar sStackBuf[256], tStackBuf[256];
int32_t sBufSize = 256, tBufSize = 256;
int32_t sourceLength = (sColl->flags&UCOL_ITER_HASLEN)?(sColl->endp-sColl->string):-1;
int32_t targetLength = (tColl->flags&UCOL_ITER_HASLEN)?(tColl->endp-tColl->string):-1;