ICU-3222 fix compiler warnings
X-SVN-Rev: 13989
This commit is contained in:
parent
730163b0ca
commit
0bd632b567
@ -240,7 +240,7 @@ ConversionTest::TestFromUnicode() {
|
||||
// start after the NUL
|
||||
p+=length;
|
||||
length=s.length()-length;
|
||||
if(length>=sizeof(cc.subchar)) {
|
||||
if(length>=(int32_t)sizeof(cc.subchar)) {
|
||||
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
} else {
|
||||
int32_t j;
|
||||
@ -850,7 +850,7 @@ ConversionTest::checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *
|
||||
s=printBytes(cc.invalidChars, cc.invalidLength, invalidCharsString=s);
|
||||
s=printBytes((uint8_t *)resultInvalidChars, resultInvalidLength, resultInvalidCharsString=s);
|
||||
|
||||
if((s-buffer)>sizeof(buffer)) {
|
||||
if((s-buffer)>(int32_t)sizeof(buffer)) {
|
||||
errln("toUnicode[%d](%s cb=\"%s\" fb=%d flush=%d %s) fatal error: checkToUnicode() test output buffer overflow writing %d chars\n",
|
||||
cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
|
||||
exit(1);
|
||||
@ -1108,7 +1108,7 @@ ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char
|
||||
s=printUnicode(cc.invalidUChars, cc.invalidLength, invalidCharsString=s);
|
||||
s=printUnicode(resultInvalidUChars, resultInvalidLength, resultInvalidUCharsString=s);
|
||||
|
||||
if((s-buffer)>sizeof(buffer)) {
|
||||
if((s-buffer)>(int32_t)sizeof(buffer)) {
|
||||
errln("fromUnicode[%d](%s cb=\"%s\" fb=%d flush=%d %s) fatal error: checkFromUnicode() test output buffer overflow writing %d chars\n",
|
||||
cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
|
||||
exit(1);
|
||||
|
@ -118,7 +118,7 @@ CnvExtWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
|
||||
if(tableType&TABLE_BASE) {
|
||||
headerSize=0;
|
||||
} else {
|
||||
_MBCSHeader header={ 0 };
|
||||
_MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* write the header and base table name for an extension-only table */
|
||||
length=uprv_strlen(extData->ucm->baseName)+1;
|
||||
|
@ -543,7 +543,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
|
||||
}
|
||||
|
||||
if(flag==1 && length==1 && *bytes==0) {
|
||||
fprintf(stderr, "error: unable to encode a |1 fallback to 0x%02x\n",
|
||||
fprintf(stderr, "error: unable to encode a |1 fallback from U+%04x to 0x%02x\n",
|
||||
c, *bytes);
|
||||
return FALSE;
|
||||
}
|
||||
@ -1012,7 +1012,7 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
|
||||
uint32_t top;
|
||||
int32_t i, stage1Top;
|
||||
|
||||
_MBCSHeader header={ 0 };
|
||||
_MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* adjust stage 1 entries to include the size of stage 1 in the offsets to stage 2 */
|
||||
if(mbcsData->ucm->states.maxCharLength==1) {
|
||||
|
@ -510,7 +510,7 @@ readHeader(ConvData *data,
|
||||
uint8_t bytes[UCNV_EXT_MAX_BYTES];
|
||||
|
||||
s=value;
|
||||
if(1==ucm_parseBytes(bytes, line, &s) && *s==0) {
|
||||
if(1==ucm_parseBytes(bytes, line, (const char **)&s) && *s==0) {
|
||||
staticData->subChar1=bytes[0];
|
||||
} else {
|
||||
fprintf(stderr, "error: illegal <subchar1> %s\n", value);
|
||||
|
@ -631,8 +631,8 @@ ucm_mergeTables(UCMTable *fromUTable, UCMTable *toUTable,
|
||||
* fallback Unicode->codepage
|
||||
*/
|
||||
if( (fromUMapping->bLen==subcharLength &&
|
||||
0==uprv_memcmp(UCM_GET_BYTES(fromUTable, fromUMapping), subchar, subcharLength) ||
|
||||
(subchar1!=0 && fromUMapping->bLen==1 && fromUMapping->b.bytes[0]==subchar1))
|
||||
0==uprv_memcmp(UCM_GET_BYTES(fromUTable, fromUMapping), subchar, subcharLength)) ||
|
||||
(subchar1!=0 && fromUMapping->bLen==1 && fromUMapping->b.bytes[0]==subchar1)
|
||||
) {
|
||||
fromUMapping->f=2; /* SUB mapping */
|
||||
} else {
|
||||
@ -665,8 +665,8 @@ ucm_mergeTables(UCMTable *fromUTable, UCMTable *toUTable,
|
||||
while(fromUIndex<fromUTop) {
|
||||
/* leftover fromU mappings are fallbacks */
|
||||
if( (fromUMapping->bLen==subcharLength &&
|
||||
0==uprv_memcmp(UCM_GET_BYTES(fromUTable, fromUMapping), subchar, subcharLength) ||
|
||||
(subchar1!=0 && fromUMapping->bLen==1 && fromUMapping->b.bytes[0]==subchar1))
|
||||
0==uprv_memcmp(UCM_GET_BYTES(fromUTable, fromUMapping), subchar, subcharLength)) ||
|
||||
(subchar1!=0 && fromUMapping->bLen==1 && fromUMapping->b.bytes[0]==subchar1)
|
||||
) {
|
||||
fromUMapping->f=2; /* SUB mapping */
|
||||
} else {
|
||||
|
@ -1025,7 +1025,7 @@ ucm_countChars(UCMStates *states,
|
||||
}
|
||||
|
||||
if(offset!=0) {
|
||||
fprintf(stderr, "ucm error: byte sequence too short, ends in non-final state %hu: 0x%02lx\n", state);
|
||||
fprintf(stderr, "ucm error: byte sequence too short, ends in non-final state %hu\n", state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user