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:
@@ -637,7 +637,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
pg->OnComboItemPaint( this, item, &dc, (wxRect&)rect, flags );
|
||||
wxRect r(rect);
|
||||
pg->OnComboItemPaint(this, item, &dc, r, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2201,7 +2201,7 @@ private:
|
||||
|
||||
wxPGVIterator wxPropertyGridManager::GetVIterator( int flags ) const
|
||||
{
|
||||
return wxPGVIterator( new wxPGVIteratorBase_Manager( (wxPropertyGridManager*)this, flags ) );
|
||||
return wxPGVIterator(new wxPGVIteratorBase_Manager(const_cast<wxPropertyGridManager*>(this), flags));
|
||||
}
|
||||
|
||||
#endif // wxUSE_PROPGRID
|
||||
|
@@ -1936,7 +1936,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect,
|
||||
// Hopefully this does not cause problems.
|
||||
#if (wxPG_USE_RENDERER_NATIVE)
|
||||
wxRendererNative::Get().DrawTreeItemButton(
|
||||
(wxWindow*)this,
|
||||
const_cast<wxPropertyGrid*>(this),
|
||||
dc,
|
||||
r,
|
||||
wxCONTROL_EXPANDED
|
||||
@@ -1952,7 +1952,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect,
|
||||
{
|
||||
#if (wxPG_USE_RENDERER_NATIVE)
|
||||
wxRendererNative::Get().DrawTreeItemButton(
|
||||
(wxWindow*)this,
|
||||
const_cast<wxPropertyGrid*>(this),
|
||||
dc,
|
||||
r,
|
||||
0
|
||||
|
@@ -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++ )
|
||||
|
Reference in New Issue
Block a user