mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-2305 UColOptionSet uses int32_t instead of UColAttributeValue + added some reserved space
X-SVN-Rev: 9865
This commit is contained in:
parent
dc90c1e2fe
commit
a298df56b3
3 changed files with 38 additions and 35 deletions
|
@ -577,14 +577,14 @@ void ucol_setOptionsFromHeader(UCollator* result, UColOptionSet * opts, UErrorCo
|
|||
if(U_FAILURE(*status)) {
|
||||
return;
|
||||
}
|
||||
result->caseFirst = opts->caseFirst;
|
||||
result->caseLevel = opts->caseLevel;
|
||||
result->frenchCollation = opts->frenchCollation;
|
||||
result->normalizationMode = opts->normalizationMode;
|
||||
result->strength = opts->strength;
|
||||
result->variableTopValue = opts->variableTopValue;
|
||||
result->alternateHandling = opts->alternateHandling;
|
||||
result->hiraganaQ = opts->hiraganaQ;
|
||||
result->caseFirst = (UColAttributeValue)opts->caseFirst;
|
||||
result->caseLevel = (UColAttributeValue)opts->caseLevel;
|
||||
result->frenchCollation = (UColAttributeValue)opts->frenchCollation;
|
||||
result->normalizationMode = (UColAttributeValue)opts->normalizationMode;
|
||||
result->strength = (UColAttributeValue)opts->strength;
|
||||
result->variableTopValue = (UColAttributeValue)opts->variableTopValue;
|
||||
result->alternateHandling = (UColAttributeValue)opts->alternateHandling;
|
||||
result->hiraganaQ = (UColAttributeValue)opts->hiraganaQ;
|
||||
|
||||
result->caseFirstisDefault = TRUE;
|
||||
result->caseLevelisDefault = TRUE;
|
||||
|
@ -716,14 +716,14 @@ UCollator* ucol_initCollator(const UCATableHeader *image, UCollator *fillIn, UEr
|
|||
result->freeOptionsOnClose = FALSE;
|
||||
|
||||
/* set attributes */
|
||||
result->caseFirst = result->options->caseFirst;
|
||||
result->caseLevel = result->options->caseLevel;
|
||||
result->frenchCollation = result->options->frenchCollation;
|
||||
result->normalizationMode = result->options->normalizationMode;
|
||||
result->strength = result->options->strength;
|
||||
result->variableTopValue = result->options->variableTopValue;
|
||||
result->alternateHandling = result->options->alternateHandling;
|
||||
result->hiraganaQ = result->options->hiraganaQ;
|
||||
result->caseFirst = (UColAttributeValue)result->options->caseFirst;
|
||||
result->caseLevel = (UColAttributeValue)result->options->caseLevel;
|
||||
result->frenchCollation = (UColAttributeValue)result->options->frenchCollation;
|
||||
result->normalizationMode = (UColAttributeValue)result->options->normalizationMode;
|
||||
result->strength = (UColAttributeValue)result->options->strength;
|
||||
result->variableTopValue = (UColAttributeValue)result->options->variableTopValue;
|
||||
result->alternateHandling = (UColAttributeValue)result->options->alternateHandling;
|
||||
result->hiraganaQ = (UColAttributeValue)result->options->hiraganaQ;
|
||||
|
||||
result->caseFirstisDefault = TRUE;
|
||||
result->caseLevelisDefault = TRUE;
|
||||
|
@ -5129,7 +5129,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->hiraganaQisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->hiraganaQisDefault = TRUE;
|
||||
coll->hiraganaQ = coll->options->hiraganaQ;
|
||||
coll->hiraganaQ = (UColAttributeValue)coll->options->hiraganaQ;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
@ -5143,7 +5143,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->frenchCollationisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->frenchCollationisDefault = TRUE;
|
||||
coll->frenchCollation = coll->options->frenchCollation;
|
||||
coll->frenchCollation = (UColAttributeValue)coll->options->frenchCollation;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR ;
|
||||
}
|
||||
|
@ -5157,7 +5157,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->alternateHandlingisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->alternateHandlingisDefault = TRUE;
|
||||
coll->alternateHandling = coll->options->alternateHandling ;
|
||||
coll->alternateHandling = (UColAttributeValue)coll->options->alternateHandling ;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR ;
|
||||
}
|
||||
|
@ -5173,7 +5173,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->caseFirst = UCOL_OFF;
|
||||
coll->caseFirstisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->caseFirst = coll->options->caseFirst;
|
||||
coll->caseFirst = (UColAttributeValue)coll->options->caseFirst;
|
||||
coll->caseFirstisDefault = TRUE;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR ;
|
||||
|
@ -5187,7 +5187,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->caseLevel = UCOL_OFF;
|
||||
coll->caseLevelisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->caseLevel = coll->options->caseLevel;
|
||||
coll->caseLevel = (UColAttributeValue)coll->options->caseLevel;
|
||||
coll->caseLevelisDefault = TRUE;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR ;
|
||||
|
@ -5202,7 +5202,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
coll->normalizationModeisDefault = FALSE;
|
||||
} else if (value == UCOL_DEFAULT) {
|
||||
coll->normalizationModeisDefault = TRUE;
|
||||
coll->normalizationMode = coll->options->normalizationMode;
|
||||
coll->normalizationMode = (UColAttributeValue)coll->options->normalizationMode;
|
||||
} else {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR ;
|
||||
}
|
||||
|
@ -5210,7 +5210,7 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value,
|
|||
case UCOL_STRENGTH: /* attribute for strength */
|
||||
if (value == UCOL_DEFAULT) {
|
||||
coll->strengthisDefault = TRUE;
|
||||
coll->strength = coll->options->strength;
|
||||
coll->strength = (UColAttributeValue)coll->options->strength;
|
||||
} else if (value <= UCOL_IDENTICAL) {
|
||||
coll->strengthisDefault = FALSE;
|
||||
coll->strength = value;
|
||||
|
|
|
@ -40,10 +40,10 @@ isAcceptableInvUCA(void * /*context*/,
|
|||
pInfo->dataFormat[1]==invUcaDataInfo.dataFormat[1] &&
|
||||
pInfo->dataFormat[2]==invUcaDataInfo.dataFormat[2] &&
|
||||
pInfo->dataFormat[3]==invUcaDataInfo.dataFormat[3] &&
|
||||
pInfo->formatVersion[0]==ucaDataInfo.formatVersion[0] &&
|
||||
pInfo->formatVersion[1]==ucaDataInfo.formatVersion[1] &&
|
||||
pInfo->formatVersion[2]==ucaDataInfo.formatVersion[2] &&
|
||||
pInfo->formatVersion[3]==ucaDataInfo.formatVersion[3] &&
|
||||
pInfo->formatVersion[0]==invUcaDataInfo.formatVersion[0] &&
|
||||
pInfo->formatVersion[1]==invUcaDataInfo.formatVersion[1] &&
|
||||
pInfo->formatVersion[2]==invUcaDataInfo.formatVersion[2] &&
|
||||
pInfo->formatVersion[3]==invUcaDataInfo.formatVersion[3] &&
|
||||
pInfo->dataVersion[0]==invUcaDataInfo.dataVersion[0] &&
|
||||
pInfo->dataVersion[1]==invUcaDataInfo.dataVersion[1] &&
|
||||
pInfo->dataVersion[2]==invUcaDataInfo.dataVersion[2] &&
|
||||
|
|
|
@ -44,7 +44,9 @@ static const UDataInfo ucaDataInfo={
|
|||
|
||||
{0x55, 0x43, 0x6f, 0x6c}, /* dataFormat="UCol" */
|
||||
/* 03/26/2002 bumped up version since format has changed */
|
||||
{2, 0, 0, 0}, /* formatVersion */
|
||||
/* 09/16/2002 bumped up version since we went from UColAttributeValue */
|
||||
/* to int32_t in UColOptionSet */
|
||||
{2, 1, 0, 0}, /* formatVersion */
|
||||
{3, 0, 0, 0} /* dataVersion = Unicode Version*/
|
||||
};
|
||||
|
||||
|
@ -529,13 +531,14 @@ typedef enum {
|
|||
|
||||
typedef struct {
|
||||
uint32_t variableTopValue;
|
||||
UColAttributeValue frenchCollation;
|
||||
UColAttributeValue alternateHandling; /* attribute for handling variable elements*/
|
||||
UColAttributeValue caseFirst; /* who goes first, lower case or uppercase */
|
||||
UColAttributeValue caseLevel; /* do we have an extra case level */
|
||||
UColAttributeValue normalizationMode; /* attribute for normalization */
|
||||
UColAttributeValue strength; /* attribute for strength */
|
||||
UColAttributeValue hiraganaQ; /* attribuge for special Hiragana */
|
||||
/*UColAttributeValue*/ int32_t frenchCollation;
|
||||
/*UColAttributeValue*/ int32_t alternateHandling; /* attribute for handling variable elements*/
|
||||
/*UColAttributeValue*/ int32_t caseFirst; /* who goes first, lower case or uppercase */
|
||||
/*UColAttributeValue*/ int32_t caseLevel; /* do we have an extra case level */
|
||||
/*UColAttributeValue*/ int32_t normalizationMode; /* attribute for normalization */
|
||||
/*UColAttributeValue*/ int32_t strength; /* attribute for strength */
|
||||
/*UColAttributeValue*/ int32_t hiraganaQ; /* attribuge for special Hiragana */
|
||||
uint8_t reserved[64]; /* for future use */
|
||||
} UColOptionSet;
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Reference in a new issue