]> git.saurik.com Git - wxWidgets.git/commitdiff
Unix compilation fixes after last commit
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 1 Apr 2006 13:38:28 +0000 (13:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 1 Apr 2006 13:38:28 +0000 (13:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/strconv.h
src/common/strconv.cpp

index ae701a15e58caff922d54bb8bc31f09cc26ca33e..53b74ca6ccd2c5faad32db8b14d49386d3d03a38 100644 (file)
@@ -134,9 +134,10 @@ public:
     }
 
 private:
-    virtual wxCharBuffer GetMBNul(size_t *nulLen) const
+    virtual const char *GetMBNul(size_t *nulLen) const
     {
-        return m_conv->GetMBNul(nulLen);
+        // cast needed to call a private function
+        return ((wxConvBrokenFileNames *)m_conv)->GetMBNul(nulLen);
     }
 
 
index dfc8a40dac7ebcc33598f13578af1e4e79f4e638..f52144b27533b7219ce1cf11ebefdac8a436392a 100644 (file)
@@ -214,11 +214,9 @@ wxMBConv::cMB2WC(const char *in, size_t inLen, size_t *outLen) const
         // not the most efficient algorithm but it shouldn't matter as normally
         // there are not many NULs in the string and so normally memcmp()
         // should stop on the first character
-        for ( const char *p = in; ; p++ )
-        {
-            if ( memcmp(p, nul, nulLen) == 0 )
-                break;
-        }
+        const char *p = in;
+        while ( memcmp(p, nul, nulLen) != 0 )
+            p++;
 
         inLen = p - in + nulLen;
     }
@@ -1658,7 +1656,7 @@ const char *wxMBConv_iconv::GetMBNul(size_t *nulLen) const
         size_t inLen = 1,
                outLen = WXSIZEOF(m_nulBuf);
         self->m_nulLen = iconv(w2m, ICONV_CHAR_CAST(L""), &inLen,
-                               &self->m_nulBuf, &outLen);
+                               (char **)&self->m_nulBuf, &outLen);
     }
 
     *nulLen = m_nulLen;