From a17a3994ecac1b06f35af547edd920d9fb08f225 Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Thu, 18 Feb 2016 00:29:06 +0900 Subject: [PATCH] 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. --- src/common/ftp.cpp | 2 +- src/generic/dcpsg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 4dca4bddc2..e253956890 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -237,7 +237,7 @@ char wxFTP::SendCommand(const wxString& command) wxString tmp_str = command + wxT("\r\n"); const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); - if ( Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) + if ( Write(static_cast(tmp_buf), strlen(tmp_buf)).Error()) { m_lastError = wxPROTO_NETERR; return 0; diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 32b6830eca..1754ac83a9 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -2336,7 +2336,7 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string, long sum=0; float height=fontSize; /* by default */ - unsigned char *p=(unsigned char *)wxMBSTRINGCAST strbuf; + const unsigned char *p=reinterpret_cast(static_cast(strbuf)); if(!p) { // String couldn't be converted which used to SEGV as reported here: