ICU-5420 ucol_IGetPrevCE: always reset flags when finished w/ side buffer; fix a couple of signed/unsigned problems.

X-SVN-Rev: 23982
This commit is contained in:
Eric Mader 2008-05-26 19:18:33 +00:00
parent 246077067f
commit ea4a1a7b48
2 changed files with 9 additions and 7 deletions

View File

@ -1642,7 +1642,7 @@ void collPrevIterNormalize(collIterate *data)
* **** THIS IS PROBABLY NOT A COMPLETE TEST ****
*/
if (baseChar >= 0x100) {
int32_t baseOrder = UTRIE_GET32_FROM_LEAD(&data->coll->mapping, baseChar);
uint32_t baseOrder = UTRIE_GET32_FROM_LEAD(&data->coll->mapping, baseChar);
if (baseOrder == UCOL_NOT_FOUND && data->coll->UCA) {
baseOrder = UTRIE_GET32_FROM_LEAD(&data->coll->UCA->mapping, baseChar);
@ -1903,16 +1903,18 @@ inline uint32_t ucol_IGetPrevCE(const UCollator *coll, collIterate *data,
Because pointer points to the last accessed character,
hence we have to increment it by one here.
*/
if (data->fcdPosition == NULL) {
data->flags = data->origFlags;
data->offsetRepeatValue = 0;
if (data->fcdPosition == NULL) {
data->pos = data->string;
return UCOL_NO_MORE_CES;
}
else {
data->pos = data->fcdPosition + 1;
}
data->flags = data->origFlags;
data->offsetRepeatValue = 0;
continue;
continue;
}
}
@ -3794,7 +3796,7 @@ uint32_t ucol_prv_getSpecialPrevCE(const UCollator *coll, UChar ch, uint32_t CE,
// **** doesn't work if using iterator ****
if (source->offsetReturn != NULL) {
if (source->offsetReturn == source->offsetBuffer) {
if (! (source->flags & UCOL_ITER_INNORMBUF) && source->offsetReturn == source->offsetBuffer) {
source->offsetStore = source->offsetBuffer;
}else {
firstOffset = -1;

View File

@ -497,7 +497,7 @@ ucol_previousProcessed(UCollationElements *elems,
// UCollationStrength strength = ucol_getStrength(coll);
// UBool toShift = ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, status) == UCOL_SHIFTED;
// uint32_t variableTop = coll->variableTopValue;
uint32_t low = 0, high = 0;
int32_t low = 0, high = 0;
if (U_FAILURE(*status)) {
return UCOL_PROCESSED_NULLORDER;