Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
This commit is contained in:
@@ -2641,7 +2641,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename),
|
||||
#if HAS_FILE_STREAMS
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
const_cast<wxImage*>(this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
|
||||
wxImageFileOutputStream stream(filename);
|
||||
|
||||
@@ -2661,7 +2661,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename),
|
||||
#if HAS_FILE_STREAMS
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
const_cast<wxImage*>(this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
|
||||
wxImageFileOutputStream stream(filename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user