From 32b40e3ee27d727a846922a7b627dcd019d7d2f5 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Tue, 8 Jun 2010 21:13:54 +0000 Subject: [PATCH] ICU-7586 fix some initializer warnings X-SVN-Rev: 28157 --- icu4c/source/common/ucol_swp.cpp | 3 ++- icu4c/source/common/utrie2.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/ucol_swp.cpp b/icu4c/source/common/ucol_swp.cpp index dce23cbd77b..cf4d5519b3e 100644 --- a/icu4c/source/common/ucol_swp.cpp +++ b/icu4c/source/common/ucol_swp.cpp @@ -108,7 +108,7 @@ ucol_looksLikeCollationBinary(const UDataSwapper *ds, const void *inData, int32_t length) { const uint8_t *inBytes; const UCATableHeader *inHeader; - UCATableHeader header={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, 0 }; + UCATableHeader header; if(ds==NULL || inData==NULL || length<-1) { return FALSE; @@ -123,6 +123,7 @@ ucol_looksLikeCollationBinary(const UDataSwapper *ds, * sizeof(UCATableHeader)==42*4 in ICU 2.8 * check the length against the header size before reading the size field */ + uprv_memset(&header, 0, sizeof(header)); if(length<0) { header.size=udata_readInt32(ds, inHeader->size); } else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) { diff --git a/icu4c/source/common/utrie2.cpp b/icu4c/source/common/utrie2.cpp index 3e051bab4b7..f2da4e9844a 100644 --- a/icu4c/source/common/utrie2.cpp +++ b/icu4c/source/common/utrie2.cpp @@ -128,7 +128,7 @@ utrie2_openFromSerialized(UTrie2ValueBits valueBits, const uint16_t *p16; int32_t actualLength; - UTrie2 tempTrie={ NULL }; + UTrie2 tempTrie; UTrie2 *trie; if(U_FAILURE(*pErrorCode)) { @@ -162,6 +162,7 @@ utrie2_openFromSerialized(UTrie2ValueBits valueBits, } /* get the length values and offsets */ + uprv_memset(&tempTrie, 0, sizeof(tempTrie)); tempTrie.indexLength=header->indexLength; tempTrie.dataLength=header->shiftedDataLength<index2NullOffset;