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:
Paul Cornett
2020-02-02 22:50:32 -08:00
parent 6724f8c052
commit 948ddc6e0f
115 changed files with 273 additions and 303 deletions

View File

@@ -432,7 +432,7 @@ wxPropertyCategory* wxPropertyGridPageState::GetPropertyCategory( const wxPGProp
parent = grandparent;
grandparent = parent->GetParent();
if ( parent->IsCategory() && grandparent )
return (wxPropertyCategory*)parent;
return const_cast<wxPropertyCategory*>(static_cast<const wxPropertyCategory*>(parent));
} while ( grandparent );
return NULL;
@@ -451,11 +451,11 @@ wxPGProperty* wxPropertyGridPageState::GetPropertyByLabel
#endif // WXWIN_COMPATIBILITY_3_0
wxPGProperty* wxPropertyGridPageState::BaseGetPropertyByLabel
( const wxString& label, wxPGProperty* parent ) const
( const wxString& label, const wxPGProperty* parent ) const
{
if ( !parent )
{
parent = (wxPGProperty*) &m_regularArray;
parent = &m_regularArray;
}
for ( size_t i=0; i<parent->GetChildCount(); i++ )