From: Steven R. Loomis Date: Tue, 20 Sep 2016 21:03:19 +0000 (+0000) Subject: ICU-11746 more warning cleanup X-Git-Tag: milestone-59-0-1~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a8a02cae1856090ecf2d1d097ec7454d8e6e38b;p=icu ICU-11746 more warning cleanup X-SVN-Rev: 39296 --- diff --git a/icu4c/source/common/propsvec.c b/icu4c/source/common/propsvec.c index 01fb5c93a5f..ed4d89954b8 100644 --- a/icu4c/source/common/propsvec.c +++ b/icu4c/source/common/propsvec.c @@ -479,7 +479,7 @@ upvec_cloneArray(const UPropsVectors *pv, U_CAPI UTrie2 * U_EXPORT2 upvec_compactToUTrie2WithRowIndexes(UPropsVectors *pv, UErrorCode *pErrorCode) { - UPVecToUTrie2Context toUTrie2={ NULL }; + UPVecToUTrie2Context toUTrie2={ NULL, 0, 0, 0 }; upvec_compact(pv, upvec_compactToUTrie2Handler, &toUTrie2, pErrorCode); utrie2_freeze(toUTrie2.trie, UTRIE2_16_VALUE_BITS, pErrorCode); if(U_FAILURE(*pErrorCode)) { diff --git a/icu4c/source/common/ucnv_u16.c b/icu4c/source/common/ucnv_u16.c index 5947ef2e12a..1458a8a4b32 100644 --- a/icu4c/source/common/ucnv_u16.c +++ b/icu4c/source/common/ucnv_u16.c @@ -623,7 +623,10 @@ static const UConverterImpl _UTF16BEImpl={ _UTF16BEGetName, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; static const UConverterStaticData _UTF16BEStaticData={ @@ -1219,7 +1222,10 @@ static const UConverterImpl _UTF16LEImpl={ _UTF16LEGetName, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; @@ -1488,7 +1494,10 @@ static const UConverterImpl _UTF16Impl = { _UTF16GetName, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; static const UConverterStaticData _UTF16StaticData = { @@ -1530,7 +1539,10 @@ static const UConverterImpl _UTF16v2Impl = { _UTF16GetName, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; static const UConverterStaticData _UTF16v2StaticData = { diff --git a/icu4c/source/common/ucnv_u32.c b/icu4c/source/common/ucnv_u32.c index 62f2f93d4a9..b0a0fe28529 100644 --- a/icu4c/source/common/ucnv_u32.c +++ b/icu4c/source/common/ucnv_u32.c @@ -482,7 +482,10 @@ static const UConverterImpl _UTF32BEImpl = { NULL, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; /* The 1232 CCSID refers to any version of Unicode with any endianess of UTF-32 */ @@ -974,7 +977,10 @@ static const UConverterImpl _UTF32LEImpl = { NULL, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; /* The 1232 CCSID refers to any version of Unicode with any endianess of UTF-32 */ @@ -1216,7 +1222,10 @@ static const UConverterImpl _UTF32Impl = { NULL, NULL, NULL, - ucnv_getNonSurrogateUnicodeSet + ucnv_getNonSurrogateUnicodeSet, + + NULL, + NULL }; /* The 1236 CCSID refers to any version of Unicode with a BOM sensitive endianess of UTF-32 */ diff --git a/icu4c/source/common/ucnv_u7.c b/icu4c/source/common/ucnv_u7.c index c381c7686aa..c3b4d74b9a9 100644 --- a/icu4c/source/common/ucnv_u7.c +++ b/icu4c/source/common/ucnv_u7.c @@ -762,7 +762,10 @@ static const UConverterImpl _UTF7Impl={ _UTF7GetName, NULL, /* we don't need writeSub() because we never call a callback at fromUnicode() */ NULL, - ucnv_getCompleteUnicodeSet + ucnv_getCompleteUnicodeSet, + + NULL, + NULL }; static const UConverterStaticData _UTF7StaticData={ diff --git a/icu4c/source/common/ucnv_u8.c b/icu4c/source/common/ucnv_u8.c index dd17dcebe5f..0258347aeb1 100644 --- a/icu4c/source/common/ucnv_u8.c +++ b/icu4c/source/common/ucnv_u8.c @@ -1074,7 +1074,10 @@ static const UConverterImpl _CESU8Impl={ NULL, NULL, NULL, - ucnv_getCompleteUnicodeSet + ucnv_getCompleteUnicodeSet, + + NULL, + NULL }; static const UConverterStaticData _CESU8StaticData={ diff --git a/icu4c/source/common/udataswp.c b/icu4c/source/common/udataswp.c index 94181ade507..f47ac1f5e06 100644 --- a/icu4c/source/common/udataswp.c +++ b/icu4c/source/common/udataswp.c @@ -300,7 +300,7 @@ udata_swapDataHeader(const UDataSwapper *ds, /* check minimum length and magic bytes */ pHeader=(const DataHeader *)inData; - if( (length>=0 && length=0 && length<(int32_t)sizeof(DataHeader)) || pHeader->dataHeader.magic1!=0xda || pHeader->dataHeader.magic2!=0x27 || pHeader->info.sizeofUChar!=2 @@ -427,7 +427,7 @@ udata_openSwapperForInputData(const void *data, int32_t length, return NULL; } if( data==NULL || - (length>=0 && length=0 && length<(int32_t)sizeof(DataHeader)) || outCharset>U_EBCDIC_FAMILY ) { *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; diff --git a/icu4c/source/io/sprintf.c b/icu4c/source/io/sprintf.c index 59fd89c4924..ff143deb288 100644 --- a/icu4c/source/io/sprintf.c +++ b/icu4c/source/io/sprintf.c @@ -181,7 +181,7 @@ u_vsnprintf(UChar *buffer, int32_t size = (int32_t)strlen(patternSpecification) + 1; /* convert from the default codepage to Unicode */ - if (size >= MAX_UCHAR_BUFFER_SIZE(patBuffer)) { + if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) { pattern = (UChar *)uprv_malloc(size * sizeof(UChar)); if(pattern == 0) { return 0; diff --git a/icu4c/source/io/sscanf.c b/icu4c/source/io/sscanf.c index 51f80f182a7..31ad8965fc2 100644 --- a/icu4c/source/io/sscanf.c +++ b/icu4c/source/io/sscanf.c @@ -73,7 +73,7 @@ u_vsscanf(const UChar *buffer, int32_t size = (int32_t)uprv_strlen(patternSpecification) + 1; /* convert from the default codepage to Unicode */ - if (size >= MAX_UCHAR_BUFFER_SIZE(patBuffer)) { + if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) { pattern = (UChar *)uprv_malloc(size * sizeof(UChar)); if(pattern == 0) { return 0; diff --git a/icu4c/source/tools/toolutil/flagparser.c b/icu4c/source/tools/toolutil/flagparser.c index 230466ebc71..0ffc3715bfd 100644 --- a/icu4c/source/tools/toolutil/flagparser.c +++ b/icu4c/source/tools/toolutil/flagparser.c @@ -63,7 +63,7 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, continue; } - if (uprv_strlen(buffer) == (currentBufferSize - 1) && buffer[currentBufferSize-2] != '\n') { + if ((int32_t)uprv_strlen(buffer) == (currentBufferSize - 1) && buffer[currentBufferSize-2] != '\n') { /* Allocate more space for buffer if it didnot read the entrire line */ allocateMoreSpace = TRUE; T_FileStream_rewind(f); diff --git a/icu4c/source/tools/toolutil/ucm.c b/icu4c/source/tools/toolutil/ucm.c index afdcb92a954..8d4cdfc40f1 100644 --- a/icu4c/source/tools/toolutil/ucm.c +++ b/icu4c/source/tools/toolutil/ucm.c @@ -1126,7 +1126,7 @@ ucm_addMappingAuto(UCMFile *ucm, UBool forBase, UCMStates *baseStates, U_CAPI UBool U_EXPORT2 ucm_addMappingFromLine(UCMFile *ucm, const char *line, UBool forBase, UCMStates *baseStates) { - UCMapping m={ 0 }; + UCMapping m={ 0, {0}, 0, 0, 0, 0 }; UChar32 codePoints[UCNV_EXT_MAX_UCHARS]; uint8_t bytes[UCNV_EXT_MAX_BYTES]; diff --git a/icu4c/source/tools/toolutil/unewdata.c b/icu4c/source/tools/toolutil/unewdata.c index fbf1124811e..0fb9d439c36 100644 --- a/icu4c/source/tools/toolutil/unewdata.c +++ b/icu4c/source/tools/toolutil/unewdata.c @@ -41,7 +41,7 @@ udata_create(const char *dir, const char *type, const char *name, uint16_t headerSize, commentLength; char filename[512]; uint8_t bytes[16]; - int length; + int32_t length; if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { return NULL; @@ -76,7 +76,7 @@ udata_create(const char *dir, const char *type, const char *name, /* LDH buffer Length error check */ - if(length > (sizeof(filename) - 1)) + if(length > ((int32_t)sizeof(filename) - 1)) { *pErrorCode = U_BUFFER_OVERFLOW_ERROR; uprv_free(pData);