Replace BOOST_FOREACH with C++11 range based for.

This commit is contained in:
Simon Richter 2016-06-29 16:07:55 -04:00 committed by Wayne Stambaugh
parent da5699de0a
commit 1b2fd6a382
74 changed files with 284 additions and 366 deletions

View File

@ -37,15 +37,13 @@
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <boost/foreach.hpp>
void wxConfigLoadParams( wxConfigBase* aCfg, void wxConfigLoadParams( wxConfigBase* aCfg,
const PARAM_CFG_ARRAY& aList, const wxString& aGroup ) const PARAM_CFG_ARRAY& aList, const wxString& aGroup )
{ {
wxASSERT( aCfg ); wxASSERT( aCfg );
BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) for( const PARAM_CFG_BASE& param : aList )
{ {
if( !!param.m_Group ) if( !!param.m_Group )
aCfg->SetPath( param.m_Group ); aCfg->SetPath( param.m_Group );
@ -64,7 +62,7 @@ void wxConfigLoadSetups( wxConfigBase* aCfg, const PARAM_CFG_ARRAY& aList )
{ {
wxASSERT( aCfg ); wxASSERT( aCfg );
BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) for( const PARAM_CFG_BASE& param : aList )
{ {
if( !param.m_Setup ) if( !param.m_Setup )
continue; continue;
@ -79,7 +77,7 @@ void wxConfigSaveParams( wxConfigBase* aCfg,
{ {
wxASSERT( aCfg ); wxASSERT( aCfg );
BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) for( const PARAM_CFG_BASE& param : aList )
{ {
if( !!param.m_Group ) if( !!param.m_Group )
aCfg->SetPath( param.m_Group ); aCfg->SetPath( param.m_Group );
@ -106,7 +104,7 @@ void wxConfigSaveSetups( wxConfigBase* aCfg, const PARAM_CFG_ARRAY& aList )
{ {
wxASSERT( aCfg ); wxASSERT( aCfg );
BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) for( const PARAM_CFG_BASE& param : aList )
{ {
if( !param.m_Setup ) if( !param.m_Setup )
continue; continue;

View File

@ -22,7 +22,7 @@
#include "wx_html_report_panel.h" #include "wx_html_report_panel.h"
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <boost/foreach.hpp>
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent, WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
wxWindowID id, wxWindowID id,
@ -103,7 +103,7 @@ void WX_HTML_REPORT_PANEL::refreshView()
{ {
wxString html; wxString html;
BOOST_FOREACH( REPORT_LINE l, m_report ) for( REPORT_LINE l : m_report )
{ {
html += generateHtml( l ); html += generateHtml( l );
} }
@ -260,7 +260,7 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event )
return; return;
} }
BOOST_FOREACH( REPORT_LINE l, m_report ) for( REPORT_LINE l : m_report )
{ {
f.Write( generatePlainText( l ) ); f.Write( generatePlainText( l ) );
} }

View File

@ -39,7 +39,6 @@
#include <tool/tool_dispatcher.h> #include <tool/tool_dispatcher.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <boost/foreach.hpp>
#ifdef PROFILE #ifdef PROFILE
#include <profile.h> #include <profile.h>
@ -95,7 +94,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE
}; };
BOOST_FOREACH( wxEventType eventType, events ) for( wxEventType eventType : events )
{ {
Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ),
NULL, m_eventDispatcher ); NULL, m_eventDispatcher );
@ -260,7 +259,7 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
if( m_eventDispatcher ) if( m_eventDispatcher )
{ {
BOOST_FOREACH( wxEventType type, eventTypes ) for( wxEventType type : eventTypes )
{ {
m_parent->Connect( type, wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ), m_parent->Connect( type, wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ),
NULL, m_eventDispatcher ); NULL, m_eventDispatcher );
@ -268,7 +267,7 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
} }
else else
{ {
BOOST_FOREACH( wxEventType type, eventTypes ) for( wxEventType type : eventTypes )
{ {
// While loop is used to be sure that all event handlers are removed. // While loop is used to be sure that all event handlers are removed.
while( m_parent->Disconnect( type, while( m_parent->Disconnect( type,

View File

@ -266,7 +266,7 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName )
if( aFootprintName.IsEmpty() ) if( aFootprintName.IsEmpty() )
return NULL; return NULL;
BOOST_FOREACH( FOOTPRINT_INFO& fp, m_list ) for( FOOTPRINT_INFO& fp : m_list )
{ {
FPID fpid; FPID fpid;

View File

@ -45,7 +45,6 @@
#include <algorithm> #include <algorithm>
#include <fstream> #include <fstream>
#include <limits> #include <limits>
#include <boost/foreach.hpp>
#include <class_board_connected_item.h> #include <class_board_connected_item.h>
#include <memory> #include <memory>
@ -60,7 +59,7 @@ void NODE::updateLayers()
{ {
assert( m_layers.none() ); assert( m_layers.none() );
BOOST_FOREACH( const BOARD_CONNECTED_ITEM* item, m_parents ) for( const BOARD_CONNECTED_ITEM* item : m_parents )
m_layers |= item->GetLayerSet(); m_layers |= item->GetLayerSet();
} }
@ -329,7 +328,7 @@ bool TRIANGULATION::removeLeadingEdgeFromList( EDGE_PTR& aLeadingEdge )
void TRIANGULATION::cleanAll() void TRIANGULATION::cleanAll()
{ {
BOOST_FOREACH( EDGE_PTR& edge, m_leadingEdges ) for( EDGE_PTR& edge : m_leadingEdges )
edge->SetNextEdgeInFace( EDGE_PTR() ); edge->SetNextEdgeInFace( EDGE_PTR() );
} }

View File

@ -32,8 +32,6 @@
#include <list> #include <list>
#include <algorithm> #include <algorithm>
#include <boost/foreach.hpp>
#include <geometry/shape.h> #include <geometry/shape.h>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
@ -214,13 +212,13 @@ void SHAPE_POLY_SET::booleanOp( ClipType aType, const SHAPE_POLY_SET& aOtherShap
if( aFastMode == PM_STRICTLY_SIMPLE ) if( aFastMode == PM_STRICTLY_SIMPLE )
c.StrictlySimple( true ); c.StrictlySimple( true );
BOOST_FOREACH( const POLYGON& poly, m_polys ) for( const POLYGON& poly : m_polys )
{ {
for( unsigned int i = 0; i < poly.size(); i++ ) for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true ); c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
} }
BOOST_FOREACH( const POLYGON& poly, aOtherShape.m_polys ) for( const POLYGON& poly : aOtherShape.m_polys )
{ {
for( unsigned int i = 0; i < poly.size(); i++ ) for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true ); c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
@ -244,13 +242,13 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType,
if( aFastMode == PM_STRICTLY_SIMPLE ) if( aFastMode == PM_STRICTLY_SIMPLE )
c.StrictlySimple( true ); c.StrictlySimple( true );
BOOST_FOREACH( const POLYGON& poly, aShape.m_polys ) for( const POLYGON& poly : aShape.m_polys )
{ {
for( unsigned int i = 0; i < poly.size(); i++ ) for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true ); c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
} }
BOOST_FOREACH( const POLYGON& poly, aOtherShape.m_polys ) for( const POLYGON& poly : aOtherShape.m_polys )
{ {
for( unsigned int i = 0; i < poly.size(); i++ ) for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true ); c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
@ -310,7 +308,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
ClipperOffset c; ClipperOffset c;
BOOST_FOREACH( const POLYGON& poly, m_polys ) for( const POLYGON& poly : m_polys )
{ {
for( unsigned int i = 0; i < poly.size(); i++ ) for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), jtRound, etClosedPolygon ); c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), jtRound, etClosedPolygon );
@ -488,7 +486,7 @@ void SHAPE_POLY_SET::fractureSingle( POLYGON& paths )
int num_unconnected = 0; int num_unconnected = 0;
BOOST_FOREACH( SHAPE_LINE_CHAIN& path, paths ) for( SHAPE_LINE_CHAIN& path : paths )
{ {
int index = 0; int index = 0;
@ -580,7 +578,7 @@ void SHAPE_POLY_SET::Fracture( POLYGON_MODE aFastMode )
{ {
Simplify( aFastMode ); // remove overlapping holes/degeneracy Simplify( aFastMode ); // remove overlapping holes/degeneracy
BOOST_FOREACH( POLYGON& paths, m_polys ) for( POLYGON& paths : m_polys )
{ {
fractureSingle( paths ); fractureSingle( paths );
} }
@ -725,7 +723,7 @@ bool SHAPE_POLY_SET::Contains( const VECTOR2I& aP, int aSubpolyIndex ) const
if( aSubpolyIndex >= 0 ) if( aSubpolyIndex >= 0 )
return pointInPolygon( aP, m_polys[aSubpolyIndex][0] ); return pointInPolygon( aP, m_polys[aSubpolyIndex][0] );
BOOST_FOREACH ( const POLYGON& polys, m_polys ) for( const POLYGON& polys : m_polys )
{ {
if( polys.size() == 0 ) if( polys.size() == 0 )
continue; continue;
@ -805,9 +803,9 @@ bool SHAPE_POLY_SET::pointInPolygon( const VECTOR2I& aP, const SHAPE_LINE_CHAIN&
void SHAPE_POLY_SET::Move( const VECTOR2I& aVector ) void SHAPE_POLY_SET::Move( const VECTOR2I& aVector )
{ {
BOOST_FOREACH( POLYGON &poly, m_polys ) for( POLYGON &poly : m_polys )
{ {
BOOST_FOREACH( SHAPE_LINE_CHAIN &path, poly ) for( SHAPE_LINE_CHAIN &path : poly )
{ {
path.Move( aVector ); path.Move( aVector );
} }
@ -819,9 +817,9 @@ int SHAPE_POLY_SET::TotalVertices() const
{ {
int c = 0; int c = 0;
BOOST_FOREACH( const POLYGON& poly, m_polys ) for( const POLYGON& poly : m_polys )
{ {
BOOST_FOREACH ( const SHAPE_LINE_CHAIN& path, poly ) for( const SHAPE_LINE_CHAIN& path : poly )
{ {
c += path.PointCount(); c += path.PointCount();
} }

View File

@ -28,7 +28,6 @@
#include <draw_frame.h> #include <draw_frame.h>
#include <hotkeys_basic.h> #include <hotkeys_basic.h>
#include <boost/foreach.hpp>
#include <boost/range/adaptor/map.hpp> #include <boost/range/adaptor/map.hpp>
#include <cctype> #include <cctype>
#include <cassert> #include <cassert>
@ -39,7 +38,7 @@ ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) :
// Register known actions // Register known actions
std::list<TOOL_ACTION*>& actionList = GetActionList(); std::list<TOOL_ACTION*>& actionList = GetActionList();
BOOST_FOREACH( TOOL_ACTION* action, actionList ) for( TOOL_ACTION* action : actionList )
{ {
if( action->m_id == -1 ) if( action->m_id == -1 )
action->m_id = MakeActionId( action->m_name ); action->m_id = MakeActionId( action->m_name );
@ -140,7 +139,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const
const TOOL_ACTION* context = NULL; // pointer to context action of the highest priority tool const TOOL_ACTION* context = NULL; // pointer to context action of the highest priority tool
const TOOL_ACTION* global = NULL; // pointer to global action, if there is no context action const TOOL_ACTION* global = NULL; // pointer to global action, if there is no context action
BOOST_FOREACH( const TOOL_ACTION* action, actions ) for( const TOOL_ACTION* action : actions )
{ {
if( action->GetScope() == AS_GLOBAL ) if( action->GetScope() == AS_GLOBAL )
{ {
@ -198,7 +197,7 @@ void ACTION_MANAGER::UpdateHotKeys()
m_actionHotKeys.clear(); m_actionHotKeys.clear();
m_hotkeys.clear(); m_hotkeys.clear();
BOOST_FOREACH( TOOL_ACTION* action, m_actionNameIndex | boost::adaptors::map_values ) for( TOOL_ACTION* action : m_actionNameIndex | boost::adaptors::map_values )
{ {
int hotkey = processHotKey( action ); int hotkey = processHotKey( action );
@ -211,11 +210,11 @@ void ACTION_MANAGER::UpdateHotKeys()
#ifndef NDEBUG #ifndef NDEBUG
// Check if there are two global actions assigned to the same hotkey // Check if there are two global actions assigned to the same hotkey
BOOST_FOREACH( std::list<TOOL_ACTION*>& action_list, m_actionHotKeys | boost::adaptors::map_values ) for( std::list<TOOL_ACTION*>& action_list : m_actionHotKeys | boost::adaptors::map_values )
{ {
int global_actions_cnt = 0; int global_actions_cnt = 0;
BOOST_FOREACH( TOOL_ACTION* action, action_list ) for( TOOL_ACTION* action : action_list )
{ {
if( action->GetScope() == AS_GLOBAL ) if( action->GetScope() == AS_GLOBAL )
++global_actions_cnt; ++global_actions_cnt;

View File

@ -35,7 +35,6 @@
#include <pcbnew_id.h> #include <pcbnew_id.h>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/foreach.hpp>
///> Stores information about a mouse button state ///> Stores information about a mouse button state
struct TOOL_DISPATCHER::BUTTON_STATE struct TOOL_DISPATCHER::BUTTON_STATE
@ -131,14 +130,14 @@ TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr ) :
TOOL_DISPATCHER::~TOOL_DISPATCHER() TOOL_DISPATCHER::~TOOL_DISPATCHER()
{ {
BOOST_FOREACH( BUTTON_STATE* st, m_buttons ) for( BUTTON_STATE* st : m_buttons )
delete st; delete st;
} }
void TOOL_DISPATCHER::ResetState() void TOOL_DISPATCHER::ResetState()
{ {
BOOST_FOREACH( BUTTON_STATE* st, m_buttons ) for( BUTTON_STATE* st : m_buttons )
st->Reset(); st->Reset();
} }

View File

@ -29,7 +29,6 @@
#include <tool/tool_action.h> #include <tool/tool_action.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <boost/foreach.hpp>
struct FlagString struct FlagString
{ {
@ -155,7 +154,7 @@ const std::string TOOL_EVENT_LIST::Format() const
{ {
std::string s; std::string s;
BOOST_FOREACH( TOOL_EVENT e, m_events ) for( TOOL_EVENT e : m_events )
s += e.Format() + " "; s += e.Format() + " ";
return s; return s;

View File

@ -28,7 +28,6 @@
#include <stack> #include <stack>
#include <algorithm> #include <algorithm>
#include <boost/foreach.hpp>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/range/adaptor/map.hpp> #include <boost/range/adaptor/map.hpp>
@ -434,7 +433,7 @@ void TOOL_MANAGER::ResetTools( TOOL_BASE::RESET_REASON aReason )
TOOL_EVENT evt( TC_COMMAND, TA_ACTIVATE, "" ); // deactivate the active tool TOOL_EVENT evt( TC_COMMAND, TA_ACTIVATE, "" ); // deactivate the active tool
ProcessEvent( evt ); ProcessEvent( evt );
BOOST_FOREACH( TOOL_BASE* tool, m_toolState | boost::adaptors::map_keys ) for( TOOL_BASE* tool : m_toolState | boost::adaptors::map_keys )
{ {
tool->Reset( aReason ); tool->Reset( aReason );
tool->SetTransitions(); tool->SetTransitions();
@ -490,7 +489,7 @@ optional<TOOL_EVENT> TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool,
void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent ) void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
{ {
// iterate over all registered tools // iterate over all registered tools
BOOST_FOREACH( TOOL_ID toolId, m_activeTools ) for( TOOL_ID toolId : m_activeTools )
{ {
TOOL_STATE* st = m_toolIdIndex[toolId]; TOOL_STATE* st = m_toolIdIndex[toolId];
@ -518,13 +517,13 @@ void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
} }
} }
BOOST_FOREACH( TOOL_STATE* st, m_toolState | boost::adaptors::map_values ) for( TOOL_STATE* st : m_toolState | boost::adaptors::map_values )
{ {
// no state handler in progress - check if there are any transitions (defined by // no state handler in progress - check if there are any transitions (defined by
// Go() method that match the event. // Go() method that match the event.
if( !st->pendingWait && !st->transitions.empty() ) if( !st->pendingWait && !st->transitions.empty() )
{ {
BOOST_FOREACH( TRANSITION& tr, st->transitions ) for( TRANSITION& tr : st->transitions )
{ {
if( tr.first.Matches( aEvent ) ) if( tr.first.Matches( aEvent ) )
{ {
@ -584,7 +583,7 @@ bool TOOL_MANAGER::dispatchActivation( const TOOL_EVENT& aEvent )
void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent ) void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
{ {
BOOST_FOREACH( TOOL_ID toolId, m_activeTools ) for( TOOL_ID toolId : m_activeTools )
{ {
TOOL_STATE* st = m_toolIdIndex[toolId]; TOOL_STATE* st = m_toolIdIndex[toolId];

View File

@ -23,7 +23,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <boost/foreach.hpp>
#include <base_struct.h> #include <base_struct.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
@ -66,7 +65,7 @@ VIEW::VIEW( bool aIsDynamic ) :
VIEW::~VIEW() VIEW::~VIEW()
{ {
BOOST_FOREACH( LAYER_MAP::value_type& l, m_layers ) for( LAYER_MAP::value_type& l : m_layers )
delete l.second.items; delete l.second.items;
} }
@ -576,7 +575,7 @@ void VIEW::UpdateAllLayersOrder()
{ {
sortLayers(); sortLayers();
BOOST_FOREACH( LAYER_MAP::value_type& l, m_layers ) for( LAYER_MAP::value_type& l : m_layers )
{ {
ChangeLayerDepth( l.first, l.second.renderingOrder ); ChangeLayerDepth( l.first, l.second.renderingOrder );
} }
@ -612,7 +611,7 @@ struct VIEW::drawItem
void VIEW::redrawRect( const BOX2I& aRect ) void VIEW::redrawRect( const BOX2I& aRect )
{ {
BOOST_FOREACH( VIEW_LAYER* l, m_orderedLayers ) for( VIEW_LAYER* l : m_orderedLayers )
{ {
if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) ) if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) )
{ {
@ -727,7 +726,7 @@ void VIEW::Clear()
r.SetMaximum(); r.SetMaximum();
BOOST_FOREACH( VIEW_ITEM* item, m_needsUpdate ) for( VIEW_ITEM* item : m_needsUpdate )
item->clearUpdateFlags(); item->clearUpdateFlags();
m_needsUpdate.clear(); m_needsUpdate.clear();
@ -1015,7 +1014,7 @@ void VIEW::UpdateItems()
{ {
m_gal->BeginUpdate(); m_gal->BeginUpdate();
BOOST_FOREACH( VIEW_ITEM* item, m_needsUpdate ) for( VIEW_ITEM* item : m_needsUpdate )
{ {
assert( item->viewRequiredUpdate() != VIEW_ITEM::NONE ); assert( item->viewRequiredUpdate() != VIEW_ITEM::NONE );
@ -1054,7 +1053,7 @@ const BOX2I VIEW::CalculateExtents()
BOX2I fullScene; BOX2I fullScene;
fullScene.SetMaximum(); fullScene.SetMaximum();
BOOST_FOREACH( VIEW_LAYER* l, m_orderedLayers ) for( VIEW_LAYER* l : m_orderedLayers )
{ {
l->items->Query( fullScene, v ); l->items->Query( fullScene, v );
} }

View File

@ -36,7 +36,6 @@
#include <view/view.h> #include <view/view.h>
#include <painter.h> #include <painter.h>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <boost/foreach.hpp>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
using namespace KIGFX; using namespace KIGFX;
@ -91,7 +90,7 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
PAINTER* painter = m_view->GetPainter(); PAINTER* painter = m_view->GetPainter();
// Draw all items immediately (without caching) // Draw all items immediately (without caching)
BOOST_FOREACH( VIEW_ITEM* item, m_items ) for( VIEW_ITEM* item : m_items )
{ {
aGal->PushDepth(); aGal->PushDepth();
@ -125,7 +124,7 @@ void VIEW_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
void VIEW_GROUP::FreeItems() void VIEW_GROUP::FreeItems()
{ {
BOOST_FOREACH( VIEW_ITEM* item, m_items ) for( VIEW_ITEM* item : m_items )
{ {
delete item; delete item;
} }

View File

@ -32,7 +32,6 @@
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <painter.h> #include <painter.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <boost/foreach.hpp>
#include <class_page_info.h> #include <class_page_info.h>
using namespace KIGFX; using namespace KIGFX;
@ -160,7 +159,7 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_RECT* aItem, GAL* aGal ) const
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_POLYGON* aItem, GAL* aGal ) const void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_POLYGON* aItem, GAL* aGal ) const
{ {
std::deque<VECTOR2D> corners; std::deque<VECTOR2D> corners;
BOOST_FOREACH( wxPoint point, aItem->m_Corners ) for( wxPoint point : aItem->m_Corners )
{ {
corners.push_back( VECTOR2D( point ) ); corners.push_back( VECTOR2D( point ) );
} }

View File

@ -50,6 +50,8 @@
* 2. Round to a 50-mil grid coordinate if desired * 2. Round to a 50-mil grid coordinate if desired
*/ */
#include <boost/range/adaptor/reversed.hpp>
#include <schframe.h> #include <schframe.h>
#include <hotkeys_basic.h> #include <hotkeys_basic.h>
#include <sch_component.h> #include <sch_component.h>
@ -59,7 +61,6 @@
#include <class_libentry.h> #include <class_libentry.h>
#include <eeschema_config.h> #include <eeschema_config.h>
#include <kiface_i.h> #include <kiface_i.h>
#include <boost/foreach.hpp>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
@ -187,7 +188,7 @@ protected:
int max_field_width = 0; int max_field_width = 0;
int total_height = 0; int total_height = 0;
BOOST_FOREACH( SCH_FIELD* field, m_fields ) for( SCH_FIELD* field : m_fields )
{ {
int field_width; int field_width;
int field_height; int field_height;
@ -248,7 +249,7 @@ protected:
std::vector<LIB_PIN*> pins; std::vector<LIB_PIN*> pins;
m_component->GetPins( pins ); m_component->GetPins( pins );
BOOST_FOREACH( LIB_PIN* each_pin, pins ) for( LIB_PIN* each_pin : pins )
{ {
if( !each_pin->IsVisible() && !m_power_symbol ) if( !each_pin->IsVisible() && !m_power_symbol )
continue; continue;
@ -277,7 +278,7 @@ protected:
std::vector<SCH_FIELD*> fields; std::vector<SCH_FIELD*> fields;
comp->GetFields( fields, /* aVisibleOnly */ true ); comp->GetFields( fields, /* aVisibleOnly */ true );
BOOST_FOREACH( SCH_FIELD* field, fields ) for( SCH_FIELD* field : fields )
aItems.push_back( field ); aItems.push_back( field );
} }
aItems.push_back( item ); aItems.push_back( item );
@ -293,7 +294,7 @@ protected:
std::vector<SCH_ITEM*> filtered_colliders( const EDA_RECT& aRect ) std::vector<SCH_ITEM*> filtered_colliders( const EDA_RECT& aRect )
{ {
std::vector<SCH_ITEM*> filtered; std::vector<SCH_ITEM*> filtered;
BOOST_FOREACH( SCH_ITEM* item, m_colliders ) for( SCH_ITEM* item : m_colliders )
{ {
EDA_RECT item_box; EDA_RECT item_box;
if( SCH_COMPONENT* item_comp = dynamic_cast<SCH_COMPONENT*>( item ) ) if( SCH_COMPONENT* item_comp = dynamic_cast<SCH_COMPONENT*>( item ) )
@ -389,12 +390,12 @@ protected:
std::vector<SIDE_AND_COLL> colliding; std::vector<SIDE_AND_COLL> colliding;
// Iterate over all sides and find the ones that collide // Iterate over all sides and find the ones that collide
BOOST_FOREACH( SIDE side, sides ) for( SIDE side : sides )
{ {
EDA_RECT box( field_box_placement( side ), m_fbox_size ); EDA_RECT box( field_box_placement( side ), m_fbox_size );
COLLISION collision = COLLIDE_NONE; COLLISION collision = COLLIDE_NONE;
BOOST_FOREACH( SCH_ITEM* collider, filtered_colliders( box ) ) for( SCH_ITEM* collider : filtered_colliders( box ) )
{ {
SCH_LINE* line = dynamic_cast<SCH_LINE*>( collider ); SCH_LINE* line = dynamic_cast<SCH_LINE*>( collider );
if( line && !side.x ) if( line && !side.x )
@ -432,7 +433,7 @@ protected:
while( it != aSides.end() ) while( it != aSides.end() )
{ {
bool collide = false; bool collide = false;
BOOST_FOREACH( SIDE_AND_COLL collision, aCollidingSides ) for( SIDE_AND_COLL collision : aCollidingSides )
{ {
if( collision.side == it->side && collision.collision == aCollision ) if( collision.side == it->side && collision.collision == aCollision )
collide = true; collide = true;
@ -473,12 +474,12 @@ protected:
side = choose_side_filtered( sides, colliding_sides, COLLIDE_H_WIRES, side ); side = choose_side_filtered( sides, colliding_sides, COLLIDE_H_WIRES, side );
} }
BOOST_REVERSE_FOREACH( SIDE_AND_NPINS& each_side, sides ) for( SIDE_AND_NPINS& each_side : sides | boost::adaptors::reversed )
{ {
if( !each_side.pins ) return each_side.side; if( !each_side.pins ) return each_side.side;
} }
BOOST_FOREACH( SIDE_AND_NPINS& each_side, sides ) for( SIDE_AND_NPINS& each_side : sides )
{ {
if( each_side.pins <= side.pins ) if( each_side.pins <= side.pins )
{ {
@ -545,7 +546,7 @@ protected:
// Find the offset of the wires for proper positioning // Find the offset of the wires for proper positioning
int offset = 0; int offset = 0;
BOOST_FOREACH( SCH_ITEM* item, colliders ) for( SCH_ITEM* item : colliders )
{ {
SCH_LINE* line = dynamic_cast<SCH_LINE*>( item ); SCH_LINE* line = dynamic_cast<SCH_LINE*>( item );
if( !line ) if( !line )

View File

@ -49,7 +49,6 @@
#include <lib_rectangle.h> #include <lib_rectangle.h>
#include <lib_text.h> #include <lib_text.h>
#include <boost/foreach.hpp>
// the separator char between the subpart id and the reference // the separator char between the subpart id and the reference
// 0 (no separator) or '.' or some other character // 0 (no separator) or '.' or some other character
@ -224,7 +223,7 @@ LIB_PART::LIB_PART( LIB_PART& aPart, PART_LIB* aLibrary ) :
m_dateModified = aPart.m_dateModified; m_dateModified = aPart.m_dateModified;
m_options = aPart.m_options; m_options = aPart.m_options;
BOOST_FOREACH( LIB_ITEM& oldItem, aPart.GetDrawItemList() ) for( LIB_ITEM& oldItem : aPart.GetDrawItemList() )
{ {
if( oldItem.IsNew() ) if( oldItem.IsNew() )
continue; continue;
@ -327,7 +326,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset,
if( ! (screen && screen->m_IsPrinting && GetGRForceBlackPenState()) if( ! (screen && screen->m_IsPrinting && GetGRForceBlackPenState())
&& (aColor == UNSPECIFIED_COLOR) ) && (aColor == UNSPECIFIED_COLOR) )
{ {
BOOST_FOREACH( LIB_ITEM& drawItem, drawings ) for( LIB_ITEM& drawItem : drawings )
{ {
if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR ) if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR )
continue; continue;
@ -363,7 +362,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset,
// Track the index into the dangling pins list // Track the index into the dangling pins list
size_t pin_index = 0; size_t pin_index = 0;
BOOST_FOREACH( LIB_ITEM& drawItem, drawings ) for( LIB_ITEM& drawItem : drawings )
{ {
if( aOnlySelected && !drawItem.IsSelected() ) if( aOnlySelected && !drawItem.IsSelected() )
continue; continue;
@ -446,7 +445,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
// draw background for filled items using background option // draw background for filled items using background option
// Solid lines will be drawn after the background // Solid lines will be drawn after the background
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
// Lib Fields are not plotted here, because this plot function // Lib Fields are not plotted here, because this plot function
// is used to plot schematic items, which have they own fields // is used to plot schematic items, which have they own fields
@ -465,7 +464,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
// Not filled items and filled shapes are now plotted // Not filled items and filled shapes are now plotted
// (plot only items which are not already plotted) // (plot only items which are not already plotted)
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;
@ -489,7 +488,7 @@ void LIB_PART::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert,
aPlotter->SetColor( GetLayerColor( LAYER_FIELDS ) ); aPlotter->SetColor( GetLayerColor( LAYER_FIELDS ) );
bool fill = aPlotter->GetColorMode(); bool fill = aPlotter->GetColorMode();
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() != LIB_FIELD_T ) if( item.Type() != LIB_FIELD_T )
continue; continue;
@ -607,7 +606,7 @@ void LIB_PART::GetPins( LIB_PINS& aList, int aUnit, int aConvert )
* when .m_Unit == 0, the body item is common to units * when .m_Unit == 0, the body item is common to units
* when .m_Convert == 0, the body item is common to shapes * when .m_Convert == 0, the body item is common to shapes
*/ */
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() != LIB_PIN_T ) // we search pins only if( item.Type() != LIB_PIN_T ) // we search pins only
continue; continue;
@ -652,14 +651,14 @@ bool LIB_PART::PinsConflictWith( LIB_PART& aOtherPart, bool aTestNums, bool aTes
LIB_PINS thisPinList; LIB_PINS thisPinList;
GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 ); GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
BOOST_FOREACH( LIB_PIN* eachThisPin, thisPinList ) for( LIB_PIN* eachThisPin : thisPinList )
{ {
wxASSERT( eachThisPin ); wxASSERT( eachThisPin );
LIB_PINS otherPinList; LIB_PINS otherPinList;
aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 ); aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
bool foundMatch = false; bool foundMatch = false;
BOOST_FOREACH( LIB_PIN* eachOtherPin, otherPinList ) for( LIB_PIN* eachOtherPin : otherPinList )
{ {
wxASSERT( eachOtherPin ); wxASSERT( eachOtherPin );
// Same position? // Same position?
@ -822,7 +821,7 @@ bool LIB_PART::Save( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "DRAW\n" ); aFormatter.Print( 0, "DRAW\n" );
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;
@ -1275,7 +1274,7 @@ void LIB_PART::GetFields( LIB_FIELDS& aList )
} }
// Now grab all the rest of fields. // Now grab all the rest of fields.
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() != LIB_FIELD_T ) if( item.Type() != LIB_FIELD_T )
continue; continue;
@ -1292,7 +1291,7 @@ void LIB_PART::GetFields( LIB_FIELDS& aList )
LIB_FIELD* LIB_PART::GetField( int aId ) LIB_FIELD* LIB_PART::GetField( int aId )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() != LIB_FIELD_T ) if( item.Type() != LIB_FIELD_T )
continue; continue;
@ -1309,7 +1308,7 @@ LIB_FIELD* LIB_PART::GetField( int aId )
LIB_FIELD* LIB_PART::FindField( const wxString& aFieldName ) LIB_FIELD* LIB_PART::FindField( const wxString& aFieldName )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( item.Type() != LIB_FIELD_T ) if( item.Type() != LIB_FIELD_T )
continue; continue;
@ -1381,7 +1380,7 @@ bool LIB_PART::LoadDateAndTime( char* aLine )
void LIB_PART::SetOffset( const wxPoint& aOffset ) void LIB_PART::SetOffset( const wxPoint& aOffset )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
item.SetOffset( aOffset ); item.SetOffset( aOffset );
} }
@ -1409,7 +1408,7 @@ bool LIB_PART::HasConversion() const
void LIB_PART::ClearStatus() void LIB_PART::ClearStatus()
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
item.m_Flags = 0; item.m_Flags = 0;
} }
@ -1420,7 +1419,7 @@ int LIB_PART::SelectItems( EDA_RECT& aRect, int aUnit, int aConvert, bool aEditP
{ {
int itemCount = 0; int itemCount = 0;
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
item.ClearFlags( SELECTED ); item.ClearFlags( SELECTED );
@ -1449,7 +1448,7 @@ int LIB_PART::SelectItems( EDA_RECT& aRect, int aUnit, int aConvert, bool aEditP
void LIB_PART::MoveSelectedItems( const wxPoint& aOffset ) void LIB_PART::MoveSelectedItems( const wxPoint& aOffset )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( !item.IsSelected() ) if( !item.IsSelected() )
continue; continue;
@ -1464,7 +1463,7 @@ void LIB_PART::MoveSelectedItems( const wxPoint& aOffset )
void LIB_PART::ClearSelectedItems() void LIB_PART::ClearSelectedItems()
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
item.m_Flags = 0; item.m_Flags = 0;
} }
@ -1536,7 +1535,7 @@ void LIB_PART::CopySelectedItems( const wxPoint& aOffset )
void LIB_PART::MirrorSelectedItemsH( const wxPoint& aCenter ) void LIB_PART::MirrorSelectedItemsH( const wxPoint& aCenter )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( !item.IsSelected() ) if( !item.IsSelected() )
continue; continue;
@ -1550,7 +1549,7 @@ void LIB_PART::MirrorSelectedItemsH( const wxPoint& aCenter )
void LIB_PART::MirrorSelectedItemsV( const wxPoint& aCenter ) void LIB_PART::MirrorSelectedItemsV( const wxPoint& aCenter )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( !item.IsSelected() ) if( !item.IsSelected() )
continue; continue;
@ -1564,7 +1563,7 @@ void LIB_PART::MirrorSelectedItemsV( const wxPoint& aCenter )
void LIB_PART::RotateSelectedItems( const wxPoint& aCenter ) void LIB_PART::RotateSelectedItems( const wxPoint& aCenter )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( !item.IsSelected() ) if( !item.IsSelected() )
continue; continue;
@ -1581,7 +1580,7 @@ void LIB_PART::RotateSelectedItems( const wxPoint& aCenter )
LIB_ITEM* LIB_PART::LocateDrawItem( int aUnit, int aConvert, LIB_ITEM* LIB_PART::LocateDrawItem( int aUnit, int aConvert,
KICAD_T aType, const wxPoint& aPoint ) KICAD_T aType, const wxPoint& aPoint )
{ {
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) ) if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) )
|| ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) ) || ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) )
@ -1674,7 +1673,7 @@ void LIB_PART::SetConversion( bool aSetConvert )
{ {
std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here. std::vector< LIB_ITEM* > tmp; // Temporarily store the duplicated pins here.
BOOST_FOREACH( LIB_ITEM& item, drawings ) for( LIB_ITEM& item : drawings )
{ {
// Only pins are duplicated. // Only pins are duplicated.
if( item.Type() != LIB_PIN_T ) if( item.Type() != LIB_PIN_T )

View File

@ -43,8 +43,6 @@
#include <general.h> #include <general.h>
#include <class_library.h> #include <class_library.h>
#include <boost/foreach.hpp>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include <wx/regex.h> #include <wx/regex.h>
@ -896,7 +894,7 @@ wxArrayString PART_LIBS::GetLibraryNames( bool aSorted )
wxArrayString cacheNames; wxArrayString cacheNames;
wxArrayString names; wxArrayString names;
BOOST_FOREACH( PART_LIB& lib, *this ) for( PART_LIB& lib : *this )
{ {
if( lib.IsCache() && aSorted ) if( lib.IsCache() && aSorted )
cacheNames.Add( lib.GetName() ); cacheNames.Add( lib.GetName() );
@ -919,7 +917,7 @@ LIB_PART* PART_LIBS::FindLibPart( const wxString& aPartName, const wxString& aLi
{ {
LIB_PART* part = NULL; LIB_PART* part = NULL;
BOOST_FOREACH( PART_LIB& lib, *this ) for( PART_LIB& lib : *this )
{ {
if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName ) if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName )
continue; continue;
@ -938,7 +936,7 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aEntryName, const wxStri
{ {
LIB_ALIAS* entry = NULL; LIB_ALIAS* entry = NULL;
BOOST_FOREACH( PART_LIB& lib, *this ) for( PART_LIB& lib : *this )
{ {
if( !!aLibraryName && lib.GetName() != aLibraryName ) if( !!aLibraryName && lib.GetName() != aLibraryName )
continue; continue;
@ -954,7 +952,7 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aEntryName, const wxStri
void PART_LIBS::FindLibraryEntries( const wxString& aEntryName, std::vector<LIB_ALIAS*>& aEntries ) void PART_LIBS::FindLibraryEntries( const wxString& aEntryName, std::vector<LIB_ALIAS*>& aEntries )
{ {
BOOST_FOREACH( PART_LIB& lib, *this ) for( PART_LIB& lib : *this )
{ {
LIB_ALIAS* entry = lib.FindEntry( aEntryName ); LIB_ALIAS* entry = lib.FindEntry( aEntryName );
@ -970,7 +968,7 @@ void PART_LIBS::FindLibraryNearEntries( std::vector<LIB_ALIAS*>& aCandidates,
const wxString& aEntryName, const wxString& aEntryName,
const wxString& aLibraryName ) const wxString& aLibraryName )
{ {
BOOST_FOREACH( PART_LIB& lib, *this ) for( PART_LIB& lib : *this )
{ {
if( !!aLibraryName && lib.GetName() != aLibraryName ) if( !!aLibraryName && lib.GetName() != aLibraryName )
continue; continue;

View File

@ -39,8 +39,6 @@
#include <sch_reference_list.h> #include <sch_reference_list.h>
#include <sch_component.h> #include <sch_component.h>
#include <boost/foreach.hpp>
//#define USE_OLD_ALGO //#define USE_OLD_ALGO
@ -332,7 +330,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId,
// Check whether this component is in aLockedUnitMap. // Check whether this component is in aLockedUnitMap.
SCH_REFERENCE_LIST* lockedList = NULL; SCH_REFERENCE_LIST* lockedList = NULL;
BOOST_FOREACH( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair, aLockedUnitMap ) for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : aLockedUnitMap )
{ {
unsigned n_refs = pair.second.GetCount(); unsigned n_refs = pair.second.GetCount();
for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI ) for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI )

View File

@ -24,7 +24,6 @@
#include <component_tree_search_container.h> #include <component_tree_search_container.h>
#include <algorithm> #include <algorithm>
#include <boost/foreach.hpp>
#include <set> #include <set>
#include <wx/string.h> #include <wx/string.h>
@ -113,7 +112,7 @@ COMPONENT_TREE_SEARCH_CONTAINER::COMPONENT_TREE_SEARCH_CONTAINER( PART_LIBS* aLi
COMPONENT_TREE_SEARCH_CONTAINER::~COMPONENT_TREE_SEARCH_CONTAINER() COMPONENT_TREE_SEARCH_CONTAINER::~COMPONENT_TREE_SEARCH_CONTAINER()
{ {
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
delete node; delete node;
m_nodes.clear(); m_nodes.clear();
@ -158,7 +157,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
aNodeName, wxEmptyString, wxEmptyString ); aNodeName, wxEmptyString, wxEmptyString );
m_nodes.push_back( lib_node ); m_nodes.push_back( lib_node );
BOOST_FOREACH( const wxString& aName, aAliasNameList ) for( const wxString& aName : aAliasNameList )
{ {
LIB_ALIAS* a; LIB_ALIAS* a;
@ -226,7 +225,7 @@ LIB_ALIAS* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedAlias( int* aUnit )
const wxTreeItemId& select_id = m_tree->GetSelection(); const wxTreeItemId& select_id = m_tree->GetSelection();
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
{ {
if( node->MatchScore > 0 && node->TreeId == select_id ) if( node->MatchScore > 0 && node->TreeId == select_id )
{ {
@ -272,7 +271,7 @@ public:
~EDA_COMBINED_MATCHER() ~EDA_COMBINED_MATCHER()
{ {
BOOST_FOREACH( const EDA_PATTERN_MATCH* matcher, m_matchers ) for( const EDA_PATTERN_MATCH* matcher : m_matchers )
delete matcher; delete matcher;
} }
@ -284,7 +283,7 @@ public:
{ {
int result = EDA_PATTERN_NOT_FOUND; int result = EDA_PATTERN_NOT_FOUND;
BOOST_FOREACH( const EDA_PATTERN_MATCH* matcher, m_matchers ) for( const EDA_PATTERN_MATCH* matcher : m_matchers )
{ {
int local_find = matcher->Find( aTerm ); int local_find = matcher->Find( aTerm );
@ -336,7 +335,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
// on an i5. Good enough, no index needed. // on an i5. Good enough, no index needed.
// Initial AND condition: Leaf nodes are considered to match initially. // Initial AND condition: Leaf nodes are considered to match initially.
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
{ {
node->PreviousScore = node->MatchScore; node->PreviousScore = node->MatchScore;
node->MatchScore = ( node->Type == TREE_NODE::TYPE_LIB ) ? 0 : kLowestDefaultScore; node->MatchScore = ( node->Type == TREE_NODE::TYPE_LIB ) ? 0 : kLowestDefaultScore;
@ -360,7 +359,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
const wxString term = tokenizer.GetNextToken().Lower(); const wxString term = tokenizer.GetNextToken().Lower();
EDA_COMBINED_MATCHER matcher( term ); EDA_COMBINED_MATCHER matcher( term );
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
{ {
if( node->Type != TREE_NODE::TYPE_ALIAS ) if( node->Type != TREE_NODE::TYPE_ALIAS )
continue; // Only aliases are actually scored here. continue; // Only aliases are actually scored here.
@ -406,7 +405,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
unsigned highest_score_seen = 0; unsigned highest_score_seen = 0;
bool any_change = false; bool any_change = false;
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
{ {
switch( node->Type ) switch( node->Type )
{ {
@ -447,7 +446,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
const TREE_NODE* first_match = NULL; const TREE_NODE* first_match = NULL;
const TREE_NODE* preselected_node = NULL; const TREE_NODE* preselected_node = NULL;
BOOST_FOREACH( TREE_NODE* node, m_nodes ) for( TREE_NODE* node : m_nodes )
{ {
if( node->MatchScore == 0 ) if( node->MatchScore == 0 )
continue; continue;

View File

@ -31,7 +31,6 @@
#include <class_libentry.h> #include <class_libentry.h>
#include <set> #include <set>
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <project_rescue.h> #include <project_rescue.h>
#include <eeschema_config.h> #include <eeschema_config.h>
@ -127,7 +126,7 @@ bool DIALOG_RESCUE_EACH::TransferDataToWindow()
void DIALOG_RESCUE_EACH::PopulateConflictList() void DIALOG_RESCUE_EACH::PopulateConflictList()
{ {
wxVector<wxVariant> data; wxVector<wxVariant> data;
BOOST_FOREACH( RESCUE_CANDIDATE& each_candidate, m_Rescuer->m_all_candidates ) for( RESCUE_CANDIDATE& each_candidate : m_Rescuer->m_all_candidates )
{ {
data.clear(); data.clear();
data.push_back( wxVariant( true ) ); data.push_back( wxVariant( true ) );
@ -151,7 +150,7 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList()
RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row]; RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row];
wxVector<wxVariant> data; wxVector<wxVariant> data;
BOOST_FOREACH( SCH_COMPONENT* each_component, *m_Rescuer->GetComponents() ) for( SCH_COMPONENT* each_component : *m_Rescuer->GetComponents() )
{ {
if( each_component->GetPartName() != selected_part.GetRequestedName() ) if( each_component->GetPartName() != selected_part.GetRequestedName() )
continue; continue;

View File

@ -52,8 +52,6 @@
#include <kicad_device_context.h> #include <kicad_device_context.h>
#include <boost/foreach.hpp>
#include <dialogs/dialog_schematic_find.h> #include <dialogs/dialog_schematic_find.h>

View File

@ -49,8 +49,6 @@
#include <component_tree_search_container.h> #include <component_tree_search_container.h>
#include <dialog_get_component.h> #include <dialog_get_component.h>
#include <boost/foreach.hpp>
wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( const SCHLIB_FILTER* aFilter, wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( const SCHLIB_FILTER* aFilter,
LIB_ALIAS* aPreselectedAlias, LIB_ALIAS* aPreselectedAlias,
@ -133,7 +131,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const SCHLIB_FILTER* aFilte
if( !loaded ) if( !loaded )
{ {
BOOST_FOREACH( PART_LIB& lib, *libs ) for( PART_LIB& lib : *libs )
{ {
search_container.AddLibrary( lib ); search_container.AddLibrary( lib );
} }

View File

@ -41,8 +41,6 @@
#include <lib_polyline.h> #include <lib_polyline.h>
#include <transform.h> #include <transform.h>
#include <boost/foreach.hpp>
LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) : LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) :
LIB_ITEM( LIB_POLYLINE_T, aParent ) LIB_ITEM( LIB_POLYLINE_T, aParent )
@ -450,7 +448,7 @@ void LIB_POLYLINE::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
wxPoint prevPoint = startPoint; wxPoint prevPoint = startPoint;
// Find the right index of the point to be dragged // Find the right index of the point to be dragged
BOOST_FOREACH( wxPoint point, m_PolyPoints ) for( wxPoint point : m_PolyPoints )
{ {
int distancePoint = (aPosition - point).x * (aPosition - point).x + int distancePoint = (aPosition - point).x * (aPosition - point).x +
(aPosition - point).y * (aPosition - point).y; (aPosition - point).y * (aPosition - point).y;

View File

@ -41,8 +41,6 @@
#include <class_library.h> #include <class_library.h>
#include <dialogs/dialog_plot_schematic.h> #include <dialogs/dialog_plot_schematic.h>
#include <boost/foreach.hpp>
void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
{ {

View File

@ -54,8 +54,6 @@
#include <menus_helpers.h> #include <menus_helpers.h>
#include <boost/foreach.hpp>
/* This method guarantees unique IDs for the library this run of Eeschema /* This method guarantees unique IDs for the library this run of Eeschema
* which prevents ID conflicts and eliminates the need to recompile every * which prevents ID conflicts and eliminates the need to recompile every
@ -336,7 +334,7 @@ void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
PART_LIBS* libs = Prj().SchLibs(); PART_LIBS* libs = Prj().SchLibs();
BOOST_FOREACH( const PART_LIB& lib, *libs ) for( const PART_LIB& lib : *libs )
{ {
if( lib.IsModified() ) if( lib.IsModified() )
{ {

View File

@ -45,7 +45,6 @@
#include <sch_sheet.h> #include <sch_sheet.h>
#include <algorithm> #include <algorithm>
#include <invoke_sch_dialog.h> #include <invoke_sch_dialog.h>
#include <boost/foreach.hpp>
#define IS_WIRE false #define IS_WIRE false
#define IS_BUS true #define IS_BUS true

View File

@ -34,7 +34,6 @@
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <cctype> #include <cctype>
#include <boost/foreach.hpp>
#include <map> #include <map>
@ -183,7 +182,7 @@ static LIB_PART* find_component( wxString aName, PART_LIBS* aLibs, bool aCached
{ {
LIB_PART *part = NULL; LIB_PART *part = NULL;
BOOST_FOREACH( PART_LIB& each_lib, *aLibs ) for( PART_LIB& each_lib : *aLibs )
{ {
if( aCached && !each_lib.IsCache() ) if( aCached && !each_lib.IsCache() )
continue; continue;
@ -208,7 +207,7 @@ void RESCUER::RemoveDuplicates()
it != m_all_candidates.end(); ) it != m_all_candidates.end(); )
{ {
bool seen_already = false; bool seen_already = false;
BOOST_FOREACH( wxString& name_seen, names_seen ) for( wxString& name_seen : names_seen )
{ {
if( name_seen == it->GetRequestedName() ) if( name_seen == it->GetRequestedName() )
{ {
@ -248,7 +247,7 @@ public:
typedef std::map<wxString, RESCUE_CASE_CANDIDATE> candidate_map_t; typedef std::map<wxString, RESCUE_CASE_CANDIDATE> candidate_map_t;
candidate_map_t candidate_map; candidate_map_t candidate_map;
BOOST_FOREACH( SCH_COMPONENT* each_component, *( aRescuer.GetComponents() ) ) for( SCH_COMPONENT* each_component : *( aRescuer.GetComponents() ) )
{ {
wxString part_name( each_component->GetPartName() ); wxString part_name( each_component->GetPartName() );
@ -266,7 +265,7 @@ public:
} }
// Now, dump the map into aCandidates // Now, dump the map into aCandidates
BOOST_FOREACH( const candidate_map_t::value_type& each_pair, candidate_map ) for( const candidate_map_t::value_type& each_pair : candidate_map )
{ {
aCandidates.push_back( new RESCUE_CASE_CANDIDATE( each_pair.second ) ); aCandidates.push_back( new RESCUE_CASE_CANDIDATE( each_pair.second ) );
} }
@ -298,7 +297,7 @@ public:
virtual bool PerformAction( RESCUER* aRescuer ) virtual bool PerformAction( RESCUER* aRescuer )
{ {
BOOST_FOREACH( SCH_COMPONENT* each_component, *aRescuer->GetComponents() ) for( SCH_COMPONENT* each_component : *aRescuer->GetComponents() )
{ {
if( each_component->GetPartName() != m_requested_name ) continue; if( each_component->GetPartName() != m_requested_name ) continue;
each_component->SetPartName( m_new_name ); each_component->SetPartName( m_new_name );
@ -334,7 +333,7 @@ public:
wxString part_name_suffix = aRescuer.GetPartNameSuffix(); wxString part_name_suffix = aRescuer.GetPartNameSuffix();
BOOST_FOREACH( SCH_COMPONENT* each_component, *( aRescuer.GetComponents() ) ) for( SCH_COMPONENT* each_component : *( aRescuer.GetComponents() ) )
{ {
wxString part_name( each_component->GetPartName() ); wxString part_name( each_component->GetPartName() );
@ -356,7 +355,7 @@ public:
} }
// Now, dump the map into aCandidates // Now, dump the map into aCandidates
BOOST_FOREACH( const candidate_map_t::value_type& each_pair, candidate_map ) for( const candidate_map_t::value_type& each_pair : candidate_map )
{ {
aCandidates.push_back( new RESCUE_CACHE_CANDIDATE( each_pair.second ) ); aCandidates.push_back( new RESCUE_CACHE_CANDIDATE( each_pair.second ) );
} }
@ -416,7 +415,7 @@ public:
new_part.RemoveAllAliases(); new_part.RemoveAllAliases();
RESCUE_CACHE_CANDIDATE::m_rescue_lib.get()->AddPart( &new_part ); RESCUE_CACHE_CANDIDATE::m_rescue_lib.get()->AddPart( &new_part );
BOOST_FOREACH( SCH_COMPONENT* each_component, *aRescuer->GetComponents() ) for( SCH_COMPONENT* each_component : *aRescuer->GetComponents() )
{ {
if( each_component->GetPartName() != m_requested_name ) continue; if( each_component->GetPartName() != m_requested_name ) continue;
each_component->SetPartName( m_new_name ); each_component->SetPartName( m_new_name );
@ -479,7 +478,7 @@ void RESCUER::LogRescue( SCH_COMPONENT *aComponent, const wxString &aOldName,
bool RESCUER::DoRescues() bool RESCUER::DoRescues()
{ {
BOOST_FOREACH( RESCUE_CANDIDATE* each_candidate, m_chosen_candidates ) for( RESCUE_CANDIDATE* each_candidate : m_chosen_candidates )
{ {
if( ! each_candidate->PerformAction( this ) ) if( ! each_candidate->PerformAction( this ) )
return false; return false;
@ -490,7 +489,7 @@ bool RESCUER::DoRescues()
void RESCUER::UndoRescues() void RESCUER::UndoRescues()
{ {
BOOST_FOREACH( RESCUE_LOG& each_logitem, m_rescue_log ) for( RESCUE_LOG& each_logitem : m_rescue_log )
{ {
each_logitem.component->SetPartName( each_logitem.old_name ); each_logitem.component->SetPartName( each_logitem.old_name );
each_logitem.component->ClearFlags(); each_logitem.component->ClearFlags();

View File

@ -35,7 +35,6 @@
#include <common.h> #include <common.h>
#include <richio.h> #include <richio.h>
#include <plot_common.h> #include <plot_common.h>
#include <boost/foreach.hpp>
#include <eeschema_config.h> #include <eeschema_config.h>
#include <general.h> #include <general.h>
@ -264,7 +263,7 @@ bool SCH_BUS_ENTRY_BASE::IsDanglingStateChanged( std::vector<DANGLING_END_ITEM>&
bool start_is_wire = false; bool start_is_wire = false;
bool end_is_wire = false; bool end_is_wire = false;
BOOST_FOREACH( DANGLING_END_ITEM& each_item, aItemList ) for( DANGLING_END_ITEM& each_item : aItemList )
{ {
if( each_item.GetItem() == this ) if( each_item.GetItem() == this )
continue; continue;

View File

@ -36,7 +36,6 @@
#include <schframe.h> #include <schframe.h>
#include <plot_common.h> #include <plot_common.h>
#include <msgpanel.h> #include <msgpanel.h>
#include <boost/foreach.hpp>
#include <general.h> #include <general.h>
#include <class_library.h> #include <class_library.h>
@ -666,7 +665,7 @@ SCH_FIELD* SCH_COMPONENT::GetField( int aFieldNdx ) const
void SCH_COMPONENT::GetFields( std::vector<SCH_FIELD*>& aVector, bool aVisibleOnly ) void SCH_COMPONENT::GetFields( std::vector<SCH_FIELD*>& aVector, bool aVisibleOnly )
{ {
BOOST_FOREACH( SCH_FIELD& each_field, m_Fields ) for( SCH_FIELD& each_field : m_Fields )
{ {
if( !aVisibleOnly || ( each_field.IsVisible() && !each_field.IsVoid() ) ) if( !aVisibleOnly || ( each_field.IsVisible() && !each_field.IsVoid() ) )
aVector.push_back( &each_field ); aVector.push_back( &each_field );
@ -1671,7 +1670,7 @@ bool SCH_COMPONENT::IsPinDanglingStateChanged( std::vector<DANGLING_END_ITEM> &a
wxPoint pin_position = GetPinPhysicalPosition( aLibPins[aPin] ); wxPoint pin_position = GetPinPhysicalPosition( aLibPins[aPin] );
BOOST_FOREACH( DANGLING_END_ITEM& each_item, aItemList ) for( DANGLING_END_ITEM& each_item : aItemList )
{ {
// Some people like to stack pins on top of each other in a symbol to indicate // Some people like to stack pins on top of each other in a symbol to indicate
// internal connection. While technically connected, it is not particularly useful // internal connection. While technically connected, it is not particularly useful
@ -1727,7 +1726,7 @@ bool SCH_COMPONENT::IsDanglingStateChanged( std::vector<DANGLING_END_ITEM>& aIte
bool SCH_COMPONENT::IsDangling() const bool SCH_COMPONENT::IsDangling() const
{ {
BOOST_FOREACH( bool each, m_isDangling ) for( bool each : m_isDangling )
{ {
if( each ) if( each )
return true; return true;

View File

@ -39,8 +39,6 @@
#include <sch_line.h> #include <sch_line.h>
#include <class_netlist_object.h> #include <class_netlist_object.h>
#include <boost/foreach.hpp>
SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) : SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) :
SCH_ITEM( NULL, SCH_LINE_T ) SCH_ITEM( NULL, SCH_LINE_T )
@ -380,7 +378,7 @@ bool SCH_LINE::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemLi
if( GetLayer() == LAYER_WIRE ) if( GetLayer() == LAYER_WIRE )
{ {
BOOST_FOREACH( DANGLING_END_ITEM item, aItemList ) for( DANGLING_END_ITEM item : aItemList )
{ {
if( item.GetItem() == this ) if( item.GetItem() == this )
continue; continue;

View File

@ -54,7 +54,6 @@
#include <sch_text.h> #include <sch_text.h>
#include <lib_pin.h> #include <lib_pin.h>
#include <boost/foreach.hpp>
#define EESCHEMA_FILE_STAMP "EESchema" #define EESCHEMA_FILE_STAMP "EESchema"
@ -493,7 +492,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION ) < 0 ) SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION ) < 0 )
return false; return false;
BOOST_FOREACH( const PART_LIB& lib, *Prj().SchLibs() ) for( const PART_LIB& lib : *Prj().SchLibs() )
{ {
if( fprintf( aFile, "LIBS:%s\n", TO_UTF8( lib.GetName() ) ) < 0 ) if( fprintf( aFile, "LIBS:%s\n", TO_UTF8( lib.GetName() ) ) < 0 )
return false; return false;

View File

@ -162,7 +162,7 @@ bool SCH_SHEET::Save( FILE* aFile ) const
/* Save the list of labels in the sheet. */ /* Save the list of labels in the sheet. */
BOOST_FOREACH( const SCH_SHEET_PIN& label, m_pins ) for( const SCH_SHEET_PIN& label : m_pins )
{ {
if( !label.Save( aFile ) ) if( !label.Save( aFile ) )
return false; return false;
@ -333,12 +333,12 @@ void SCH_SHEET::SwapData( SCH_ITEM* aItem )
// Ensure sheet labels have their .m_Parent member pointing really on their // Ensure sheet labels have their .m_Parent member pointing really on their
// parent, after swapping. // parent, after swapping.
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) for( SCH_SHEET_PIN& sheetPin : m_pins )
{ {
sheetPin.SetParent( this ); sheetPin.SetParent( this );
} }
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, sheet->m_pins ) for( SCH_SHEET_PIN& sheetPin : sheet->m_pins )
{ {
sheetPin.SetParent( sheet ); sheetPin.SetParent( sheet );
} }
@ -379,7 +379,7 @@ void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin )
bool SCH_SHEET::HasPin( const wxString& aName ) bool SCH_SHEET::HasPin( const wxString& aName )
{ {
BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins ) for( SCH_SHEET_PIN pin : m_pins )
{ {
if( pin.GetText().CmpNoCase( aName ) == 0 ) if( pin.GetText().CmpNoCase( aName ) == 0 )
return true; return true;
@ -391,7 +391,7 @@ bool SCH_SHEET::HasPin( const wxString& aName )
bool SCH_SHEET::IsVerticalOrientation() const bool SCH_SHEET::IsVerticalOrientation() const
{ {
BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins ) for( SCH_SHEET_PIN pin : m_pins )
{ {
if( pin.GetEdge() > 1 ) if( pin.GetEdge() > 1 )
return true; return true;
@ -402,7 +402,7 @@ bool SCH_SHEET::IsVerticalOrientation() const
bool SCH_SHEET::HasUndefinedPins() bool SCH_SHEET::HasUndefinedPins()
{ {
BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins ) for( SCH_SHEET_PIN pin : m_pins )
{ {
/* Search the schematic for a hierarchical label corresponding to this sheet label. */ /* Search the schematic for a hierarchical label corresponding to this sheet label. */
EDA_ITEM* DrawStruct = m_screen->GetDrawItems(); EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
@ -515,7 +515,7 @@ void SCH_SHEET::CleanupSheet()
SCH_SHEET_PIN* SCH_SHEET::GetPin( const wxPoint& aPosition ) SCH_SHEET_PIN* SCH_SHEET::GetPin( const wxPoint& aPosition )
{ {
BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins ) for( SCH_SHEET_PIN& pin : m_pins )
{ {
if( pin.HitTest( aPosition, 0 ) ) if( pin.HitTest( aPosition, 0 ) )
return &pin; return &pin;
@ -626,7 +626,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
/* Draw text : SheetLabel */ /* Draw text : SheetLabel */
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) for( SCH_SHEET_PIN& sheetPin : m_pins )
{ {
if( !sheetPin.IsMoving() ) if( !sheetPin.IsMoving() )
sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor ); sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor );
@ -862,7 +862,7 @@ void SCH_SHEET::Rotate(wxPoint aPosition)
m_size.y = -m_size.y; m_size.y = -m_size.y;
} }
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) for( SCH_SHEET_PIN& sheetPin : m_pins )
{ {
sheetPin.Rotate( aPosition ); sheetPin.Rotate( aPosition );
} }
@ -874,7 +874,7 @@ void SCH_SHEET::MirrorX( int aXaxis_position )
MIRROR( m_pos.y, aXaxis_position ); MIRROR( m_pos.y, aXaxis_position );
m_pos.y -= m_size.y; m_pos.y -= m_size.y;
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) for( SCH_SHEET_PIN& sheetPin : m_pins )
{ {
sheetPin.MirrorX( aXaxis_position ); sheetPin.MirrorX( aXaxis_position );
} }
@ -886,7 +886,7 @@ void SCH_SHEET::MirrorY( int aYaxis_position )
MIRROR( m_pos.x, aYaxis_position ); MIRROR( m_pos.x, aYaxis_position );
m_pos.x -= m_size.x; m_pos.x -= m_size.x;
BOOST_FOREACH( SCH_SHEET_PIN& label, m_pins ) for( SCH_SHEET_PIN& label : m_pins )
{ {
label.MirrorY( aYaxis_position ); label.MirrorY( aYaxis_position );
} }
@ -909,7 +909,7 @@ void SCH_SHEET::Resize( const wxSize& aSize )
m_size = aSize; m_size = aSize;
/* Move the sheet labels according to the new sheet size. */ /* Move the sheet labels according to the new sheet size. */
BOOST_FOREACH( SCH_SHEET_PIN& label, m_pins ) for( SCH_SHEET_PIN& label : m_pins )
{ {
label.ConstrainOnEdge( label.GetPosition() ); label.ConstrainOnEdge( label.GetPosition() );
} }
@ -952,7 +952,7 @@ void SCH_SHEET::renumberPins()
{ {
int id = 2; int id = 2;
BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins ) for( SCH_SHEET_PIN& pin : m_pins )
{ {
pin.SetNumber( id ); pin.SetNumber( id );
id++; id++;
@ -978,7 +978,7 @@ bool SCH_SHEET::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemL
{ {
bool currentState = IsDangling(); bool currentState = IsDangling();
BOOST_FOREACH( SCH_SHEET_PIN& pinsheet, GetPins() ) for( SCH_SHEET_PIN& pinsheet : GetPins() )
{ {
pinsheet.IsDanglingStateChanged( aItemList ); pinsheet.IsDanglingStateChanged( aItemList );
} }
@ -1212,7 +1212,7 @@ SCH_ITEM& SCH_SHEET::operator=( const SCH_ITEM& aItem )
// Ensure sheet labels have their #m_Parent member pointing really on their // Ensure sheet labels have their #m_Parent member pointing really on their
// parent, after assigning. // parent, after assigning.
BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) for( SCH_SHEET_PIN& sheetPin : m_pins )
{ {
sheetPin.SetParent( this ); sheetPin.SetParent( this );
} }
@ -1233,7 +1233,7 @@ void SCH_SHEET::Show( int nestLevel, std::ostream& os ) const
<< TO_UTF8( m_name ) << '"' << ">\n"; << TO_UTF8( m_name ) << '"' << ">\n";
// show all the pins, and check the linked list integrity // show all the pins, and check the linked list integrity
BOOST_FOREACH( const SCH_SHEET_PIN& label, m_pins ) for( const SCH_SHEET_PIN& label : m_pins )
{ {
label.Show( nestLevel + 1, os ); label.Show( nestLevel + 1, os );
} }

View File

@ -31,7 +31,6 @@
#define SCH_SHEEET_H #define SCH_SHEEET_H
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp>
#include <sch_text.h> #include <sch_text.h>
@ -505,7 +504,7 @@ public:
{ {
m_pos += aMoveVector; m_pos += aMoveVector;
BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins ) for( SCH_SHEET_PIN& pin : m_pins )
{ {
pin.Move( aMoveVector ); pin.Move( aMoveVector );
} }

View File

@ -43,7 +43,6 @@
#include <dialogs/dialog_schematic_find.h> #include <dialogs/dialog_schematic_find.h>
#include <boost/foreach.hpp>
#include <wx/filename.h> #include <wx/filename.h>
@ -586,7 +585,7 @@ void SCH_SHEET_LIST::GetMultiUnitComponents( PART_LIBS* aLibs,
SCH_MULTI_UNIT_REFERENCE_MAP tempMap; SCH_MULTI_UNIT_REFERENCE_MAP tempMap;
(*it).GetMultiUnitComponents( aLibs, tempMap ); (*it).GetMultiUnitComponents( aLibs, tempMap );
BOOST_FOREACH( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair, tempMap ) for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : tempMap )
{ {
// Merge this list into the main one // Merge this list into the main one
unsigned n_refs = pair.second.GetCount(); unsigned n_refs = pair.second.GetCount();

View File

@ -42,8 +42,6 @@
#include <class_library.h> #include <class_library.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <boost/foreach.hpp>
void LIB_EDIT_FRAME::LoadOneSymbol() void LIB_EDIT_FRAME::LoadOneSymbol()
{ {
@ -114,7 +112,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
LIB_PART* first = lib->GetFirstEntry()->GetPart(); LIB_PART* first = lib->GetFirstEntry()->GetPart();
LIB_ITEMS& drawList = first->GetDrawItemList(); LIB_ITEMS& drawList = first->GetDrawItemList();
BOOST_FOREACH( LIB_ITEM& item, drawList ) for( LIB_ITEM& item : drawList )
{ {
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;
@ -217,7 +215,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
LIB_ITEMS& drawList = part->GetDrawItemList(); LIB_ITEMS& drawList = part->GetDrawItemList();
BOOST_FOREACH( LIB_ITEM& item, drawList ) for( LIB_ITEM& item : drawList )
{ {
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;

View File

@ -31,7 +31,6 @@
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp>
#include <ki_mutex.h> #include <ki_mutex.h>
#include <kicad_string.h> #include <kicad_string.h>

View File

@ -35,7 +35,6 @@
*/ */
#include <algorithm> #include <algorithm>
#include <boost/foreach.hpp>
#include <fctsys.h> #include <fctsys.h>
#include <convert_to_biu.h> #include <convert_to_biu.h>
@ -194,7 +193,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector<MODULE*>* aFootprints,
// calculate also the area needed by these footprints // calculate also the area needed by these footprints
std::vector <MODULE*> footprintList; std::vector <MODULE*> footprintList;
BOOST_FOREACH( MODULE* footprint, *aFootprints ) for( MODULE* footprint : *aFootprints )
{ {
footprint->CalculateBoundingBox(); footprint->CalculateBoundingBox();
@ -221,7 +220,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector<MODULE*>* aFootprints,
undoList.m_Status = UR_CHANGED; undoList.m_Status = UR_CHANGED;
ITEM_PICKER picker( NULL, UR_CHANGED ); ITEM_PICKER picker( NULL, UR_CHANGED );
BOOST_FOREACH( MODULE* footprint, footprintList ) for( MODULE* footprint : footprintList )
{ {
// Undo: add copy of the footprint to undo list // Undo: add copy of the footprint to undo list
picker.SetItem( footprint ); picker.SetItem( footprint );

View File

@ -42,7 +42,6 @@
#include <class_module.h> #include <class_module.h>
#include <polygon_test_point_inside.h> #include <polygon_test_point_inside.h>
#include <convert_to_biu.h> #include <convert_to_biu.h>
#include <boost/foreach.hpp>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
@ -976,7 +975,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
static const LAYER_ID layers_mech[] = { F_Mask, B_Mask, F_Paste, B_Paste, static const LAYER_ID layers_mech[] = { F_Mask, B_Mask, F_Paste, B_Paste,
F_Adhes, B_Adhes, F_SilkS, B_SilkS, Dwgs_User, Eco1_User, Eco2_User }; F_Adhes, B_Adhes, F_SilkS, B_SilkS, Dwgs_User, Eco1_User, Eco2_User };
BOOST_FOREACH( LAYER_ID each_layer, layers_mech ) for( LAYER_ID each_layer : layers_mech )
{ {
if( IsOnLayer( each_layer ) ) if( IsOnLayer( each_layer ) )
aLayers[aCount++] = each_layer; aLayers[aCount++] = each_layer;

View File

@ -113,7 +113,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
if( !newFootprints.empty() ) if( !newFootprints.empty() )
{ {
BOOST_FOREACH( MODULE* footprint, newFootprints ) for( MODULE* footprint : newFootprints )
{ {
toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint ); toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint );
} }

View File

@ -394,7 +394,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList()
return; return;
} }
BOOST_FOREACH( const FOOTPRINT_INFO& footprint, fp_info_list.GetList() ) for( const FOOTPRINT_INFO& footprint : fp_info_list.GetList() )
{ {
m_footprintList->Append( footprint.GetFootprintName() ); m_footprintList->Append( footprint.GetFootprintName() );
} }

View File

@ -127,7 +127,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
SpreadFootprints( &newFootprints, false, false ); SpreadFootprints( &newFootprints, false, false );
if( !newFootprints.empty() ) if( !newFootprints.empty() )
{ {
BOOST_FOREACH( MODULE* footprint, newFootprints ) for( MODULE* footprint : newFootprints )
{ {
m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint ); m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint );
} }

View File

@ -129,7 +129,7 @@ static std::vector<RN_EDGE_MST_PTR>* kruskalMST( RN_LINKS::RN_EDGE_LIST& aEdges,
// Set tags for marking cycles // Set tags for marking cycles
boost::unordered_map<RN_NODE_PTR, int> tags; boost::unordered_map<RN_NODE_PTR, int> tags;
unsigned int tag = 0; unsigned int tag = 0;
BOOST_FOREACH( RN_NODE_PTR& node, aNodes ) for( RN_NODE_PTR& node : aNodes )
{ {
node->SetTag( tag ); node->SetTag( tag );
tags[node] = tag++; tags[node] = tag++;
@ -220,7 +220,7 @@ void RN_NET::validateEdge( RN_EDGE_MST_PTR& aEdge )
valid = false; valid = false;
std::list<RN_NODE_PTR> closest = GetClosestNodes( source, WITHOUT_FLAG() ); std::list<RN_NODE_PTR> closest = GetClosestNodes( source, WITHOUT_FLAG() );
BOOST_FOREACH( RN_NODE_PTR& node, closest ) for( RN_NODE_PTR& node : closest )
{ {
if( node && node != target ) if( node && node != target )
{ {
@ -235,7 +235,7 @@ void RN_NET::validateEdge( RN_EDGE_MST_PTR& aEdge )
valid = false; valid = false;
std::list<RN_NODE_PTR> closest = GetClosestNodes( target, WITHOUT_FLAG() ); std::list<RN_NODE_PTR> closest = GetClosestNodes( target, WITHOUT_FLAG() );
BOOST_FOREACH( RN_NODE_PTR& node, closest ) for( RN_NODE_PTR& node : closest )
{ {
if( node && node != source ) if( node && node != source )
{ {
@ -343,7 +343,7 @@ void RN_NET::compute()
} }
// Set tags to nodes as connected // Set tags to nodes as connected
BOOST_FOREACH( RN_NODE_PTR node, boardNodes ) for( RN_NODE_PTR node : boardNodes )
node->SetTag( 0 ); node->SetTag( 0 );
return; return;
@ -418,7 +418,7 @@ void RN_NET::Update()
compute(); compute();
BOOST_FOREACH( RN_EDGE_MST_PTR& edge, *m_rnEdges ) for( RN_EDGE_MST_PTR& edge : *m_rnEdges )
validateEdge( edge ); validateEdge( edge );
m_dirty = false; m_dirty = false;
@ -492,7 +492,7 @@ void RN_NET::RemoveItem( const D_PAD* aPad )
RN_PAD_DATA& pad_data = it->second; RN_PAD_DATA& pad_data = it->second;
removeNode( pad_data.m_Node, aPad ); removeNode( pad_data.m_Node, aPad );
BOOST_FOREACH( RN_EDGE_MST_PTR& edge, pad_data.m_Edges ) for( RN_EDGE_MST_PTR& edge : pad_data.m_Edges )
removeEdge( edge, aPad ); removeEdge( edge, aPad );
m_pads.erase( aPad ); m_pads.erase( aPad );
@ -534,13 +534,13 @@ void RN_NET::RemoveItem( const ZONE_CONTAINER* aZone )
// Remove all subpolygons that make the zone // Remove all subpolygons that make the zone
std::deque<RN_POLY>& polygons = zoneData.m_Polygons; std::deque<RN_POLY>& polygons = zoneData.m_Polygons;
BOOST_FOREACH( RN_POLY& polygon, polygons ) for( RN_POLY& polygon : polygons )
removeNode( polygon.GetNode(), aZone ); removeNode( polygon.GetNode(), aZone );
polygons.clear(); polygons.clear();
// Remove all connections added by the zone // Remove all connections added by the zone
std::deque<RN_EDGE_MST_PTR>& edges = zoneData.m_Edges; std::deque<RN_EDGE_MST_PTR>& edges = zoneData.m_Edges;
BOOST_FOREACH( RN_EDGE_MST_PTR edge, edges ) for( RN_EDGE_MST_PTR edge : edges )
removeEdge( edge, aZone ); removeEdge( edge, aZone );
edges.clear(); edges.clear();
@ -614,7 +614,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN
const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes(); const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes();
// Copy nodes // Copy nodes
BOOST_FOREACH( const RN_NODE_PTR& node, nodes ) for( const RN_NODE_PTR& node : nodes )
closest.push_back( node ); closest.push_back( node );
// Sort by the distance from aNode // Sort by the distance from aNode
@ -638,7 +638,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode,
const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes(); const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes();
// Copy nodes // Copy nodes
BOOST_FOREACH( const RN_NODE_PTR& node, nodes ) for( const RN_NODE_PTR& node : nodes )
closest.push_back( node ); closest.push_back( node );
// Sort by the distance from aNode // Sort by the distance from aNode
@ -660,7 +660,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode,
void RN_NET::AddSimple( const BOARD_CONNECTED_ITEM* aItem ) void RN_NET::AddSimple( const BOARD_CONNECTED_ITEM* aItem )
{ {
BOOST_FOREACH( RN_NODE_PTR node, GetNodes( aItem ) ) for( RN_NODE_PTR node : GetNodes( aItem ) )
{ {
// Block all nodes, so they do not become targets for dynamic ratsnest lines // Block all nodes, so they do not become targets for dynamic ratsnest lines
AddBlockedNode( node ); AddBlockedNode( node );
@ -734,25 +734,25 @@ void RN_NET::GetAllItems( std::list<BOARD_CONNECTED_ITEM*>& aOutput, RN_ITEM_TYP
{ {
if( aType & RN_PADS ) if( aType & RN_PADS )
{ {
BOOST_FOREACH( const BOARD_CONNECTED_ITEM* item, m_pads | boost::adaptors::map_keys ) for( const BOARD_CONNECTED_ITEM* item : m_pads | boost::adaptors::map_keys )
aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) ); aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) );
} }
if( aType & RN_VIAS ) if( aType & RN_VIAS )
{ {
BOOST_FOREACH( const BOARD_CONNECTED_ITEM* item, m_vias | boost::adaptors::map_keys ) for( const BOARD_CONNECTED_ITEM* item : m_vias | boost::adaptors::map_keys )
aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) ); aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) );
} }
if( aType & RN_TRACKS ) if( aType & RN_TRACKS )
{ {
BOOST_FOREACH( const BOARD_CONNECTED_ITEM* item, m_tracks | boost::adaptors::map_keys ) for( const BOARD_CONNECTED_ITEM* item : m_tracks | boost::adaptors::map_keys )
aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) ); aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) );
} }
if( aType & RN_ZONES ) if( aType & RN_ZONES )
{ {
BOOST_FOREACH( const BOARD_CONNECTED_ITEM* item, m_zones | boost::adaptors::map_keys ) for( const BOARD_CONNECTED_ITEM* item : m_zones | boost::adaptors::map_keys )
aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) ); aOutput.push_back( const_cast<BOARD_CONNECTED_ITEM*>( item ) );
} }
} }
@ -760,7 +760,7 @@ void RN_NET::GetAllItems( std::list<BOARD_CONNECTED_ITEM*>& aOutput, RN_ITEM_TYP
void RN_NET::ClearSimple() void RN_NET::ClearSimple()
{ {
BOOST_FOREACH( const RN_NODE_PTR& node, m_blockedNodes ) for( const RN_NODE_PTR& node : m_blockedNodes )
node->SetFlag( false ); node->SetFlag( false );
m_blockedNodes.clear(); m_blockedNodes.clear();
@ -809,7 +809,7 @@ void RN_NET::GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem,
{ {
for( ZONE_DATA_MAP::const_iterator it = m_zones.begin(); it != m_zones.end(); ++it ) for( ZONE_DATA_MAP::const_iterator it = m_zones.begin(); it != m_zones.end(); ++it )
{ {
BOOST_FOREACH( const RN_EDGE_MST_PTR& edge, it->second.m_Edges ) for( const RN_EDGE_MST_PTR& edge : it->second.m_Edges )
{ {
if( edge->GetTag() == tag ) if( edge->GetTag() == tag )
{ {
@ -863,7 +863,7 @@ void RN_DATA::AddBlocked( const BOARD_ITEM* aItem )
return; return;
// Block all nodes belonging to the item // Block all nodes belonging to the item
BOOST_FOREACH( RN_NODE_PTR node, m_nets[net].GetNodes( item ) ) for( RN_NODE_PTR node : m_nets[net].GetNodes( item ) )
m_nets[net].AddBlockedNode( node ); m_nets[net].AddBlockedNode( node );
} }
else if( aItem->Type() == PCB_MODULE_T ) else if( aItem->Type() == PCB_MODULE_T )
@ -951,7 +951,7 @@ void RN_NET::processZones()
RN_ZONE_DATA& zoneData = it->second; RN_ZONE_DATA& zoneData = it->second;
// Reset existing connections // Reset existing connections
BOOST_FOREACH( RN_EDGE_MST_PTR edge, zoneData.m_Edges ) for( RN_EDGE_MST_PTR edge : zoneData.m_Edges )
m_links.RemoveConnection( edge ); m_links.RemoveConnection( edge );
zoneData.m_Edges.clear(); zoneData.m_Edges.clear();
@ -1006,7 +1006,7 @@ void RN_NET::processPads()
std::deque<RN_EDGE_MST_PTR>& edges = it->second.m_Edges; std::deque<RN_EDGE_MST_PTR>& edges = it->second.m_Edges;
// Reset existing connections // Reset existing connections
BOOST_FOREACH( RN_EDGE_MST_PTR edge, edges ) for( RN_EDGE_MST_PTR edge : edges )
m_links.RemoveConnection( edge ); m_links.RemoveConnection( edge );
LSET layers = pad->GetLayerSet(); LSET layers = pad->GetLayerSet();

View File

@ -37,7 +37,6 @@
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <boost/foreach.hpp>
#include <deque> #include <deque>
@ -687,7 +686,7 @@ public:
*/ */
void ClearSimple() void ClearSimple()
{ {
BOOST_FOREACH( RN_NET& net, m_nets ) for( RN_NET& net : m_nets )
net.ClearSimple(); net.ClearSimple();
} }

View File

@ -33,7 +33,6 @@
#include <pcb_painter.h> #include <pcb_painter.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <boost/foreach.hpp>
namespace KIGFX { namespace KIGFX {
@ -74,7 +73,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
aGal->SetStrokeColor( color.Brightened( 0.8 ) ); aGal->SetStrokeColor( color.Brightened( 0.8 ) );
// Draw the "dynamic" ratsnest (i.e. for objects that may be currently being moved) // Draw the "dynamic" ratsnest (i.e. for objects that may be currently being moved)
BOOST_FOREACH( const RN_NODE_PTR& node, net.GetSimpleNodes() ) for( const RN_NODE_PTR& node : net.GetSimpleNodes() )
{ {
// Skipping nodes with higher reference count avoids displaying redundant lines // Skipping nodes with higher reference count avoids displaying redundant lines
if( node->GetRefCount() > 1 ) if( node->GetRefCount() > 1 )
@ -100,7 +99,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
if( edges == NULL ) if( edges == NULL )
continue; continue;
BOOST_FOREACH( const RN_EDGE_MST_PTR& edge, *edges ) for( const RN_EDGE_MST_PTR& edge : *edges )
{ {
const RN_NODE_PTR& sourceNode = edge->GetSourceNode(); const RN_NODE_PTR& sourceNode = edge->GetSourceNode();
const RN_NODE_PTR& targetNode = edge->GetTargetNode(); const RN_NODE_PTR& targetNode = edge->GetTargetNode();

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "class_draw_panel_gal.h" #include "class_draw_panel_gal.h"

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
@ -281,7 +279,7 @@ const PNS_DIFF_PAIR PNS_DP_GATEWAY::Entry() const
void PNS_DP_GATEWAYS::BuildOrthoProjections( PNS_DP_GATEWAYS& aEntries, void PNS_DP_GATEWAYS::BuildOrthoProjections( PNS_DP_GATEWAYS& aEntries,
const VECTOR2I& aCursorPos, int aOrthoScore ) const VECTOR2I& aCursorPos, int aOrthoScore )
{ {
BOOST_FOREACH( PNS_DP_GATEWAY g, aEntries.Gateways() ) for( PNS_DP_GATEWAY g : aEntries.Gateways() )
{ {
VECTOR2I midpoint( ( g.AnchorP() + g.AnchorN() ) / 2 ); VECTOR2I midpoint( ( g.AnchorP() + g.AnchorN() ) / 2 );
SEG guide_s( midpoint, midpoint + VECTOR2I( 1, 0 ) ); SEG guide_s( midpoint, midpoint + VECTOR2I( 1, 0 ) );
@ -304,7 +302,7 @@ void PNS_DP_GATEWAYS::BuildOrthoProjections( PNS_DP_GATEWAYS& aEntries,
targets.BuildForCursor( proj ); targets.BuildForCursor( proj );
BOOST_FOREACH( PNS_DP_GATEWAY t, targets.Gateways() ) for( PNS_DP_GATEWAY t : targets.Gateways() )
{ {
t.SetPriority( aOrthoScore ); t.SetPriority( aOrthoScore );
m_gateways.push_back( t ); m_gateways.push_back( t );
@ -318,9 +316,9 @@ bool PNS_DP_GATEWAYS::FitGateways( PNS_DP_GATEWAYS& aEntry, PNS_DP_GATEWAYS& aTa
{ {
std::vector<DP_CANDIDATE> candidates; std::vector<DP_CANDIDATE> candidates;
BOOST_FOREACH( PNS_DP_GATEWAY g_entry, aEntry.Gateways() ) for( PNS_DP_GATEWAY g_entry : aEntry.Gateways() )
{ {
BOOST_FOREACH( PNS_DP_GATEWAY g_target, aTarget.Gateways() ) for( PNS_DP_GATEWAY g_target : aTarget.Gateways() )
{ {
for( int attempt = 0; attempt < 2; attempt++ ) for( int attempt = 0; attempt < 2; attempt++ )
{ {
@ -346,7 +344,7 @@ bool PNS_DP_GATEWAYS::FitGateways( PNS_DP_GATEWAYS& aEntry, PNS_DP_GATEWAYS& aTa
DP_CANDIDATE best; DP_CANDIDATE best;
bool found = false; bool found = false;
BOOST_FOREACH( DP_CANDIDATE c, candidates ) for( DP_CANDIDATE c : candidates )
{ {
if( c.score > bestScore ) if( c.score > bestScore )
{ {
@ -530,7 +528,7 @@ void PNS_DP_GATEWAYS::BuildForCursor( const VECTOR2I& aCursorPos )
void PNS_DP_GATEWAYS::buildEntries( const VECTOR2I& p0_p, const VECTOR2I& p0_n ) void PNS_DP_GATEWAYS::buildEntries( const VECTOR2I& p0_p, const VECTOR2I& p0_n )
{ {
BOOST_FOREACH( PNS_DP_GATEWAY &g, m_gateways ) for( PNS_DP_GATEWAY &g : m_gateways )
{ {
if( !g.HasEntryLines() ) if( !g.HasEntryLines() )
{ {

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <colors.h> #include <colors.h>
@ -532,7 +531,7 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
double bestDist = std::numeric_limits<double>::max(); double bestDist = std::numeric_limits<double>::max();
bool found = false; bool found = false;
BOOST_FOREACH( PNS_ITEM* item, items ) for( PNS_ITEM* item : items )
{ {
if( item->Kind() == aItem->Kind() ) if( item->Kind() == aItem->Kind() )
{ {

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
@ -128,14 +127,14 @@ int PNS_DP_MEANDER_PLACER::origPathLength() const
int totalP = 0; int totalP = 0;
int totalN = 0; int totalN = 0;
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathP.CItems() ) for( const PNS_ITEM* item : m_tunedPathP.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
totalP += l->CLine().Length(); totalP += l->CLine().Length();
} }
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathN.CItems() ) for( const PNS_ITEM* item : m_tunedPathN.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
totalN += l->CLine().Length(); totalN += l->CLine().Length();
@ -206,13 +205,13 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
m_result.SetBaselineOffset( offset ); m_result.SetBaselineOffset( offset );
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathP.CItems() ) for( const PNS_ITEM* item : m_tunedPathP.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
Router()->DisplayDebugLine( l->CLine(), 5, 10000 ); Router()->DisplayDebugLine( l->CLine(), 5, 10000 );
} }
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathN.CItems() ) for( const PNS_ITEM* item : m_tunedPathN.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
Router()->DisplayDebugLine( l->CLine(), 5, 10000 ); Router()->DisplayDebugLine( l->CLine(), 5, 10000 );
@ -220,7 +219,7 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
int curIndexP = 0, curIndexN = 0; int curIndexP = 0, curIndexN = 0;
BOOST_FOREACH( const PNS_DIFF_PAIR::COUPLED_SEGMENTS& sp, coupledSegments ) for( const PNS_DIFF_PAIR::COUPLED_SEGMENTS& sp : coupledSegments )
{ {
SEG base = baselineSegment( sp ); SEG base = baselineSegment( sp );
@ -267,7 +266,7 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
tunedP.Clear(); tunedP.Clear();
tunedN.Clear(); tunedN.Clear();
BOOST_FOREACH( PNS_MEANDER_SHAPE* m, m_result.Meanders() ) for( PNS_MEANDER_SHAPE* m : m_result.Meanders() )
{ {
if( m->Type() != MT_EMPTY ) if( m->Type() != MT_EMPTY )
{ {

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include "pns_dragger.h" #include "pns_dragger.h"
#include "pns_shove.h" #include "pns_shove.h"
#include "pns_router.h" #include "pns_router.h"
@ -86,7 +84,7 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia )
if( !jt ) if( !jt )
return false; return false;
BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) for( PNS_ITEM* item : jt->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::SEGMENT ) ) if( item->OfKind( PNS_ITEM::SEGMENT ) )
{ {
@ -193,7 +191,7 @@ void PNS_DRAGGER::dumbDragVia( PNS_VIA* aVia, PNS_NODE* aNode, const VECTOR2I& a
m_lastNode->Remove( aVia ); m_lastNode->Remove( aVia );
m_lastNode->Add( m_draggedVia ); m_lastNode->Add( m_draggedVia );
BOOST_FOREACH( PNS_ITEM* item, m_origViaConnections.Items() ) for( PNS_ITEM* item : m_origViaConnections.Items() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
{ {

View File

@ -24,7 +24,6 @@
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <map> #include <map>
#include <boost/foreach.hpp>
#include <boost/range/adaptor/map.hpp> #include <boost/range/adaptor/map.hpp>
#include <list> #include <list>

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include "pns_itemset.h" #include "pns_itemset.h"
#include "pns_line.h" #include "pns_line.h"
@ -53,7 +51,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterLayers( int aStart, int aEnd, bool aInvert )
else else
l = PNS_LAYERSET( aStart, aEnd ); l = PNS_LAYERSET( aStart, aEnd );
BOOST_FOREACH( const ENTRY& ent, m_items ) for( const ENTRY& ent : m_items )
{ {
if( ent.item->Layers().Overlaps( l ) ^ aInvert ) if( ent.item->Layers().Overlaps( l ) ^ aInvert )
{ {
@ -71,7 +69,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask, bool aInvert )
{ {
ENTRIES newItems; ENTRIES newItems;
BOOST_FOREACH( const ENTRY& ent, m_items ) for( const ENTRY& ent : m_items )
{ {
if( ent.item->OfKind( aKindMask ) ^ aInvert ) if( ent.item->OfKind( aKindMask ) ^ aInvert )
{ {
@ -89,7 +87,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterMarker( int aMarker, bool aInvert )
{ {
ENTRIES newItems; ENTRIES newItems;
BOOST_FOREACH( const ENTRY& ent, m_items ) for( const ENTRY& ent : m_items )
{ {
if( ent.item->Marker() & aMarker ) if( ent.item->Marker() & aMarker )
{ {
@ -107,7 +105,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
{ {
ENTRIES newItems; ENTRIES newItems;
BOOST_FOREACH( const ENTRY& ent, m_items ) for( const ENTRY& ent : m_items )
{ {
if( ( ent.item->Net() == aNet ) ^ aInvert ) if( ( ent.item->Net() == aNet ) ^ aInvert )
{ {
@ -125,7 +123,7 @@ PNS_ITEMSET& PNS_ITEMSET::ExcludeItem( const PNS_ITEM* aItem )
{ {
ENTRIES newItems; ENTRIES newItems;
BOOST_FOREACH( const ENTRY& ent, m_items ) for( const ENTRY& ent : m_items )
{ {
if( ent.item != aItem ) if( ent.item != aItem )

View File

@ -22,7 +22,6 @@
#define __PNS_ITEMSET_H #define __PNS_ITEMSET_H
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include "pns_item.h" #include "pns_item.h"
@ -118,7 +117,7 @@ public:
{ {
int n = 0; int n = 0;
BOOST_FOREACH( PNS_ITEM* item, m_items ) for( PNS_ITEM* item : m_items )
{ {
if( item->Kind() & aKindMask ) if( item->Kind() & aKindMask )
n++; n++;
@ -205,7 +204,7 @@ public:
{ {
int n = 0; int n = 0;
BOOST_FOREACH( const PNS_ITEM* item, m_items ) for( const PNS_ITEM* item : m_items )
{ {
if( item->OfKind( kind ) ) if( item->OfKind( kind ) )
{ {

View File

@ -145,7 +145,7 @@ public:
PNS_VIA* Via() PNS_VIA* Via()
{ {
BOOST_FOREACH( PNS_ITEM* item, m_linkedItems.Items() ) for( PNS_ITEM* item : m_linkedItems.Items() )
{ {
if( item->OfKind( VIA ) ) if( item->OfKind( VIA ) )
return static_cast<PNS_VIA*>( item ); return static_cast<PNS_VIA*>( item );
@ -208,7 +208,7 @@ public:
if( aJoint.IsLocked() ) if( aJoint.IsLocked() )
m_locked = true; m_locked = true;
BOOST_FOREACH( PNS_ITEM* item, aJoint.LinkList() ) for( PNS_ITEM* item : aJoint.LinkList() )
{ {
m_linkedItems.Add( item ); m_linkedItems.Add( item );
} }

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <math/vector2d.h> #include <math/vector2d.h>
@ -88,7 +87,7 @@ void PNS_LINE::Mark( int aMarker )
if( m_segmentRefs ) if( m_segmentRefs )
{ {
BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) for( PNS_SEGMENT* s : *m_segmentRefs )
s->Mark( aMarker ); s->Mark( aMarker );
} }
} }
@ -98,7 +97,7 @@ void PNS_LINE::Unmark()
{ {
if( m_segmentRefs ) if( m_segmentRefs )
{ {
BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) for( PNS_SEGMENT* s : *m_segmentRefs )
s->Unmark(); s->Unmark();
} }
@ -112,7 +111,7 @@ int PNS_LINE::Marker() const
if( m_segmentRefs ) if( m_segmentRefs )
{ {
BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) for( PNS_SEGMENT* s : *m_segmentRefs )
{ {
marker |= s->Marker(); marker |= s->Marker();
} }
@ -734,7 +733,7 @@ void PNS_LINE::SetRank( int aRank )
if( m_segmentRefs ) if( m_segmentRefs )
{ {
BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) for( PNS_SEGMENT* s : *m_segmentRefs )
s->SetRank( aRank ); s->SetRank( aRank );
} }
} }
@ -747,7 +746,7 @@ int PNS_LINE::Rank() const
if( m_segmentRefs ) if( m_segmentRefs )
{ {
BOOST_FOREACH( PNS_SEGMENT *s, *m_segmentRefs ) for( PNS_SEGMENT *s : *m_segmentRefs )
min_rank = std::min( min_rank, s->Rank() ); min_rank = std::min( min_rank, s->Rank() );
rank = ( min_rank == INT_MAX ) ? -1 : min_rank; rank = ( min_rank == INT_MAX ) ? -1 : min_rank;
} }

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <colors.h> #include <colors.h>
@ -121,7 +120,7 @@ bool PNS_LINE_PLACER::handleSelfIntersections()
// if there is more than one intersection, find the one that is // if there is more than one intersection, find the one that is
// closest to the beginning of the tail. // closest to the beginning of the tail.
BOOST_FOREACH( SHAPE_LINE_CHAIN::INTERSECTION i, ips ) for( SHAPE_LINE_CHAIN::INTERSECTION i : ips )
{ {
if( i.our.Index() < n ) if( i.our.Index() < n )
{ {
@ -971,13 +970,13 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE& aLatest )
int removedCount = 0; int removedCount = 0;
int total = 0; int total = 0;
BOOST_FOREACH( PNS_LINE& line, lines ) for( PNS_LINE& line : lines )
{ {
total++; total++;
if( !( line.ContainsSegment( seg ) ) && line.SegmentCount() ) if( !( line.ContainsSegment( seg ) ) && line.SegmentCount() )
{ {
BOOST_FOREACH( PNS_SEGMENT *ss, *line.LinkedSegments() ) for( PNS_SEGMENT *ss : *line.LinkedSegments() )
toErase.insert( ss ); toErase.insert( ss );
removedCount++; removedCount++;
@ -987,7 +986,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE& aLatest )
TRACE( 0, "total segs removed: %d/%d\n", removedCount % total ); TRACE( 0, "total segs removed: %d/%d\n", removedCount % total );
} }
BOOST_FOREACH( PNS_SEGMENT *s, toErase ) for( PNS_SEGMENT *s : toErase )
aNode->Remove( s ); aNode->Remove( s );
aNode->Remove( &aLatest ); aNode->Remove( &aLatest );

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include <colors.h> #include <colors.h>
@ -578,7 +576,7 @@ void PNS_MEANDERED_LINE::AddMeander( PNS_MEANDER_SHAPE* aShape )
void PNS_MEANDERED_LINE::Clear() void PNS_MEANDERED_LINE::Clear()
{ {
BOOST_FOREACH( PNS_MEANDER_SHAPE* m, m_meanders ) for( PNS_MEANDER_SHAPE* m : m_meanders )
{ {
delete m; delete m;
} }

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include <colors.h> #include <colors.h>
@ -94,7 +92,7 @@ bool PNS_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
int PNS_MEANDER_PLACER::origPathLength() const int PNS_MEANDER_PLACER::origPathLength() const
{ {
int total = 0; int total = 0;
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPath.CItems() ) for( const PNS_ITEM* item : m_tunedPath.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
{ {
@ -148,7 +146,7 @@ bool PNS_MEANDER_PLACER::doMove( const VECTOR2I& aP, PNS_ITEM* aEndItem, int aTa
tuneLineLength( m_result, aTargetLength - lineLen ); tuneLineLength( m_result, aTargetLength - lineLen );
} }
BOOST_FOREACH ( const PNS_ITEM* item, m_tunedPath.CItems() ) for( const PNS_ITEM* item : m_tunedPath.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
{ {
@ -160,7 +158,7 @@ bool PNS_MEANDER_PLACER::doMove( const VECTOR2I& aP, PNS_ITEM* aEndItem, int aTa
{ {
tuned.Clear(); tuned.Clear();
BOOST_FOREACH( PNS_MEANDER_SHAPE* m, m_result.Meanders() ) for( PNS_MEANDER_SHAPE* m : m_result.Meanders() )
{ {
if( m->Type() != MT_EMPTY ) if( m->Type() != MT_EMPTY )
{ {

View File

@ -108,7 +108,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE
int remaining = aElongation; int remaining = aElongation;
bool finished = false; bool finished = false;
BOOST_FOREACH( PNS_MEANDER_SHAPE* m, aTuned.Meanders() ) for( PNS_MEANDER_SHAPE* m : aTuned.Meanders() )
{ {
if( m->Type() != MT_CORNER ) if( m->Type() != MT_CORNER )
{ {
@ -140,7 +140,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE
remaining = aElongation; remaining = aElongation;
int meanderCount = 0; int meanderCount = 0;
BOOST_FOREACH(PNS_MEANDER_SHAPE* m, aTuned.Meanders()) for(PNS_MEANDER_SHAPE* m : aTuned.Meanders())
{ {
if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY ) if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY )
{ {
@ -159,7 +159,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE
if( balance >= 0 ) if( balance >= 0 )
{ {
BOOST_FOREACH( PNS_MEANDER_SHAPE* m, aTuned.Meanders() ) for( PNS_MEANDER_SHAPE* m : aTuned.Meanders() )
{ {
if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY ) if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY )
{ {

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <base_units.h> // God forgive me doing this... #include <base_units.h> // God forgive me doing this...
#include <colors.h> #include <colors.h>
@ -110,7 +108,7 @@ int PNS_MEANDER_SKEW_PLACER::origPathLength( ) const
int PNS_MEANDER_SKEW_PLACER::itemsetLength( const PNS_ITEMSET& aSet ) const int PNS_MEANDER_SKEW_PLACER::itemsetLength( const PNS_ITEMSET& aSet ) const
{ {
int total = 0; int total = 0;
BOOST_FOREACH( const PNS_ITEM* item, aSet.CItems() ) for( const PNS_ITEM* item : aSet.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
{ {
@ -130,13 +128,13 @@ int PNS_MEANDER_SKEW_PLACER::currentSkew() const
bool PNS_MEANDER_SKEW_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem ) bool PNS_MEANDER_SKEW_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
{ {
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathP.CItems() ) for( const PNS_ITEM* item : m_tunedPathP.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
Router()->DisplayDebugLine( l->CLine(), 5, 10000 ); Router()->DisplayDebugLine( l->CLine(), 5, 10000 );
} }
BOOST_FOREACH( const PNS_ITEM* item, m_tunedPathN.CItems() ) for( const PNS_ITEM* item : m_tunedPathN.CItems() )
{ {
if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) ) if( const PNS_LINE* l = dyn_cast<const PNS_LINE*>( item ) )
Router()->DisplayDebugLine( l->CLine(), 4, 10000 ); Router()->DisplayDebugLine( l->CLine(), 4, 10000 );

View File

@ -305,7 +305,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::NearestObstacle( const PNS_LINE* aItem,
nearest.m_item = NULL; nearest.m_item = NULL;
nearest.m_distFirst = INT_MAX; nearest.m_distFirst = INT_MAX;
BOOST_FOREACH( PNS_OBSTACLE obs, obs_list ) for( PNS_OBSTACLE obs : obs_list )
{ {
VECTOR2I ip_first, ip_last; VECTOR2I ip_first, ip_last;
int dist_max = INT_MIN; int dist_max = INT_MIN;
@ -327,7 +327,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::NearestObstacle( const PNS_LINE* aItem,
viaHull.Intersect( hull, isect_list ); viaHull.Intersect( hull, isect_list );
BOOST_FOREACH( SHAPE_LINE_CHAIN::INTERSECTION isect, isect_list ) for( SHAPE_LINE_CHAIN::INTERSECTION isect : isect_list )
{ {
int dist = aLine.CLine().Length() + int dist = aLine.CLine().Length() +
( isect.p - aLine.Via().Pos() ).EuclideanNorm(); ( isect.p - aLine.Via().Pos() ).EuclideanNorm();
@ -353,7 +353,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::NearestObstacle( const PNS_LINE* aItem,
hull.Intersect( aLine.CLine(), isect_list ); hull.Intersect( aLine.CLine(), isect_list );
BOOST_FOREACH( SHAPE_LINE_CHAIN::INTERSECTION isect, isect_list ) for( SHAPE_LINE_CHAIN::INTERSECTION isect : isect_list )
{ {
int dist = aLine.CLine().PathLength( isect.p ); int dist = aLine.CLine().PathLength( isect.p );
@ -386,7 +386,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::NearestObstacle( const PNS_LINE* aItem,
PNS_NODE::OPT_OBSTACLE PNS_NODE::CheckColliding( const PNS_ITEMSET& aSet, int aKindMask ) PNS_NODE::OPT_OBSTACLE PNS_NODE::CheckColliding( const PNS_ITEMSET& aSet, int aKindMask )
{ {
BOOST_FOREACH( const PNS_ITEM* item, aSet.CItems() ) for( const PNS_ITEM* item : aSet.CItems() )
{ {
OPT_OBSTACLE obs = CheckColliding( item, aKindMask ); OPT_OBSTACLE obs = CheckColliding( item, aKindMask );
@ -493,7 +493,7 @@ const PNS_ITEMSET PNS_NODE::HitTest( const VECTOR2I& aPoint ) const
HIT_VISITOR visitor_root( items_root, aPoint, m_root ); HIT_VISITOR visitor_root( items_root, aPoint, m_root );
m_root->m_index->Query( &s, m_maxClearance, visitor_root ); m_root->m_index->Query( &s, m_maxClearance, visitor_root );
BOOST_FOREACH( PNS_ITEM* item, items_root.Items() ) for( PNS_ITEM* item : items_root.Items() )
{ {
if( !overrides( item ) ) if( !overrides( item ) )
items.Add( item ); items.Add( item );
@ -640,7 +640,7 @@ void PNS_NODE::removeLine( PNS_LINE* aLine )
assert( segRefs != NULL ); assert( segRefs != NULL );
BOOST_FOREACH( PNS_SEGMENT* seg, *segRefs ) for( PNS_SEGMENT* seg : *segRefs )
{ {
removeSegment( seg ); removeSegment( seg );
} }
@ -686,7 +686,7 @@ void PNS_NODE::removeVia( PNS_VIA* aVia )
} while( split ); } while( split );
// and re-link them, using the former via's link list // and re-link them, using the former via's link list
BOOST_FOREACH(PNS_ITEM* item, links) for(PNS_ITEM* item : links)
{ {
if( item != aVia ) if( item != aVia )
linkJoint ( p, item->Layers(), net, item ); linkJoint ( p, item->Layers(), net, item );
@ -852,7 +852,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector<PNS_JOINT*>& aFo
PNS_JOINT* current = searchQueue.front(); PNS_JOINT* current = searchQueue.front();
searchQueue.pop_front(); searchQueue.pop_front();
BOOST_FOREACH( PNS_ITEM* item, current->LinkList() ) for( PNS_ITEM* item : current->LinkList() )
{ {
if ( item->OfKind( PNS_ITEM::SEGMENT ) ) if ( item->OfKind( PNS_ITEM::SEGMENT ) )
{ {
@ -870,7 +870,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector<PNS_JOINT*>& aFo
} }
} }
BOOST_FOREACH(PNS_JOINT* jt, processed) for(PNS_JOINT* jt : processed)
aFoundJoints.push_back( jt ); aFoundJoints.push_back( jt );
} }
#endif #endif
@ -878,7 +878,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector<PNS_JOINT*>& aFo
int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& aA, PNS_JOINT& aB, std::vector<PNS_LINE>& aLines ) int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& aA, PNS_JOINT& aB, std::vector<PNS_LINE>& aLines )
{ {
BOOST_FOREACH( PNS_ITEM* item, aA.LinkList() ) for( PNS_ITEM* item : aA.LinkList() )
{ {
if( item->Kind() == PNS_ITEM::SEGMENT ) if( item->Kind() == PNS_ITEM::SEGMENT )
{ {
@ -1113,7 +1113,7 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded )
if( isRoot() ) if( isRoot() )
return; return;
BOOST_FOREACH( PNS_ITEM* item, m_override ) for( PNS_ITEM* item : m_override )
aRemoved.push_back( item ); aRemoved.push_back( item );
for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i ) for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i )
@ -1125,7 +1125,7 @@ void PNS_NODE::releaseChildren()
// copy the kids as the PNS_NODE destructor erases the item from the parent node. // copy the kids as the PNS_NODE destructor erases the item from the parent node.
std::set<PNS_NODE*> kids = m_children; std::set<PNS_NODE*> kids = m_children;
BOOST_FOREACH( PNS_NODE* node, kids ) for( PNS_NODE* node : kids )
{ {
node->releaseChildren(); node->releaseChildren();
delete node; delete node;
@ -1138,7 +1138,7 @@ void PNS_NODE::releaseGarbage()
if( !isRoot() ) if( !isRoot() )
return; return;
BOOST_FOREACH( PNS_ITEM* item, m_garbageItems ) for( PNS_ITEM* item : m_garbageItems )
{ {
if( !item->BelongsTo( this ) ) if( !item->BelongsTo( this ) )
delete item; delete item;
@ -1153,7 +1153,7 @@ void PNS_NODE::Commit( PNS_NODE* aNode )
if( aNode->isRoot() ) if( aNode->isRoot() )
return; return;
BOOST_FOREACH( PNS_ITEM* item, aNode->m_override ) for( PNS_ITEM* item : aNode->m_override )
Remove( item ); Remove( item );
for( PNS_INDEX::ITEM_SET::iterator i = aNode->m_index->begin(); for( PNS_INDEX::ITEM_SET::iterator i = aNode->m_index->begin();
@ -1182,7 +1182,7 @@ void PNS_NODE::AllItemsInNet( int aNet, std::set<PNS_ITEM*>& aItems )
if( l_cur ) if( l_cur )
{ {
BOOST_FOREACH( PNS_ITEM*item, *l_cur ) for( PNS_ITEM*item : *l_cur )
aItems.insert( item ); aItems.insert( item );
} }
@ -1248,7 +1248,7 @@ PNS_SEGMENT* PNS_NODE::findRedundantSegment( PNS_SEGMENT* aSeg )
if( !jtStart ) if( !jtStart )
return NULL; return NULL;
BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) for( PNS_ITEM* item : jtStart->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::SEGMENT ) ) if( item->OfKind( PNS_ITEM::SEGMENT ) )
{ {
@ -1280,7 +1280,7 @@ PNS_ITEM *PNS_NODE::FindItemByParent( const BOARD_CONNECTED_ITEM* aParent )
{ {
PNS_INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() ); PNS_INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() );
BOOST_FOREACH( PNS_ITEM*item, *l_cur ) for( PNS_ITEM*item : *l_cur )
if( item->Parent() == aParent ) if( item->Parent() == aParent )
return item; return item;

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_rect.h> #include <geometry/shape_rect.h>
#include <geometry/shape_convex.h> #include <geometry/shape_convex.h>
@ -271,7 +269,7 @@ int LINE_RESTRICTIONS::allowedAngles( PNS_NODE* aWorld, const PNS_LINE* aLine, c
int n_dirs = 0; int n_dirs = 0;
BOOST_FOREACH( const PNS_ITEM* item, jt->Links().CItems() ) for( const PNS_ITEM* item : jt->Links().CItems() )
{ {
if( item->OfKind( PNS_ITEM::VIA ) || item->OfKind( PNS_ITEM::SOLID ) ) if( item->OfKind( PNS_ITEM::VIA ) || item->OfKind( PNS_ITEM::SOLID ) )
return 0xff; return 0xff;
@ -814,7 +812,7 @@ PNS_ITEM* PNS_OPTIMIZER::findPadOrVia( int aLayer, int aNet, const VECTOR2I& aP
if( !jt ) if( !jt )
return NULL; return NULL;
BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) for( PNS_ITEM* item : jt->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) ) if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) )
return item; return item;
@ -852,7 +850,7 @@ int PNS_OPTIMIZER::smartPadsSingle( PNS_LINE* aLine, PNS_ITEM* aPad, bool aEnd,
for( int p = 1; p <= p_end; p++ ) for( int p = 1; p <= p_end; p++ )
{ {
BOOST_FOREACH( SHAPE_LINE_CHAIN & l, breakouts ) { for( SHAPE_LINE_CHAIN & l : breakouts ) {
for( int diag = 0; diag < 2; diag++ ) for( int diag = 0; diag < 2; diag++ )
{ {
@ -900,7 +898,7 @@ int PNS_OPTIMIZER::smartPadsSingle( PNS_LINE* aLine, PNS_ITEM* aPad, bool aEnd,
bool found = false; bool found = false;
int p_best = -1; int p_best = -1;
BOOST_FOREACH( RtVariant& vp, variants ) for( RtVariant& vp : variants )
{ {
PNS_LINE tmp( *aLine, vp.second ); PNS_LINE tmp( *aLine, vp.second );
int cost = PNS_COST_ESTIMATOR::CornerCost( vp.second ); int cost = PNS_COST_ESTIMATOR::CornerCost( vp.second );

View File

@ -21,8 +21,6 @@
#include <cstdio> #include <cstdio>
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <view/view.h> #include <view/view.h>
#include <view/view_item.h> #include <view/view_item.h>
#include <view/view_group.h> #include <view/view_group.h>
@ -701,7 +699,7 @@ BOARD* PNS_ROUTER::GetBoard()
void PNS_ROUTER::eraseView() void PNS_ROUTER::eraseView()
{ {
BOOST_FOREACH( BOARD_ITEM* item, m_hiddenItems ) for( BOARD_ITEM* item : m_hiddenItems )
{ {
item->ViewSetVisible( true ); item->ViewSetVisible( true );
} }
@ -735,7 +733,7 @@ void PNS_ROUTER::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance
void PNS_ROUTER::DisplayItems( const PNS_ITEMSET& aItems ) void PNS_ROUTER::DisplayItems( const PNS_ITEMSET& aItems )
{ {
BOOST_FOREACH( const PNS_ITEM* item, aItems.CItems() ) for( const PNS_ITEM* item : aItems.CItems() )
DisplayItem( item ); DisplayItem( item );
} }
@ -796,7 +794,7 @@ void PNS_ROUTER::moveDragging( const VECTOR2I& aP, PNS_ITEM* aEndItem )
void PNS_ROUTER::markViolations( PNS_NODE* aNode, PNS_ITEMSET& aCurrent, void PNS_ROUTER::markViolations( PNS_NODE* aNode, PNS_ITEMSET& aCurrent,
PNS_NODE::ITEM_VECTOR& aRemoved ) PNS_NODE::ITEM_VECTOR& aRemoved )
{ {
BOOST_FOREACH( PNS_ITEM* item, aCurrent.Items() ) for( PNS_ITEM* item : aCurrent.Items() )
{ {
PNS_NODE::OBSTACLES obstacles; PNS_NODE::OBSTACLES obstacles;
@ -813,7 +811,7 @@ void PNS_ROUTER::markViolations( PNS_NODE* aNode, PNS_ITEMSET& aCurrent,
} }
} }
BOOST_FOREACH( PNS_OBSTACLE& obs, obstacles ) for( PNS_OBSTACLE& obs : obstacles )
{ {
int clearance = aNode->GetClearance( item, obs.m_item ); int clearance = aNode->GetClearance( item, obs.m_item );
std::unique_ptr<PNS_ITEM> tmp( obs.m_item->Clone() ); std::unique_ptr<PNS_ITEM> tmp( obs.m_item->Clone() );
@ -838,12 +836,12 @@ void PNS_ROUTER::updateView( PNS_NODE* aNode, PNS_ITEMSET& aCurrent )
aNode->GetUpdatedItems( removed, added ); aNode->GetUpdatedItems( removed, added );
BOOST_FOREACH( PNS_ITEM* item, added ) for( PNS_ITEM* item : added )
{ {
DisplayItem( item ); DisplayItem( item );
} }
BOOST_FOREACH( PNS_ITEM* item, removed ) for( PNS_ITEM* item : removed )
{ {
BOARD_CONNECTED_ITEM* parent = item->Parent(); BOARD_CONNECTED_ITEM* parent = item->Parent();
@ -878,7 +876,7 @@ void PNS_ROUTER::movePlacing( const VECTOR2I& aP, PNS_ITEM* aEndItem )
m_placer->Move( aP, aEndItem ); m_placer->Move( aP, aEndItem );
PNS_ITEMSET current = m_placer->Traces(); PNS_ITEMSET current = m_placer->Traces();
BOOST_FOREACH( const PNS_ITEM* item, current.CItems() ) for( const PNS_ITEM* item : current.CItems() )
{ {
if( !item->OfKind( PNS_ITEM::LINE ) ) if( !item->OfKind( PNS_ITEM::LINE ) )
continue; continue;
@ -914,7 +912,7 @@ void PNS_ROUTER::CommitRouting( PNS_NODE* aNode )
} }
} }
BOOST_FOREACH( PNS_ITEM* item, added ) for( PNS_ITEM* item : added )
{ {
BOARD_CONNECTED_ITEM* newBI = NULL; BOARD_CONNECTED_ITEM* newBI = NULL;
@ -1004,7 +1002,7 @@ void PNS_ROUTER::StopRouting()
std::vector<int> nets; std::vector<int> nets;
m_placer->GetModifiedNets( nets ); m_placer->GetModifiedNets( nets );
BOOST_FOREACH ( int n, nets ) for( int n : nets )
{ {
// Update the ratsnest with new changes // Update the ratsnest with new changes
m_board->GetRatsnest()->Recalculate( n ); m_board->GetRatsnest()->Recalculate( n );

View File

@ -23,8 +23,6 @@
#include <deque> #include <deque>
#include <cassert> #include <cassert>
#include <boost/foreach.hpp>
#include "trace.h" #include "trace.h"
#include "range.h" #include "range.h"
@ -223,7 +221,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::processHullSet( PNS_LINE& aCurrent, PNS_LINE&
{ {
PNS_JOINT* jtStart = m_currentNode->FindJoint( aCurrent.CPoint( 0 ), &aCurrent ); PNS_JOINT* jtStart = m_currentNode->FindJoint( aCurrent.CPoint( 0 ), &aCurrent );
BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) for( PNS_ITEM* item : jtStart->LinkList() )
{ {
if( m_currentNode->CheckColliding( item, &l ) ) if( m_currentNode->CheckColliding( item, &l ) )
colliding = true; colliding = true;
@ -254,7 +252,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ProcessSingleLine( PNS_LINE& aCurrent, PNS_LI
if( aObstacle.LinkedSegments() ) if( aObstacle.LinkedSegments() )
{ {
BOOST_FOREACH( PNS_SEGMENT* s, *aObstacle.LinkedSegments() ) for( PNS_SEGMENT* s : *aObstacle.LinkedSegments() )
if( s->Marker() & MK_HEAD ) if( s->Marker() & MK_HEAD )
{ {
@ -411,7 +409,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE
if( !jtStart ) if( !jtStart )
return SH_INCOMPLETE; return SH_INCOMPLETE;
BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) for( PNS_ITEM* item : jtStart->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::VIA ) ) if( item->OfKind( PNS_ITEM::VIA ) )
{ {
@ -430,7 +428,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE
#ifdef DEBUG #ifdef DEBUG
m_logger.NewGroup( "on-colliding-solid-cluster", m_iter ); m_logger.NewGroup( "on-colliding-solid-cluster", m_iter );
BOOST_FOREACH( PNS_ITEM* item, cluster ) for( PNS_ITEM* item : cluster )
{ {
m_logger.Log( item, 0, "cluster-entry" ); m_logger.Log( item, 0, "cluster-entry" );
} }
@ -601,7 +599,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
m_draggedViaHeadSet.Clear(); m_draggedViaHeadSet.Clear();
} }
BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) for( PNS_ITEM* item : jt->LinkList() )
{ {
if( PNS_SEGMENT* seg = dyn_cast<PNS_SEGMENT*>( item ) ) if( PNS_SEGMENT* seg = dyn_cast<PNS_SEGMENT*>( item ) )
{ {
@ -643,7 +641,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
m_logger.Log( pushedVia, 1, "pushed-via" ); m_logger.Log( pushedVia, 1, "pushed-via" );
#endif #endif
BOOST_FOREACH( LINE_PAIR lp, draggedLines ) for( LINE_PAIR lp : draggedLines )
{ {
if( lp.first.Marker() & MK_HEAD ) if( lp.first.Marker() & MK_HEAD )
{ {
@ -742,7 +740,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onReverseCollidingVia( PNS_LINE& aCurrent, PN
cur.RemoveVia(); cur.RemoveVia();
unwindStack( &aCurrent ); unwindStack( &aCurrent );
BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) for( PNS_ITEM* item : jt->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::SEGMENT ) && item->LayersOverlap( &aCurrent ) ) if( item->OfKind( PNS_ITEM::SEGMENT ) && item->LayersOverlap( &aCurrent ) )
{ {
@ -843,7 +841,7 @@ void PNS_SHOVE::unwindStack( PNS_ITEM* aItem )
if( !l->LinkedSegments() ) if( !l->LinkedSegments() )
return; return;
BOOST_FOREACH( PNS_SEGMENT* seg, *l->LinkedSegments() ) for( PNS_SEGMENT* seg : *l->LinkedSegments() )
unwindStack( seg ); unwindStack( seg );
} }
} }
@ -879,7 +877,7 @@ void PNS_SHOVE::popLine( )
if( !l.LinkedSegments() ) if( !l.LinkedSegments() )
continue; continue;
BOOST_FOREACH( PNS_SEGMENT *s, *l.LinkedSegments() ) for( PNS_SEGMENT *s : *l.LinkedSegments() )
{ {
if( i->ContainsSegment( s ) ) if( i->ContainsSegment( s ) )
{ {
@ -1153,7 +1151,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet
PNS_ITEMSET headSet; PNS_ITEMSET headSet;
BOOST_FOREACH( const PNS_ITEM* item, aHeadSet.CItems() ) for( const PNS_ITEM* item : aHeadSet.CItems() )
{ {
const PNS_LINE* headOrig = static_cast<const PNS_LINE*>( item ); const PNS_LINE* headOrig = static_cast<const PNS_LINE*>( item );
@ -1176,7 +1174,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet
m_currentNode->ClearRanks(); m_currentNode->ClearRanks();
int n = 0; int n = 0;
BOOST_FOREACH( const PNS_ITEM* item, aHeadSet.CItems() ) for( const PNS_ITEM* item : aHeadSet.CItems() )
{ {
const PNS_LINE* headOrig = static_cast<const PNS_LINE*>( item ); const PNS_LINE* headOrig = static_cast<const PNS_LINE*>( item );
PNS_LINE head( *headOrig ); PNS_LINE head( *headOrig );

View File

@ -59,7 +59,7 @@ int PNS_SIZES_SETTINGS::inheritTrackWidth( PNS_ITEM* aItem )
PNS_ITEMSET linkedSegs = jt->Links(); PNS_ITEMSET linkedSegs = jt->Links();
linkedSegs.ExcludeItem( aItem ).FilterKinds( PNS_ITEM::SEGMENT ); linkedSegs.ExcludeItem( aItem ).FilterKinds( PNS_ITEM::SEGMENT );
BOOST_FOREACH( PNS_ITEM* item, linkedSegs.Items() ) for( PNS_ITEM* item : linkedSegs.Items() )
{ {
int w = static_cast<PNS_SEGMENT*>( item )->Width(); int w = static_cast<PNS_SEGMENT*>( item )->Width();
mval = std::min( w, mval ); mval = std::min( w, mval );

View File

@ -20,7 +20,6 @@
#include <wx/numdlg.h> #include <wx/numdlg.h>
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
@ -133,7 +132,7 @@ PNS_ITEM* PNS_TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int a
PNS_ITEMSET candidates = m_router->QueryHoverItems( aWhere ); PNS_ITEMSET candidates = m_router->QueryHoverItems( aWhere );
BOOST_FOREACH( PNS_ITEM* item, candidates.Items() ) for( PNS_ITEM* item : candidates.Items() )
{ {
if( !IsCopperLayer( item->Layers().Start() ) ) if( !IsCopperLayer( item->Layers().Start() ) )
continue; continue;
@ -281,7 +280,7 @@ void PNS_TOOL_BASE::updateEndItem( TOOL_EVENT& aEvent )
std::vector<int> nets = m_router->GetCurrentNets(); std::vector<int> nets = m_router->GetCurrentNets();
BOOST_FOREACH( int net, nets ) for( int net : nets )
{ {
endItem = pickSingleItem( p, net, layer ); endItem = pickSingleItem( p, net, layer );

View File

@ -68,7 +68,7 @@ const PNS_TOPOLOGY::JOINT_SET PNS_TOPOLOGY::ConnectedJoints( PNS_JOINT* aStart )
PNS_JOINT* current = searchQueue.front(); PNS_JOINT* current = searchQueue.front();
searchQueue.pop_front(); searchQueue.pop_front();
BOOST_FOREACH( PNS_ITEM* item, current->LinkList() ) for( PNS_ITEM* item : current->LinkList() )
{ {
if( item->OfKind( PNS_ITEM::SEGMENT ) ) if( item->OfKind( PNS_ITEM::SEGMENT ) )
{ {
@ -136,9 +136,9 @@ PNS_ITEM* PNS_TOPOLOGY::NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor,
m_world->AllItemsInNet( aStart->Net(), disconnected ); m_world->AllItemsInNet( aStart->Net(), disconnected );
BOOST_FOREACH( const PNS_JOINT* jt, ConnectedJoints( aStart ) ) for( const PNS_JOINT* jt : ConnectedJoints( aStart ) )
{ {
BOOST_FOREACH( PNS_ITEM* link, jt->LinkList() ) for( PNS_ITEM* link : jt->LinkList() )
{ {
if( disconnected.find( link ) != disconnected.end() ) if( disconnected.find( link ) != disconnected.end() )
disconnected.erase( link ); disconnected.erase( link );
@ -148,7 +148,7 @@ PNS_ITEM* PNS_TOPOLOGY::NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor,
int best_dist = INT_MAX; int best_dist = INT_MAX;
PNS_ITEM* best = NULL; PNS_ITEM* best = NULL;
BOOST_FOREACH( PNS_ITEM* item, disconnected ) for( PNS_ITEM* item : disconnected )
{ {
if( item->OfKind( aKindMask ) ) if( item->OfKind( aKindMask ) )
{ {
@ -188,7 +188,7 @@ bool PNS_TOPOLOGY::followTrivialPath( PNS_LINE* aLine, bool aLeft, PNS_ITEMSET&
PNS_ITEM* via = NULL; PNS_ITEM* via = NULL;
PNS_SEGMENT* next_seg = NULL; PNS_SEGMENT* next_seg = NULL;
BOOST_FOREACH( PNS_ITEM* link, jt->Links().Items() ) for( PNS_ITEM* link : jt->Links().Items() )
{ {
if( link->OfKind( PNS_ITEM::VIA ) ) if( link->OfKind( PNS_ITEM::VIA ) )
via = link; via = link;
@ -346,7 +346,7 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair )
if( ( refSeg = dyn_cast<PNS_SEGMENT*>( aStart ) ) != NULL ) if( ( refSeg = dyn_cast<PNS_SEGMENT*>( aStart ) ) != NULL )
{ {
BOOST_FOREACH( PNS_ITEM* item, coupledItems ) for( PNS_ITEM* item : coupledItems )
{ {
if( PNS_SEGMENT* s = dyn_cast<PNS_SEGMENT*>( item ) ) if( PNS_SEGMENT* s = dyn_cast<PNS_SEGMENT*>( item ) )
{ {
@ -419,7 +419,7 @@ const std::set<PNS_ITEM*> PNS_TOPOLOGY::AssembleCluster( PNS_ITEM* aStart, int a
m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY, -1, false, 0 ); m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY, -1, false, 0 );
BOOST_FOREACH( PNS_OBSTACLE& obs, obstacles ) for( PNS_OBSTACLE& obs : obstacles )
{ {
if( visited.find( obs.m_item ) == visited.end() && obs.m_item->Layers().Overlaps( aLayer ) && !( obs.m_item->Marker() & MK_HEAD ) ) if( visited.find( obs.m_item ) == visited.end() && obs.m_item->Layers().Overlaps( aLayer ) && !( obs.m_item->Marker() & MK_HEAD ) )
{ {

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>

View File

@ -20,7 +20,6 @@
#include <wx/numdlg.h> #include <wx/numdlg.h>
#include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;

View File

@ -22,8 +22,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <boost/foreach.hpp>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include "edit_points.h" #include "edit_points.h"
@ -74,7 +72,7 @@ int EDIT_POINTS::GetContourStartIdx( int aPointIdx ) const
{ {
int lastIdx = 0; int lastIdx = 0;
BOOST_FOREACH( int idx, m_contours ) for( int idx : m_contours )
{ {
if( idx >= aPointIdx ) if( idx >= aPointIdx )
return lastIdx; return lastIdx;
@ -88,7 +86,7 @@ int EDIT_POINTS::GetContourStartIdx( int aPointIdx ) const
int EDIT_POINTS::GetContourEndIdx( int aPointIdx ) const int EDIT_POINTS::GetContourEndIdx( int aPointIdx ) const
{ {
BOOST_FOREACH( int idx, m_contours ) for( int idx : m_contours )
{ {
if( idx >= aPointIdx ) if( idx >= aPointIdx )
return idx; return idx;
@ -100,7 +98,7 @@ int EDIT_POINTS::GetContourEndIdx( int aPointIdx ) const
bool EDIT_POINTS::IsContourStart( int aPointIdx ) const bool EDIT_POINTS::IsContourStart( int aPointIdx ) const
{ {
BOOST_FOREACH( int idx, m_contours ) for( int idx : m_contours )
{ {
if( idx + 1 == aPointIdx ) if( idx + 1 == aPointIdx )
return true; return true;
@ -116,7 +114,7 @@ bool EDIT_POINTS::IsContourStart( int aPointIdx ) const
bool EDIT_POINTS::IsContourEnd( int aPointIdx ) const bool EDIT_POINTS::IsContourEnd( int aPointIdx ) const
{ {
BOOST_FOREACH( int idx, m_contours ) for( int idx : m_contours )
{ {
if( idx == aPointIdx ) if( idx == aPointIdx )
return true; return true;
@ -215,10 +213,10 @@ void EDIT_POINTS::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
float size = m_view->ToWorld( EDIT_POINT::POINT_SIZE ); float size = m_view->ToWorld( EDIT_POINT::POINT_SIZE );
BOOST_FOREACH( const EDIT_POINT& point, m_points ) for( const EDIT_POINT& point : m_points )
aGal->DrawRectangle( point.GetPosition() - size / 2, point.GetPosition() + size / 2 ); aGal->DrawRectangle( point.GetPosition() - size / 2, point.GetPosition() + size / 2 );
BOOST_FOREACH( const EDIT_LINE& line, m_lines ) for( const EDIT_LINE& line : m_lines )
{ {
aGal->DrawCircle( line.GetPosition(), size / 2 ); aGal->DrawCircle( line.GetPosition(), size / 2 );
} }

View File

@ -43,7 +43,6 @@
#include <confirm.h> #include <confirm.h>
#include <cassert> #include <cassert>
#include <boost/foreach.hpp>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
@ -976,7 +975,7 @@ void EDIT_TOOL::processUndoBuffer( const PICKED_ITEMS_LIST* aLastChange )
const std::vector<PICKED_ITEMS_LIST*>& undoList = editFrame->GetScreen()->m_UndoList.m_CommandsList; const std::vector<PICKED_ITEMS_LIST*>& undoList = editFrame->GetScreen()->m_UndoList.m_CommandsList;
bool process = false; bool process = false;
BOOST_FOREACH( const PICKED_ITEMS_LIST* list, undoList ) for( const PICKED_ITEMS_LIST* list : undoList )
{ {
if( process ) if( process )
processPickedList( list ); processPickedList( list );
@ -988,7 +987,7 @@ void EDIT_TOOL::processUndoBuffer( const PICKED_ITEMS_LIST* aLastChange )
// then the undo list must have been completely altered, so process everything // then the undo list must have been completely altered, so process everything
if( !process ) if( !process )
{ {
BOOST_FOREACH( const PICKED_ITEMS_LIST* list, undoList ) for( const PICKED_ITEMS_LIST* list : undoList )
processPickedList( list ); processPickedList( list );
} }
} }

View File

@ -22,7 +22,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <boost/foreach.hpp>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
@ -219,7 +218,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, BOARD_ITEM* aDrag
clearAnchors(); clearAnchors();
BOOST_FOREACH( BOARD_ITEM* item, queryVisible( bb ) ) for( BOARD_ITEM* item : queryVisible( bb ) )
{ {
computeAnchors( item, aOrigin ); computeAnchors( item, aOrigin );
} }
@ -370,7 +369,7 @@ GRID_HELPER::ANCHOR* GRID_HELPER::nearestAnchor( const VECTOR2I& aPos, int aFlag
double minDist = std::numeric_limits<double>::max(); double minDist = std::numeric_limits<double>::max();
ANCHOR* best = NULL; ANCHOR* best = NULL;
BOOST_FOREACH( ANCHOR& a, m_anchors ) for( ANCHOR& a : m_anchors )
{ {
if( !aMatchLayers[a.item->GetLayer()] ) if( !aMatchLayers[a.item->GetLayer()] )
continue; continue;

View File

@ -46,7 +46,6 @@
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
#include <boost/foreach.hpp>
#include <wx/defs.h> #include <wx/defs.h>
MODULE_TOOLS::MODULE_TOOLS() : MODULE_TOOLS::MODULE_TOOLS() :
@ -280,7 +279,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
selectedPads.unique(); selectedPads.unique();
} }
BOOST_FOREACH( D_PAD* pad, selectedPads ) for( D_PAD* pad : selectedPads )
{ {
std::set<D_PAD*>::iterator it = allPads.find( pad ); std::set<D_PAD*>::iterator it = allPads.find( pad );
@ -311,7 +310,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
m_frame->OnModify(); m_frame->OnModify();
m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT ); m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT );
BOOST_FOREACH( D_PAD* pad, pads ) for( D_PAD* pad : pads )
{ {
pad->SetPadName( wxString::Format( wxT( "%s%d" ), padPrefix.c_str(), padNumber++ ) ); pad->SetPadName( wxString::Format( wxT( "%s%d" ), padPrefix.c_str(), padNumber++ ) );
pad->ViewUpdate(); pad->ViewUpdate();
@ -326,7 +325,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
} }
} }
BOOST_FOREACH( D_PAD* pad, pads ) for( D_PAD* pad : pads )
pad->ClearSelected(); pad->ClearSelected();
m_frame->DisplayToolMsg( wxEmptyString ); m_frame->DisplayToolMsg( wxEmptyString );
@ -550,7 +549,7 @@ int MODULE_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
bool enable = !settings->GetSketchMode( layers[0] ); bool enable = !settings->GetSketchMode( layers[0] );
BOOST_FOREACH( LAYER_NUM layer, layers ) for( LAYER_NUM layer : layers )
settings->SetSketchMode( layer, enable ); settings->SetSketchMode( layer, enable );
for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() ) for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() )
@ -584,7 +583,7 @@ int MODULE_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
bool enable = !settings->GetSketchMode( layers[0] ); bool enable = !settings->GetSketchMode( layers[0] );
BOOST_FOREACH( LAYER_NUM layer, layers ) for( LAYER_NUM layer : layers )
settings->SetSketchMode( layer, enable ); settings->SetSketchMode( layer, enable );
for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() ) for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() )

View File

@ -32,7 +32,6 @@
#include <ratsnest_data.h> #include <ratsnest_data.h>
#include <confirm.h> #include <confirm.h>
#include <boost/foreach.hpp>
PLACEMENT_TOOL::PLACEMENT_TOOL() : PLACEMENT_TOOL::PLACEMENT_TOOL() :
TOOL_INTERACTIVE( "pcbnew.Placement" ), m_selectionTool( NULL ), m_placementMenu( NULL ) TOOL_INTERACTIVE( "pcbnew.Placement" ), m_selectionTool( NULL ), m_placementMenu( NULL )
@ -277,7 +276,7 @@ int PLACEMENT_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent )
// Distance between items // Distance between items
const int distance = ( maxX - position ) / ( itemsList.size() - 1 ); const int distance = ( maxX - position ) / ( itemsList.size() - 1 );
BOOST_FOREACH( BOARD_ITEM* item, itemsList ) for( BOARD_ITEM* item : itemsList )
{ {
int difference = position - item->GetBoundingBox().Centre().x; int difference = position - item->GetBoundingBox().Centre().x;
@ -324,7 +323,7 @@ int PLACEMENT_TOOL::DistributeVertically( const TOOL_EVENT& aEvent )
// Distance between items // Distance between items
const int distance = ( maxY - position ) / ( itemsList.size() - 1 ); const int distance = ( maxY - position ) / ( itemsList.size() - 1 );
BOOST_FOREACH( BOARD_ITEM* item, itemsList ) for( BOARD_ITEM* item : itemsList )
{ {
int difference = position - item->GetBoundingBox().Centre().y; int difference = position - item->GetBoundingBox().Centre().y;

View File

@ -24,7 +24,6 @@
*/ */
#include <limits> #include <limits>
#include <boost/foreach.hpp>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
@ -670,7 +669,7 @@ int SELECTION_TOOL::selectCopper( const TOOL_EVENT& aEvent )
ratsnest->GetConnectedItems( item, itemsList, (RN_ITEM_TYPE)( RN_TRACKS | RN_VIAS ) ); ratsnest->GetConnectedItems( item, itemsList, (RN_ITEM_TYPE)( RN_TRACKS | RN_VIAS ) );
BOOST_FOREACH( BOARD_CONNECTED_ITEM* i, itemsList ) for( BOARD_CONNECTED_ITEM* i : itemsList )
select( i ); select( i );
// Inform other potentially interested tools // Inform other potentially interested tools
@ -695,7 +694,7 @@ int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent )
clearSelection(); clearSelection();
ratsnest->GetNetItems( netCode, itemsList, (RN_ITEM_TYPE)( RN_TRACKS | RN_VIAS ) ); ratsnest->GetNetItems( netCode, itemsList, (RN_ITEM_TYPE)( RN_TRACKS | RN_VIAS ) );
BOOST_FOREACH( BOARD_CONNECTED_ITEM* i, itemsList ) for( BOARD_CONNECTED_ITEM* i : itemsList )
select( i ); select( i );
// Inform other potentially interested tools // Inform other potentially interested tools
@ -1194,7 +1193,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
{ {
aCollector.Empty(); aCollector.Empty();
BOOST_FOREACH( BOARD_ITEM* item, preferred ) for( BOARD_ITEM* item : preferred )
aCollector.Append( item ); aCollector.Append( item );
return; return;
} }
@ -1364,7 +1363,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
if( (unsigned) aCollector.GetCount() > rejected.size() ) // do not remove everything if( (unsigned) aCollector.GetCount() > rejected.size() ) // do not remove everything
{ {
BOOST_FOREACH( BOARD_ITEM* item, rejected ) for( BOARD_ITEM* item : rejected )
{ {
aCollector.Remove( item ); aCollector.Remove( item );
} }
@ -1405,7 +1404,7 @@ bool SELECTION_TOOL::SanitizeSelection()
if( !rejected.empty() ) if( !rejected.empty() )
{ {
BOOST_FOREACH( BOARD_ITEM* item, rejected ) for( BOARD_ITEM* item : rejected )
unselect( item ); unselect( item );
// Inform other potentially interested tools // Inform other potentially interested tools
@ -1414,7 +1413,7 @@ bool SELECTION_TOOL::SanitizeSelection()
if( !added.empty() ) if( !added.empty() )
{ {
BOOST_FOREACH( BOARD_ITEM* item, added ) for( BOARD_ITEM* item : added )
select( item ); select( item );
// Inform other potentially interested tools // Inform other potentially interested tools

View File

@ -69,8 +69,6 @@
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
#include <geometry/shape_file_io.h> #include <geometry/shape_file_io.h>
#include <boost/foreach.hpp>
/* DEBUG OPTION: /* DEBUG OPTION:
* To emit zone data to a file when filling zones for the debugging purposes, * To emit zone data to a file when filling zones for the debugging purposes,
* set this 'true' and build. * set this 'true' and build.