mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-3222 fix compiler warnings
X-SVN-Rev: 14007
This commit is contained in:
parent
a57f032f42
commit
dc511f7a60
6 changed files with 29 additions and 27 deletions
|
@ -219,7 +219,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
const UDataInfo *pInfo;
|
||||
int32_t headerSize, i;
|
||||
|
||||
int32_t indexes[UPROPS_INDEX_COUNT];
|
||||
int32_t dataIndexes[UPROPS_INDEX_COUNT];
|
||||
const int32_t *inData32;
|
||||
|
||||
/* udata_swapDataHeader checks the arguments */
|
||||
|
@ -248,7 +248,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
}
|
||||
|
||||
/* the properties file must contain at least the indexes array */
|
||||
if(length>=0 && (length-headerSize)<sizeof(indexes)) {
|
||||
if(length>=0 && (length-headerSize)<sizeof(dataIndexes)) {
|
||||
udata_printError(ds, "uprops_swap(): too few bytes (%d after header) for a Unicode properties file\n",
|
||||
length-headerSize);
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
|
@ -258,7 +258,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
/* read the indexes */
|
||||
inData32=(const int32_t *)((const char *)inData+headerSize);
|
||||
for(i=0; i<UPROPS_INDEX_COUNT; ++i) {
|
||||
indexes[i]=udata_readInt32(ds, inData32[i]);
|
||||
dataIndexes[i]=udata_readInt32(ds, inData32[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -268,7 +268,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
if(length>=0) {
|
||||
int32_t *outData32;
|
||||
|
||||
if((length-headerSize)<(4*indexes[UPROPS_RESERVED_INDEX])) {
|
||||
if((length-headerSize)<(4*dataIndexes[UPROPS_RESERVED_INDEX])) {
|
||||
udata_printError(ds, "uprops_swap(): too few bytes (%d after header) for a Unicode properties file\n",
|
||||
length-headerSize);
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
|
@ -279,7 +279,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
|
||||
/* copy everything for inaccessible data (padding) */
|
||||
if(inData32!=outData32) {
|
||||
uprv_memcpy(outData32, inData32, 4*indexes[UPROPS_RESERVED_INDEX]);
|
||||
uprv_memcpy(outData32, inData32, 4*dataIndexes[UPROPS_RESERVED_INDEX]);
|
||||
}
|
||||
|
||||
/* swap the indexes[16] */
|
||||
|
@ -291,7 +291,7 @@ uprops_swap(const UDataSwapper *ds,
|
|||
*/
|
||||
utrie_swap(ds,
|
||||
inData32+UPROPS_INDEX_COUNT,
|
||||
4*(indexes[UPROPS_PROPS32_INDEX]-UPROPS_INDEX_COUNT),
|
||||
4*(dataIndexes[UPROPS_PROPS32_INDEX]-UPROPS_INDEX_COUNT),
|
||||
outData32+UPROPS_INDEX_COUNT,
|
||||
pErrorCode);
|
||||
|
||||
|
@ -301,9 +301,9 @@ uprops_swap(const UDataSwapper *ds,
|
|||
* E const uint32_t exceptions[i2-i1];
|
||||
*/
|
||||
ds->swapArray32(ds,
|
||||
inData32+indexes[UPROPS_PROPS32_INDEX],
|
||||
4*(indexes[UPROPS_EXCEPTIONS_TOP_INDEX]-indexes[UPROPS_PROPS32_INDEX]),
|
||||
outData32+indexes[UPROPS_PROPS32_INDEX],
|
||||
inData32+dataIndexes[UPROPS_PROPS32_INDEX],
|
||||
4*(dataIndexes[UPROPS_EXCEPTIONS_TOP_INDEX]-dataIndexes[UPROPS_PROPS32_INDEX]),
|
||||
outData32+dataIndexes[UPROPS_PROPS32_INDEX],
|
||||
pErrorCode);
|
||||
|
||||
/*
|
||||
|
@ -311,9 +311,9 @@ uprops_swap(const UDataSwapper *ds,
|
|||
* U const UChar uchars[2*(i3-i2)];
|
||||
*/
|
||||
ds->swapArray16(ds,
|
||||
inData32+indexes[UPROPS_EXCEPTIONS_TOP_INDEX],
|
||||
4*(indexes[UPROPS_ADDITIONAL_TRIE_INDEX]-indexes[UPROPS_EXCEPTIONS_TOP_INDEX]),
|
||||
outData32+indexes[UPROPS_EXCEPTIONS_TOP_INDEX],
|
||||
inData32+dataIndexes[UPROPS_EXCEPTIONS_TOP_INDEX],
|
||||
4*(dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX]-dataIndexes[UPROPS_EXCEPTIONS_TOP_INDEX]),
|
||||
outData32+dataIndexes[UPROPS_EXCEPTIONS_TOP_INDEX],
|
||||
pErrorCode);
|
||||
|
||||
/*
|
||||
|
@ -321,9 +321,9 @@ uprops_swap(const UDataSwapper *ds,
|
|||
* i3 additionalTrieIndex; -- 32-bit unit index to the additional trie for more properties
|
||||
*/
|
||||
utrie_swap(ds,
|
||||
inData32+indexes[UPROPS_ADDITIONAL_TRIE_INDEX],
|
||||
4*(indexes[UPROPS_ADDITIONAL_VECTORS_INDEX]-indexes[UPROPS_ADDITIONAL_TRIE_INDEX]),
|
||||
outData32+indexes[UPROPS_ADDITIONAL_TRIE_INDEX],
|
||||
inData32+dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX],
|
||||
4*(dataIndexes[UPROPS_ADDITIONAL_VECTORS_INDEX]-dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX]),
|
||||
outData32+dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX],
|
||||
pErrorCode);
|
||||
|
||||
/*
|
||||
|
@ -331,14 +331,14 @@ uprops_swap(const UDataSwapper *ds,
|
|||
* PV const uint32_t propsVectors[(i6-i4)/i5][i5]==uint32_t propsVectors[i6-i4];
|
||||
*/
|
||||
ds->swapArray32(ds,
|
||||
inData32+indexes[UPROPS_ADDITIONAL_VECTORS_INDEX],
|
||||
4*(indexes[UPROPS_RESERVED_INDEX]-indexes[UPROPS_ADDITIONAL_VECTORS_INDEX]),
|
||||
outData32+indexes[UPROPS_ADDITIONAL_VECTORS_INDEX],
|
||||
inData32+dataIndexes[UPROPS_ADDITIONAL_VECTORS_INDEX],
|
||||
4*(dataIndexes[UPROPS_RESERVED_INDEX]-dataIndexes[UPROPS_ADDITIONAL_VECTORS_INDEX]),
|
||||
outData32+dataIndexes[UPROPS_ADDITIONAL_VECTORS_INDEX],
|
||||
pErrorCode);
|
||||
}
|
||||
|
||||
/* i6 reservedItemIndex; -- 32-bit unit index to the top of the properties vectors table */
|
||||
return headerSize+4*indexes[UPROPS_RESERVED_INDEX];
|
||||
return headerSize+4*dataIndexes[UPROPS_RESERVED_INDEX];
|
||||
}
|
||||
|
||||
/* constants and macros for access to the data ------------------------------ */
|
||||
|
|
|
@ -352,8 +352,10 @@ _ISO_2022_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorC
|
|||
static UConverter *
|
||||
_ISO_2022_SafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status);
|
||||
|
||||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
static void
|
||||
T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args, UErrorCode* err);
|
||||
#endif
|
||||
|
||||
/*const UConverterSharedData _ISO2022Data;*/
|
||||
static const UConverterSharedData _ISO2022JPData;
|
||||
|
@ -1974,7 +1976,7 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterToUnicodeArgs *args
|
|||
args->converter = saveThis;
|
||||
}
|
||||
|
||||
/*-Done with buffer with entire buffer
|
||||
/*-Done with entire buffer
|
||||
-Error while converting
|
||||
*/
|
||||
if (U_FAILURE(*err) || (args->source == args->sourceLimit))
|
||||
|
|
|
@ -272,7 +272,7 @@ CnvExtWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
|
|||
#endif
|
||||
|
||||
if(VERBOSE) {
|
||||
printf("size of extension data: %ld\n", top);
|
||||
printf("size of extension data: %ld\n", (long)top);
|
||||
}
|
||||
|
||||
/* return the number of bytes that should have been written */
|
||||
|
|
|
@ -155,7 +155,7 @@ MBCSStartMappings(MBCSData *mbcsData) {
|
|||
/* allocate the code unit array and prefill it with "unassigned" values */
|
||||
sum=mbcsData->ucm->states.countToUCodeUnits;
|
||||
if(VERBOSE) {
|
||||
printf("the total number of offsets is 0x%lx=%ld\n", sum, sum);
|
||||
printf("the total number of offsets is 0x%lx=%ld\n", (long)sum, (long)sum);
|
||||
}
|
||||
|
||||
if(sum>0) {
|
||||
|
@ -180,7 +180,7 @@ MBCSStartMappings(MBCSData *mbcsData) {
|
|||
}
|
||||
mbcsData->fromUBytes=(uint8_t *)uprv_malloc(sum);
|
||||
if(mbcsData->fromUBytes==NULL) {
|
||||
fprintf(stderr, "error: out of memory allocating %ld B for target mappings\n", sum);
|
||||
fprintf(stderr, "error: out of memory allocating %ld B for target mappings\n", (long)sum);
|
||||
return FALSE;
|
||||
}
|
||||
/* initialize the all-unassigned first stage 3 block */
|
||||
|
@ -1075,7 +1075,7 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
|
|||
|
||||
if(tableType&TABLE_EXT) {
|
||||
if(top>0xffffff) {
|
||||
fprintf(stderr, "error: offset 0x%lx to extension table exceeds 0xffffff\n", top);
|
||||
fprintf(stderr, "error: offset 0x%lx to extension table exceeds 0xffffff\n", (long)top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ printMapping(UCMapping *m, UChar32 *codePoints, uint8_t *bytes, FILE *f) {
|
|||
int32_t j;
|
||||
|
||||
for(j=0; j<m->uLen; ++j) {
|
||||
fprintf(f, "<U%04lX>", codePoints[j]);
|
||||
fprintf(f, "<U%04lX>", (long)codePoints[j]);
|
||||
}
|
||||
|
||||
fputc(' ', f);
|
||||
|
@ -52,7 +52,7 @@ printMapping(UCMapping *m, UChar32 *codePoints, uint8_t *bytes, FILE *f) {
|
|||
}
|
||||
|
||||
if(m->f>=0) {
|
||||
fprintf(f, " |%lu\n", m->f);
|
||||
fprintf(f, " |%u\n", m->f);
|
||||
} else {
|
||||
fputs("\n", f);
|
||||
}
|
||||
|
|
|
@ -1018,7 +1018,7 @@ ucm_countChars(UCMStates *states,
|
|||
break;
|
||||
default:
|
||||
/* reserved, must never occur */
|
||||
fprintf(stderr, "ucm error: byte sequence reached reserved action code, entry: 0x%02lx\n", entry);
|
||||
fprintf(stderr, "ucm error: byte sequence reached reserved action code, entry: 0x%02lx\n", (unsigned long)entry);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue