ICU-6002 fix constant expressions for c number parsing (see gcc Bugzilla bug 3885)

X-SVN-Rev: 22851
This commit is contained in:
Markus Scherer 2007-10-25 16:36:50 +00:00
parent 49868a5a68
commit b69ac49696
2 changed files with 8 additions and 8 deletions

View File

@ -1097,15 +1097,15 @@ ucnv_extGetUnicodeSet(const UConverterSharedData *sharedData,
break;
case UCNV_SET_FILTER_GR94DBCS:
if(!(UCNV_EXT_FROM_U_GET_LENGTH(value)==2 &&
(uint16_t)((value=UCNV_EXT_FROM_U_GET_DATA(value))-0xa1a1)<=(0xfefe-0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe-0xa1))) {
(uint16_t)((value=UCNV_EXT_FROM_U_GET_DATA(value))-0xa1a1)<=(0xfefe - 0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe - 0xa1))) {
continue;
}
break;
case UCNV_SET_FILTER_HZ:
if(!(UCNV_EXT_FROM_U_GET_LENGTH(value)==2 &&
(uint16_t)((value=UCNV_EXT_FROM_U_GET_DATA(value))-0xa1a1)<=(0xfdfe-0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe-0xa1))) {
(uint16_t)((value=UCNV_EXT_FROM_U_GET_DATA(value))-0xa1a1)<=(0xfdfe - 0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe - 0xa1))) {
continue;
}
break;

View File

@ -625,8 +625,8 @@ ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData,
/* Only add code points that map to ISO 2022 GR 94 DBCS codes (each byte A1..FE). */
do {
if( ((st3&1)!=0 || useFallback) &&
(uint16_t)((value=*((const uint16_t *)stage3))-0xa1a1)<=(0xfefe-0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe-0xa1)
(uint16_t)((value=*((const uint16_t *)stage3)) - 0xa1a1)<=(0xfefe - 0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe - 0xa1)
) {
sa->add(sa->set, c);
}
@ -638,8 +638,8 @@ ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData,
/* Only add code points that are suitable for HZ DBCS (lead byte A1..FD). */
do {
if( ((st3&1)!=0 || useFallback) &&
(uint16_t)((value=*((const uint16_t *)stage3))-0xa1a1)<=(0xfdfe-0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe-0xa1)
(uint16_t)((value=*((const uint16_t *)stage3))-0xa1a1)<=(0xfdfe - 0xa1a1) &&
(uint8_t)(value-0xa1)<=(0xfe - 0xa1)
) {
sa->add(sa->set, c);
}