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:
parent
45ff4e6b21
commit
a17a3994ec
@ -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<const char *>(tmp_buf), strlen(tmp_buf)).Error())
|
||||
{
|
||||
m_lastError = wxPROTO_NETERR;
|
||||
return 0;
|
||||
|
@ -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<const unsigned char *>(static_cast<const char *>(strbuf));
|
||||
if(!p)
|
||||
{
|
||||
// String couldn't be converted which used to SEGV as reported here:
|
||||
|
Loading…
Reference in New Issue
Block a user