ICU-5445 Fix some compiler warnings.
X-SVN-Rev: 20504
This commit is contained in:
parent
e5352af1f8
commit
760e4c2a65
@ -2934,7 +2934,7 @@ uint32_t ucol_prv_getSpecialCE(const UCollator *coll, UChar ch, uint32_t CE, col
|
||||
We do a check to see if we want to collate digits as numbers; if so we generate
|
||||
a custom collation key. Otherwise we pull out the value stored in the expansion table.
|
||||
*/
|
||||
uint32_t size;
|
||||
//uint32_t size;
|
||||
uint32_t i; /* general counter */
|
||||
|
||||
if (source->coll->numericCollation == UCOL_ON){
|
||||
@ -3116,7 +3116,7 @@ uint32_t ucol_prv_getSpecialCE(const UCollator *coll, UChar ch, uint32_t CE, col
|
||||
|
||||
// Now transfer the collation key to our collIterate struct.
|
||||
// The total size for our collation key is endIndx bumped up to the next largest even value divided by two.
|
||||
size = ((endIndex+1) & ~1)/2;
|
||||
//size = ((endIndex+1) & ~1)/2;
|
||||
CE = (((numTempBuf[0] << 8) | numTempBuf[1]) << UCOL_PRIMARYORDERSHIFT) | //Primary weight
|
||||
(UCOL_BYTE_COMMON << UCOL_SECONDARYORDERSHIFT) | // Secondary weight
|
||||
UCOL_BYTE_COMMON; // Tertiary weight.
|
||||
|
@ -803,11 +803,10 @@ static uint32_t uprv_uca_addPrefix(tempUCATable *t, uint32_t CE,
|
||||
if(!isPrefix(CE)) {
|
||||
/* if it wasn't contraction, we wouldn't end up here*/
|
||||
int32_t firstContractionOffset = 0;
|
||||
int32_t contractionOffset = 0;
|
||||
firstContractionOffset = uprv_cnttab_addContraction(contractions, UPRV_CNTTAB_NEWELEMENT, 0, CE, status);
|
||||
uint32_t newCE = uprv_uca_processContraction(contractions, element, UCOL_NOT_FOUND, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->prefix, newCE, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, CE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->prefix, newCE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, CE, status);
|
||||
CE = constructContractCE(SPEC_PROC_TAG, firstContractionOffset);
|
||||
} else { /* we are adding to existing contraction */
|
||||
/* there were already some elements in the table, so we need to add a new contraction */
|
||||
@ -874,11 +873,10 @@ static uint32_t uprv_uca_addContraction(tempUCATable *t, uint32_t CE,
|
||||
if(!isContraction(CE)) {
|
||||
/* if it wasn't contraction, we wouldn't end up here*/
|
||||
int32_t firstContractionOffset = 0;
|
||||
int32_t contractionOffset = 0;
|
||||
firstContractionOffset = uprv_cnttab_addContraction(contractions, UPRV_CNTTAB_NEWELEMENT, 0, CE, status);
|
||||
uint32_t newCE = uprv_uca_processContraction(contractions, element, UCOL_NOT_FOUND, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->cPoints, newCE, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, CE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->cPoints, newCE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, CE, status);
|
||||
CE = constructContractCE(CONTRACTION_TAG, firstContractionOffset);
|
||||
} else { /* we are adding to existing contraction */
|
||||
/* there were already some elements in the table, so we need to add a new contraction */
|
||||
@ -910,7 +908,6 @@ static uint32_t uprv_uca_addContraction(tempUCATable *t, uint32_t CE,
|
||||
|
||||
static uint32_t uprv_uca_processContraction(CntTable *contractions, UCAElements *element, uint32_t existingCE, UErrorCode *status) {
|
||||
int32_t firstContractionOffset = 0;
|
||||
int32_t contractionOffset = 0;
|
||||
// uint32_t contractionElement = UCOL_NOT_FOUND;
|
||||
|
||||
if(U_FAILURE(*status)) {
|
||||
@ -939,8 +936,8 @@ static uint32_t uprv_uca_processContraction(CntTable *contractions, UCAElements
|
||||
/* if it wasn't contraction, we wouldn't end up here*/
|
||||
firstContractionOffset = uprv_cnttab_addContraction(contractions, UPRV_CNTTAB_NEWELEMENT, 0, existingCE, status);
|
||||
uint32_t newCE = uprv_uca_processContraction(contractions, element, UCOL_NOT_FOUND, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->cPoints, newCE, status);
|
||||
contractionOffset = uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, existingCE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, *element->cPoints, newCE, status);
|
||||
uprv_cnttab_addContraction(contractions, firstContractionOffset, 0xFFFF, existingCE, status);
|
||||
existingCE = constructContractCE(contractions->currentTag, firstContractionOffset);
|
||||
} else { /* we are adding to existing contraction */
|
||||
/* there were already some elements in the table, so we need to add a new contraction */
|
||||
|
@ -229,7 +229,6 @@ ucol_openRules( const UChar *rules,
|
||||
UParseError *parseError,
|
||||
UErrorCode *status)
|
||||
{
|
||||
uint32_t listLen = 0;
|
||||
UColTokenParser src;
|
||||
UColAttributeValue norm;
|
||||
UParseError tErr;
|
||||
@ -257,14 +256,14 @@ ucol_openRules( const UChar *rules,
|
||||
}
|
||||
|
||||
switch(normalizationMode) {
|
||||
case UCOL_OFF:
|
||||
case UCOL_ON:
|
||||
case UCOL_DEFAULT:
|
||||
norm = normalizationMode;
|
||||
break;
|
||||
default:
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
case UCOL_OFF:
|
||||
case UCOL_ON:
|
||||
case UCOL_DEFAULT:
|
||||
norm = normalizationMode;
|
||||
break;
|
||||
default:
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
UCollator *UCA = ucol_initUCA(status);
|
||||
@ -274,7 +273,7 @@ ucol_openRules( const UChar *rules,
|
||||
}
|
||||
|
||||
ucol_tok_initTokenList(&src, rules, rulesLength, UCA, status);
|
||||
listLen = ucol_tok_assembleTokenList(&src,parseError, status);
|
||||
ucol_tok_assembleTokenList(&src,parseError, status);
|
||||
|
||||
if(U_FAILURE(*status)) {
|
||||
/* if status is U_ILLEGAL_ARGUMENT_ERROR, src->current points at the offending option */
|
||||
@ -691,7 +690,6 @@ ucol_getTailoredSet(const UCollator *coll, UErrorCode *status)
|
||||
UColTokenParser src;
|
||||
int32_t rulesLen = 0;
|
||||
const UChar *rules = ucol_getRules(coll, &rulesLen);
|
||||
const UChar *current = NULL;
|
||||
UBool startOfRules = TRUE;
|
||||
// we internally use the C++ class, for the following reasons:
|
||||
// 1. we need to utilize canonical iterator, which is a C++ only class
|
||||
@ -706,7 +704,7 @@ ucol_getTailoredSet(const UCollator *coll, UErrorCode *status)
|
||||
// The idea is to tokenize the rule set. For each non-reset token,
|
||||
// we add all the canonicaly equivalent FCD sequences
|
||||
ucol_tok_initTokenList(&src, rules, rulesLen, coll->UCA, status);
|
||||
while ((current = ucol_tok_parseNextToken(&src, startOfRules, &parseError, status)) != NULL) {
|
||||
while (ucol_tok_parseNextToken(&src, startOfRules, &parseError, status) != NULL) {
|
||||
startOfRules = FALSE;
|
||||
if(src.parsedToken.strength != UCOL_TOK_RESET) {
|
||||
const UChar *stuff = src.source+(src.parsedToken.charsOffset);
|
||||
|
@ -451,10 +451,9 @@ ucol_prepareShortStringOpen( const char *definition,
|
||||
// settings
|
||||
|
||||
// analyse the string in order to get everything we need.
|
||||
const char *string = definition;
|
||||
CollatorSpec s;
|
||||
ucol_sit_initCollatorSpecs(&s);
|
||||
string = ucol_sit_readSpecs(&s, definition, parseError, status);
|
||||
ucol_sit_readSpecs(&s, definition, parseError, status);
|
||||
ucol_sit_calculateWholeLocale(&s);
|
||||
|
||||
char buffer[internalBufferSize];
|
||||
|
@ -534,9 +534,8 @@ USet *ucol_uprv_tok_readAndSetUnicodeSet(const UChar *start, const UChar *end, U
|
||||
}
|
||||
current++;
|
||||
}
|
||||
UChar *nextBrace = NULL;
|
||||
|
||||
if(noOpenBraces != 0 || (nextBrace = u_strchr(start+current, 0x005d /*']'*/)) == NULL) {
|
||||
if(noOpenBraces != 0 || u_strchr(start+current, 0x005d /*']'*/) == NULL) {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
@ -750,7 +749,6 @@ ucol_tok_parseNextToken(UColTokenParser *src,
|
||||
UBool inChars = TRUE;
|
||||
UBool inQuote = FALSE;
|
||||
UBool wasInQuote = FALSE;
|
||||
UChar *optionEnd = NULL;
|
||||
uint8_t before = 0;
|
||||
UBool isEscaped = FALSE;
|
||||
// TODO: replace these variables with src->parsedToken counterparts
|
||||
@ -894,9 +892,8 @@ ucol_tok_parseNextToken(UColTokenParser *src,
|
||||
|
||||
case 0x005b/*'['*/:
|
||||
/* options - read an option, analyze it */
|
||||
if((optionEnd = u_strchr(src->current, 0x005d /*']'*/)) != NULL) {
|
||||
if(u_strchr(src->current, 0x005d /*']'*/) != NULL) {
|
||||
uint8_t result = ucol_uprv_tok_readAndSetOption(src, status);
|
||||
//src->current = optionEnd;
|
||||
if(U_SUCCESS(*status)) {
|
||||
if(result & UCOL_TOK_TOP) {
|
||||
if(newStrength == UCOL_TOK_RESET) {
|
||||
|
Loading…
Reference in New Issue
Block a user