ICU-4707 Fix some compiler warnings.

X-SVN-Rev: 20152
This commit is contained in:
George Rhoten 2006-08-24 17:59:01 +00:00
parent 0bd410f29a
commit 8503dd41b1

View File

@ -120,7 +120,14 @@ typedef struct{
char name[30]; char name[30];
}UConverterDataISCII; }UConverterDataISCII;
static const uint16_t lookupInitialData[][3]={ typedef struct LookupDataStruct
{
UniLang uniLang;
MaskEnum maskEnum;
ISCIILang isciiLang;
} LookupDataStruct;
static const LookupDataStruct lookupInitialData[]={
{ DEVANAGARI, DEV_MASK, DEV }, { DEVANAGARI, DEV_MASK, DEV },
{ BENGALI, BNG_MASK, BNG }, { BENGALI, BNG_MASK, BNG },
{ GURMUKHI, PNJ_MASK, PNJ }, { GURMUKHI, PNJ_MASK, PNJ },
@ -148,10 +155,10 @@ _ISCIIOpen(UConverter *cnv, const char *name,const char *locale,uint32_t options
/* initialize state variables */ /* initialize state variables */
converterData->currentDeltaFromUnicode=converterData->currentDeltaToUnicode= converterData->currentDeltaFromUnicode=converterData->currentDeltaToUnicode=
converterData->defDeltaToUnicode= converterData->defDeltaToUnicode=
(uint16_t)(lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK][0] * DELTA); (uint16_t)(lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].uniLang * DELTA);
converterData->currentMaskFromUnicode = converterData->currentMaskToUnicode = converterData->currentMaskFromUnicode = converterData->currentMaskToUnicode =
converterData->defMaskToUnicode=lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK][1]; converterData->defMaskToUnicode=lookupInitialData[options & UCNV_OPTIONS_VERSION_MASK].maskEnum;
converterData->isFirstBuffer=TRUE; converterData->isFirstBuffer=TRUE;
uprv_strcpy(converterData->name,"ISCII,version="); uprv_strcpy(converterData->name,"ISCII,version=");
@ -200,7 +207,7 @@ _ISCIIReset(UConverter *cnv, UConverterResetChoice choice){
if(choice!=UCNV_RESET_TO_UNICODE) { if(choice!=UCNV_RESET_TO_UNICODE) {
cnv->fromUChar32=0x0000; cnv->fromUChar32=0x0000;
data->contextCharFromUnicode=0x00; data->contextCharFromUnicode=0x00;
data->currentMaskFromUnicode=data->defDeltaToUnicode; data->currentMaskFromUnicode=data->defMaskToUnicode;
data->currentDeltaFromUnicode=data->defDeltaToUnicode; data->currentDeltaFromUnicode=data->defDeltaToUnicode;
data->isFirstBuffer=TRUE; data->isFirstBuffer=TRUE;
data->resetToDefaultToUnicode=FALSE; data->resetToDefaultToUnicode=FALSE;
@ -845,7 +852,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
} }
if(sourceChar == LF){ if(sourceChar == LF){
targetByteUnit = ATR<<8; targetByteUnit = ATR<<8;
targetByteUnit += (uint8_t) lookupInitialData[range][2]; targetByteUnit += (uint8_t) lookupInitialData[range].isciiLang;
args->converter->fromUnicodeStatus=sourceChar; args->converter->fromUnicodeStatus=sourceChar;
/* now append ATR and language code */ /* now append ATR and language code */
WRITE_TO_TARGET_FROM_U(args,offsets,source,target,targetLimit,targetByteUnit,err); WRITE_TO_TARGET_FROM_U(args,offsets,source,target,targetLimit,targetByteUnit,err);
@ -891,7 +898,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
/* Now are we in the same block as the previous? */ /* Now are we in the same block as the previous? */
if(newDelta!= converterData->currentDeltaFromUnicode || converterData->isFirstBuffer){ if(newDelta!= converterData->currentDeltaFromUnicode || converterData->isFirstBuffer){
converterData->currentDeltaFromUnicode = newDelta; converterData->currentDeltaFromUnicode = newDelta;
converterData->currentMaskFromUnicode = lookupInitialData[range][1]; converterData->currentMaskFromUnicode = lookupInitialData[range].maskEnum;
deltaChanged =TRUE; deltaChanged =TRUE;
converterData->isFirstBuffer=FALSE; converterData->isFirstBuffer=FALSE;
} }
@ -917,7 +924,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
*/ */
uint16_t temp=0; uint16_t temp=0;
temp =(uint16_t)(ATR<<8); temp =(uint16_t)(ATR<<8);
temp += (uint16_t)((uint8_t) lookupInitialData[range][2]); temp += (uint16_t)((uint8_t) lookupInitialData[range].isciiLang);
/* reset */ /* reset */
deltaChanged=FALSE; deltaChanged=FALSE;
/* now append ATR and language code */ /* now append ATR and language code */
@ -1359,7 +1366,7 @@ _ISCIIGetUnicodeSet(const UConverter *cnv,
scripts, we add all roundtrippable characters to this set. */ scripts, we add all roundtrippable characters to this set. */
sa->addRange(sa->set, 0, ASCII_END); sa->addRange(sa->set, 0, ASCII_END);
for (script = DEVANAGARI; script <= MALAYALAM; script++) { for (script = DEVANAGARI; script <= MALAYALAM; script++) {
mask = (uint8_t)(lookupInitialData[script][1]); mask = (uint8_t)(lookupInitialData[script].maskEnum);
for (idx = 0; idx < DELTA; idx++) { for (idx = 0; idx < DELTA; idx++) {
if (validityTable[idx] & mask) { if (validityTable[idx] & mask) {
sa->add(sa->set, idx + (script * DELTA) + INDIC_BLOCK_BEGIN); sa->add(sa->set, idx + (script * DELTA) + INDIC_BLOCK_BEGIN);