Initialize variable in UTF{16,32} conversion code to avoid warnings.
In optimized build g++ warned about the second element of two-element array passed to encode_utf16() being possibly uninitialized. This wasn't really the case but change the code just to avoid the warnings. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1645,7 +1645,7 @@ wxMBConvUTF16straight::FromWChar(char *dst, size_t dstLen,
|
||||
wxUint16 *outBuff = reinterpret_cast<wxUint16 *>(dst);
|
||||
for ( size_t n = 0; n < srcLen; n++ )
|
||||
{
|
||||
wxUint16 cc[2];
|
||||
wxUint16 cc[2] = { 0 };
|
||||
const size_t numChars = encode_utf16(*src++, cc);
|
||||
if ( numChars == wxCONV_FAILED )
|
||||
return wxCONV_FAILED;
|
||||
@@ -1728,7 +1728,7 @@ wxMBConvUTF16swap::FromWChar(char *dst, size_t dstLen,
|
||||
wxUint16 *outBuff = reinterpret_cast<wxUint16 *>(dst);
|
||||
for ( const wchar_t *srcEnd = src + srcLen; src < srcEnd; src++ )
|
||||
{
|
||||
wxUint16 cc[2];
|
||||
wxUint16 cc[2] = { 0 };
|
||||
const size_t numChars = encode_utf16(*src, cc);
|
||||
if ( numChars == wxCONV_FAILED )
|
||||
return wxCONV_FAILED;
|
||||
@@ -1812,7 +1812,7 @@ wxMBConvUTF32straight::ToWChar(wchar_t *dst, size_t dstLen,
|
||||
size_t outLen = 0;
|
||||
for ( size_t n = 0; n < inLen; n++ )
|
||||
{
|
||||
wxUint16 cc[2];
|
||||
wxUint16 cc[2] = { 0 };
|
||||
const size_t numChars = encode_utf16(*inBuff++, cc);
|
||||
if ( numChars == wxCONV_FAILED )
|
||||
return wxCONV_FAILED;
|
||||
@@ -1890,7 +1890,7 @@ wxMBConvUTF32swap::ToWChar(wchar_t *dst, size_t dstLen,
|
||||
size_t outLen = 0;
|
||||
for ( size_t n = 0; n < inLen; n++, inBuff++ )
|
||||
{
|
||||
wxUint16 cc[2];
|
||||
wxUint16 cc[2] = { 0 };
|
||||
const size_t numChars = encode_utf16(wxUINT32_SWAP_ALWAYS(*inBuff), cc);
|
||||
if ( numChars == wxCONV_FAILED )
|
||||
return wxCONV_FAILED;
|
||||
|
Reference in New Issue
Block a user