Avoid cast from const_iterator to iterator
The standard library requires iterators passed to functions that modify the container to be mutable iterators, but GCC's implementation accepts const_iterator in some places where these are only used to mark a place, but the actual modification happens through a different parameter. As this breaks implementations that use the passed iterator to modify the container (e.g. because they use a different data organization), this is not portable; because we already have a non-const reference to the container anyway, this is trivially fixed as well.
This commit is contained in:
parent
ff4febc7a8
commit
da9ca2def2
|
@ -985,7 +985,7 @@ bool VIEW::areRequiredLayersEnabled( int aLayerId ) const
|
||||||
{
|
{
|
||||||
wxASSERT( (unsigned) aLayerId < m_layers.size() );
|
wxASSERT( (unsigned) aLayerId < m_layers.size() );
|
||||||
|
|
||||||
std::set<int>::iterator it, it_end;
|
std::set<int>::const_iterator it, it_end;
|
||||||
|
|
||||||
for( it = m_layers.at( aLayerId ).requiredLayers.begin(),
|
for( it = m_layers.at( aLayerId ).requiredLayers.begin(),
|
||||||
it_end = m_layers.at( aLayerId ).requiredLayers.end(); it != it_end; ++it )
|
it_end = m_layers.at( aLayerId ).requiredLayers.end(); it != it_end; ++it )
|
||||||
|
|
|
@ -65,7 +65,7 @@ static const wxString traceFootprintLibrary( wxT( "KicadFootprintLib" ) );
|
||||||
///> Removes empty nets (i.e. with node count equal zero) from net classes
|
///> Removes empty nets (i.e. with node count equal zero) from net classes
|
||||||
void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass )
|
void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass )
|
||||||
{
|
{
|
||||||
for( NETCLASS::const_iterator it = aNetClass.begin(); it != aNetClass.end(); )
|
for( NETCLASS::iterator it = aNetClass.begin(); it != aNetClass.end(); )
|
||||||
{
|
{
|
||||||
NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
|
NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
|
||||||
|
|
||||||
|
|
|
@ -481,7 +481,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
delta = cursorPos - firstItem->GetPosition();
|
delta = cursorPos - firstItem->GetPosition();
|
||||||
|
|
||||||
for( KIGFX::VIEW_GROUP::iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
for( KIGFX::VIEW_GROUP::const_iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
||||||
static_cast<BOARD_ITEM*>( *it )->Move( wxPoint( delta.x, delta.y ) );
|
static_cast<BOARD_ITEM*>( *it )->Move( wxPoint( delta.x, delta.y ) );
|
||||||
|
|
||||||
preview.ViewUpdate();
|
preview.ViewUpdate();
|
||||||
|
@ -491,7 +491,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
|
if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
|
||||||
{
|
{
|
||||||
for( KIGFX::VIEW_GROUP::iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
for( KIGFX::VIEW_GROUP::const_iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
||||||
static_cast<BOARD_ITEM*>( *it )->Rotate( wxPoint( cursorPos.x, cursorPos.y ),
|
static_cast<BOARD_ITEM*>( *it )->Rotate( wxPoint( cursorPos.x, cursorPos.y ),
|
||||||
m_frame->GetRotationAngle() );
|
m_frame->GetRotationAngle() );
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
|
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
|
||||||
{
|
{
|
||||||
for( KIGFX::VIEW_GROUP::iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
for( KIGFX::VIEW_GROUP::const_iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
||||||
static_cast<BOARD_ITEM*>( *it )->Flip( wxPoint( cursorPos.x, cursorPos.y ) );
|
static_cast<BOARD_ITEM*>( *it )->Flip( wxPoint( cursorPos.x, cursorPos.y ) );
|
||||||
|
|
||||||
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
|
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
|
||||||
|
@ -520,7 +520,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT );
|
m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT );
|
||||||
m_board->m_Modules->SetLastEditTime();
|
m_board->m_Modules->SetLastEditTime();
|
||||||
|
|
||||||
for( KIGFX::VIEW_GROUP::iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
for( KIGFX::VIEW_GROUP::const_iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( *it );
|
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( *it );
|
||||||
BOARD_ITEM* converted = NULL;
|
BOARD_ITEM* converted = NULL;
|
||||||
|
@ -561,7 +561,7 @@ int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
PICKED_ITEMS_LIST picklist;
|
PICKED_ITEMS_LIST picklist;
|
||||||
|
|
||||||
for( KIGFX::VIEW_GROUP::iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
for( KIGFX::VIEW_GROUP::const_iter it = preview.Begin(), end = preview.End(); it != end; ++it )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( *it );
|
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( *it );
|
||||||
m_board->Add( item );
|
m_board->Add( item );
|
||||||
|
|
Loading…
Reference in New Issue