Make internal type for ToAscii conversion written once but do not forget all necessary type casts (aka warning fix).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1407,12 +1407,14 @@ const wxCharBuffer wxString::ToAscii() const
|
|||||||
// this will allocate enough space for the terminating NUL too
|
// this will allocate enough space for the terminating NUL too
|
||||||
wxCharBuffer buffer(length());
|
wxCharBuffer buffer(length());
|
||||||
|
|
||||||
signed char *dest = (signed char *)buffer.data();
|
#define LOCAL_DEST_TYPE signed char
|
||||||
|
|
||||||
|
LOCAL_DEST_TYPE *dest = (LOCAL_DEST_TYPE *)buffer.data();
|
||||||
|
|
||||||
const wchar_t *pwc = c_str();
|
const wchar_t *pwc = c_str();
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
*dest++ = *pwc > SCHAR_MAX ? wxT('_') : *pwc;
|
*dest++ = (LOCAL_DEST_TYPE)(*pwc > SCHAR_MAX ? wxT('_') : *pwc);
|
||||||
|
|
||||||
// the output string can't have embedded NULs anyhow, so we can safely
|
// the output string can't have embedded NULs anyhow, so we can safely
|
||||||
// stop at first of them even if we do have any
|
// stop at first of them even if we do have any
|
||||||
@@ -1420,6 +1422,8 @@ const wxCharBuffer wxString::ToAscii() const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef LOCAL_DEST_TYPE
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user