mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-2699 more gcc warnings fixes
X-SVN-Rev: 11958
This commit is contained in:
parent
41204087aa
commit
7ec7853f1e
3 changed files with 16 additions and 5 deletions
|
@ -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&
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue