Get rid of a use of wxMBSTRINGCAST

wxMBSTRINGCAST is a const-removing cast and therefore should be avoided
unless necessary.

Here, the cast was used to convert wxWX2MBbuf to const char *, which does not
involve removing const-ness.
This commit is contained in:
ARATA Mizuki
2016-02-18 00:29:06 +09:00
parent 45ff4e6b21
commit a17a3994ec
2 changed files with 2 additions and 2 deletions

View File

@@ -237,7 +237,7 @@ char wxFTP::SendCommand(const wxString& command)
wxString tmp_str = command + wxT("\r\n"); wxString tmp_str = command + wxT("\r\n");
const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); const wxWX2MBbuf tmp_buf = tmp_str.mb_str();
if ( Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) if ( Write(static_cast<const char *>(tmp_buf), strlen(tmp_buf)).Error())
{ {
m_lastError = wxPROTO_NETERR; m_lastError = wxPROTO_NETERR;
return 0; return 0;

View File

@@ -2336,7 +2336,7 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string,
long sum=0; long sum=0;
float height=fontSize; /* by default */ float height=fontSize; /* by default */
unsigned char *p=(unsigned char *)wxMBSTRINGCAST strbuf; const unsigned char *p=reinterpret_cast<const unsigned char *>(static_cast<const char *>(strbuf));
if(!p) if(!p)
{ {
// String couldn't be converted which used to SEGV as reported here: // String couldn't be converted which used to SEGV as reported here: