From 5ab57de77d8cbf1584c911a5babe6f8915e29c0d Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 27 Mar 2000 18:34:35 +0000 Subject: [PATCH] Compile bug for unsuitable method in MB2WC and WX2MB procs. VA only git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 307eff37a7..41b84f06f1 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -64,27 +64,27 @@ size_t wxMBConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const const wxWCharBuffer wxMBConv::cMB2WC(const char *psz) const { - if (psz) + if (psz) { size_t nLen = MB2WC((wchar_t *) NULL, psz, 0); wxWCharBuffer buf(nLen); MB2WC((wchar_t *)(const wchar_t *) buf, psz, nLen); return buf; - } - else + } + else return wxWCharBuffer((wchar_t *) NULL); } const wxCharBuffer wxMBConv::cWC2MB(const wchar_t *psz) const { - if (psz) + if (psz) { size_t nLen = WC2MB((char *) NULL, psz, 0); wxCharBuffer buf(nLen); WC2MB((char *)(const char *) buf, psz, nLen); return buf; - } - else + } + else return wxCharBuffer((char *) NULL); } @@ -321,7 +321,11 @@ size_t wxCSConv::MB2WC(wchar_t *buf, const char *psz, size_t n) const ((wxCSConv *)this)->LoadNow(); // discard constness if (buf) { if (m_cset) { +#if defined(__VISAGECPP__) + m_cset->m2w.Convert(psz, (wxChar*)buf); +#else m_cset->m2w.Convert(psz, buf); +#endif } else { // latin-1 (direct) for (size_t c=0; cLoadNow(); // discard constness if (buf) { if (m_cset) { +#if defined(__VISAGECPP__) + m_cset->w2m.Convert((wxChar*)psz, buf); +#else m_cset->w2m.Convert(psz, buf); +#endif } else { // latin-1 (direct) for (size_t c=0; c