diff --git a/common/config_params.cpp b/common/config_params.cpp index 1882ac1914..9737e8ec2c 100644 --- a/common/config_params.cpp +++ b/common/config_params.cpp @@ -37,15 +37,13 @@ #include -#include - void wxConfigLoadParams( wxConfigBase* aCfg, const PARAM_CFG_ARRAY& aList, const wxString& aGroup ) { wxASSERT( aCfg ); - BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) + for( const PARAM_CFG_BASE& param : aList ) { if( !!param.m_Group ) aCfg->SetPath( param.m_Group ); @@ -64,7 +62,7 @@ void wxConfigLoadSetups( wxConfigBase* aCfg, const PARAM_CFG_ARRAY& aList ) { wxASSERT( aCfg ); - BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) + for( const PARAM_CFG_BASE& param : aList ) { if( !param.m_Setup ) continue; @@ -79,7 +77,7 @@ void wxConfigSaveParams( wxConfigBase* aCfg, { wxASSERT( aCfg ); - BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) + for( const PARAM_CFG_BASE& param : aList ) { if( !!param.m_Group ) aCfg->SetPath( param.m_Group ); @@ -106,7 +104,7 @@ void wxConfigSaveSetups( wxConfigBase* aCfg, const PARAM_CFG_ARRAY& aList ) { wxASSERT( aCfg ); - BOOST_FOREACH( const PARAM_CFG_BASE& param, aList ) + for( const PARAM_CFG_BASE& param : aList ) { if( !param.m_Setup ) continue; diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp index c9dca09cff..244abfc4c2 100644 --- a/common/dialogs/wx_html_report_panel.cpp +++ b/common/dialogs/wx_html_report_panel.cpp @@ -22,7 +22,7 @@ #include "wx_html_report_panel.h" #include -#include + WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent, wxWindowID id, @@ -103,7 +103,7 @@ void WX_HTML_REPORT_PANEL::refreshView() { wxString html; - BOOST_FOREACH( REPORT_LINE l, m_report ) + for( REPORT_LINE l : m_report ) { html += generateHtml( l ); } @@ -260,7 +260,7 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event ) return; } - BOOST_FOREACH( REPORT_LINE l, m_report ) + for( REPORT_LINE l : m_report ) { f.Write( generatePlainText( l ) ); } diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index dfd74f59dc..fd48d83b7d 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -39,7 +39,6 @@ #include #include -#include #ifdef PROFILE #include @@ -95,7 +94,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE }; - BOOST_FOREACH( wxEventType eventType, events ) + for( wxEventType eventType : events ) { Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, m_eventDispatcher ); @@ -260,7 +259,7 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher ) if( m_eventDispatcher ) { - BOOST_FOREACH( wxEventType type, eventTypes ) + for( wxEventType type : eventTypes ) { m_parent->Connect( type, wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ), NULL, m_eventDispatcher ); @@ -268,7 +267,7 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher ) } else { - BOOST_FOREACH( wxEventType type, eventTypes ) + for( wxEventType type : eventTypes ) { // While loop is used to be sure that all event handlers are removed. while( m_parent->Disconnect( type, diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index 1a84d6630f..dab09cf9e8 100644 --- a/common/footprint_info.cpp +++ b/common/footprint_info.cpp @@ -266,7 +266,7 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName ) if( aFootprintName.IsEmpty() ) return NULL; - BOOST_FOREACH( FOOTPRINT_INFO& fp, m_list ) + for( FOOTPRINT_INFO& fp : m_list ) { FPID fpid; diff --git a/common/geometry/hetriang.cpp b/common/geometry/hetriang.cpp index 8383a8e1b4..01d8405a7c 100644 --- a/common/geometry/hetriang.cpp +++ b/common/geometry/hetriang.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include @@ -60,7 +59,7 @@ void NODE::updateLayers() { 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(); } @@ -329,7 +328,7 @@ bool TRIANGULATION::removeLeadingEdgeFromList( EDGE_PTR& aLeadingEdge ) void TRIANGULATION::cleanAll() { - BOOST_FOREACH( EDGE_PTR& edge, m_leadingEdges ) + for( EDGE_PTR& edge : m_leadingEdges ) edge->SetNextEdgeInFace( EDGE_PTR() ); } diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index cecc12bce9..1ea09d5586 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -32,8 +32,6 @@ #include #include -#include - #include #include #include @@ -214,13 +212,13 @@ void SHAPE_POLY_SET::booleanOp( ClipType aType, const SHAPE_POLY_SET& aOtherShap if( aFastMode == PM_STRICTLY_SIMPLE ) 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++ ) 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++ ) 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 ) 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++ ) 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++ ) 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; - BOOST_FOREACH( const POLYGON& poly, m_polys ) + for( const POLYGON& poly : m_polys ) { for( unsigned int i = 0; i < poly.size(); i++ ) 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; - BOOST_FOREACH( SHAPE_LINE_CHAIN& path, paths ) + for( SHAPE_LINE_CHAIN& path : paths ) { int index = 0; @@ -580,7 +578,7 @@ void SHAPE_POLY_SET::Fracture( POLYGON_MODE aFastMode ) { Simplify( aFastMode ); // remove overlapping holes/degeneracy - BOOST_FOREACH( POLYGON& paths, m_polys ) + for( POLYGON& paths : m_polys ) { fractureSingle( paths ); } @@ -725,7 +723,7 @@ bool SHAPE_POLY_SET::Contains( const VECTOR2I& aP, int aSubpolyIndex ) const if( 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 ) 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 ) { - 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 ); } @@ -819,9 +817,9 @@ int SHAPE_POLY_SET::TotalVertices() const { 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(); } diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index fcf2006efb..e1cbb0b2aa 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -39,7 +38,7 @@ ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) : // Register known actions std::list& actionList = GetActionList(); - BOOST_FOREACH( TOOL_ACTION* action, actionList ) + for( TOOL_ACTION* action : actionList ) { if( action->m_id == -1 ) 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* 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 ) { @@ -198,7 +197,7 @@ void ACTION_MANAGER::UpdateHotKeys() m_actionHotKeys.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 ); @@ -211,11 +210,11 @@ void ACTION_MANAGER::UpdateHotKeys() #ifndef NDEBUG // Check if there are two global actions assigned to the same hotkey - BOOST_FOREACH( std::list& action_list, m_actionHotKeys | boost::adaptors::map_values ) + for( std::list& action_list : m_actionHotKeys | boost::adaptors::map_values ) { int global_actions_cnt = 0; - BOOST_FOREACH( TOOL_ACTION* action, action_list ) + for( TOOL_ACTION* action : action_list ) { if( action->GetScope() == AS_GLOBAL ) ++global_actions_cnt; diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 4ee9ebc326..bb7bfcda1c 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -35,7 +35,6 @@ #include #include -#include ///> Stores information about a mouse button state struct TOOL_DISPATCHER::BUTTON_STATE @@ -131,14 +130,14 @@ TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr ) : TOOL_DISPATCHER::~TOOL_DISPATCHER() { - BOOST_FOREACH( BUTTON_STATE* st, m_buttons ) + for( BUTTON_STATE* st : m_buttons ) delete st; } void TOOL_DISPATCHER::ResetState() { - BOOST_FOREACH( BUTTON_STATE* st, m_buttons ) + for( BUTTON_STATE* st : m_buttons ) st->Reset(); } diff --git a/common/tool/tool_event.cpp b/common/tool/tool_event.cpp index 68518a2d50..f46ca0d1fb 100644 --- a/common/tool/tool_event.cpp +++ b/common/tool/tool_event.cpp @@ -29,7 +29,6 @@ #include #include -#include struct FlagString { @@ -155,7 +154,7 @@ const std::string TOOL_EVENT_LIST::Format() const { std::string s; - BOOST_FOREACH( TOOL_EVENT e, m_events ) + for( TOOL_EVENT e : m_events ) s += e.Format() + " "; return s; diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index 836b97850a..f40cdc3600 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -434,7 +433,7 @@ void TOOL_MANAGER::ResetTools( TOOL_BASE::RESET_REASON aReason ) TOOL_EVENT evt( TC_COMMAND, TA_ACTIVATE, "" ); // deactivate the active tool 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->SetTransitions(); @@ -490,7 +489,7 @@ optional TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent ) { // iterate over all registered tools - BOOST_FOREACH( TOOL_ID toolId, m_activeTools ) + for( TOOL_ID toolId : m_activeTools ) { 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 // Go() method that match the event. if( !st->pendingWait && !st->transitions.empty() ) { - BOOST_FOREACH( TRANSITION& tr, st->transitions ) + for( TRANSITION& tr : st->transitions ) { 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 ) { - BOOST_FOREACH( TOOL_ID toolId, m_activeTools ) + for( TOOL_ID toolId : m_activeTools ) { TOOL_STATE* st = m_toolIdIndex[toolId]; diff --git a/common/view/view.cpp b/common/view/view.cpp index d3553c0152..c58193b5b5 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include @@ -66,7 +65,7 @@ VIEW::VIEW( bool aIsDynamic ) : VIEW::~VIEW() { - BOOST_FOREACH( LAYER_MAP::value_type& l, m_layers ) + for( LAYER_MAP::value_type& l : m_layers ) delete l.second.items; } @@ -576,7 +575,7 @@ void VIEW::UpdateAllLayersOrder() { sortLayers(); - BOOST_FOREACH( LAYER_MAP::value_type& l, m_layers ) + for( LAYER_MAP::value_type& l : m_layers ) { ChangeLayerDepth( l.first, l.second.renderingOrder ); } @@ -612,7 +611,7 @@ struct VIEW::drawItem 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 ) ) { @@ -727,7 +726,7 @@ void VIEW::Clear() r.SetMaximum(); - BOOST_FOREACH( VIEW_ITEM* item, m_needsUpdate ) + for( VIEW_ITEM* item : m_needsUpdate ) item->clearUpdateFlags(); m_needsUpdate.clear(); @@ -1015,7 +1014,7 @@ void VIEW::UpdateItems() { m_gal->BeginUpdate(); - BOOST_FOREACH( VIEW_ITEM* item, m_needsUpdate ) + for( VIEW_ITEM* item : m_needsUpdate ) { assert( item->viewRequiredUpdate() != VIEW_ITEM::NONE ); @@ -1054,7 +1053,7 @@ const BOX2I VIEW::CalculateExtents() BOX2I fullScene; fullScene.SetMaximum(); - BOOST_FOREACH( VIEW_LAYER* l, m_orderedLayers ) + for( VIEW_LAYER* l : m_orderedLayers ) { l->items->Query( fullScene, v ); } diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index 1459954902..afcd7af04a 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include using namespace KIGFX; @@ -91,7 +90,7 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const PAINTER* painter = m_view->GetPainter(); // Draw all items immediately (without caching) - BOOST_FOREACH( VIEW_ITEM* item, m_items ) + for( VIEW_ITEM* item : m_items ) { aGal->PushDepth(); @@ -125,7 +124,7 @@ void VIEW_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const void VIEW_GROUP::FreeItems() { - BOOST_FOREACH( VIEW_ITEM* item, m_items ) + for( VIEW_ITEM* item : m_items ) { delete item; } diff --git a/common/worksheet_viewitem.cpp b/common/worksheet_viewitem.cpp index 5a8e27c5d6..9c09a24ddf 100644 --- a/common/worksheet_viewitem.cpp +++ b/common/worksheet_viewitem.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include 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 { std::deque corners; - BOOST_FOREACH( wxPoint point, aItem->m_Corners ) + for( wxPoint point : aItem->m_Corners ) { corners.push_back( VECTOR2D( point ) ); } diff --git a/eeschema/autoplace_fields.cpp b/eeschema/autoplace_fields.cpp index 7eed5083b5..cccf155c7f 100644 --- a/eeschema/autoplace_fields.cpp +++ b/eeschema/autoplace_fields.cpp @@ -50,6 +50,8 @@ * 2. Round to a 50-mil grid coordinate if desired */ +#include + #include #include #include @@ -59,7 +61,6 @@ #include #include #include -#include #include #include @@ -187,7 +188,7 @@ protected: int max_field_width = 0; int total_height = 0; - BOOST_FOREACH( SCH_FIELD* field, m_fields ) + for( SCH_FIELD* field : m_fields ) { int field_width; int field_height; @@ -248,7 +249,7 @@ protected: std::vector 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 ) continue; @@ -277,7 +278,7 @@ protected: std::vector fields; comp->GetFields( fields, /* aVisibleOnly */ true ); - BOOST_FOREACH( SCH_FIELD* field, fields ) + for( SCH_FIELD* field : fields ) aItems.push_back( field ); } aItems.push_back( item ); @@ -293,7 +294,7 @@ protected: std::vector filtered_colliders( const EDA_RECT& aRect ) { std::vector filtered; - BOOST_FOREACH( SCH_ITEM* item, m_colliders ) + for( SCH_ITEM* item : m_colliders ) { EDA_RECT item_box; if( SCH_COMPONENT* item_comp = dynamic_cast( item ) ) @@ -389,12 +390,12 @@ protected: std::vector colliding; // 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 ); COLLISION collision = COLLIDE_NONE; - BOOST_FOREACH( SCH_ITEM* collider, filtered_colliders( box ) ) + for( SCH_ITEM* collider : filtered_colliders( box ) ) { SCH_LINE* line = dynamic_cast( collider ); if( line && !side.x ) @@ -432,7 +433,7 @@ protected: while( it != aSides.end() ) { bool collide = false; - BOOST_FOREACH( SIDE_AND_COLL collision, aCollidingSides ) + for( SIDE_AND_COLL collision : aCollidingSides ) { if( collision.side == it->side && collision.collision == aCollision ) collide = true; @@ -473,12 +474,12 @@ protected: 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; } - BOOST_FOREACH( SIDE_AND_NPINS& each_side, sides ) + for( SIDE_AND_NPINS& each_side : sides ) { if( each_side.pins <= side.pins ) { @@ -545,7 +546,7 @@ protected: // Find the offset of the wires for proper positioning int offset = 0; - BOOST_FOREACH( SCH_ITEM* item, colliders ) + for( SCH_ITEM* item : colliders ) { SCH_LINE* line = dynamic_cast( item ); if( !line ) diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index e060151add..96ad5cc6f3 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -49,7 +49,6 @@ #include #include -#include // the separator char between the subpart id and the reference // 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_options = aPart.m_options; - BOOST_FOREACH( LIB_ITEM& oldItem, aPart.GetDrawItemList() ) + for( LIB_ITEM& oldItem : aPart.GetDrawItemList() ) { if( oldItem.IsNew() ) continue; @@ -327,7 +326,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset, if( ! (screen && screen->m_IsPrinting && GetGRForceBlackPenState()) && (aColor == UNSPECIFIED_COLOR) ) { - BOOST_FOREACH( LIB_ITEM& drawItem, drawings ) + for( LIB_ITEM& drawItem : drawings ) { if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR ) 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 size_t pin_index = 0; - BOOST_FOREACH( LIB_ITEM& drawItem, drawings ) + for( LIB_ITEM& drawItem : drawings ) { if( aOnlySelected && !drawItem.IsSelected() ) continue; @@ -446,7 +445,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, // draw background for filled items using background option // 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 // 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 // (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 ) continue; @@ -489,7 +488,7 @@ void LIB_PART::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, aPlotter->SetColor( GetLayerColor( LAYER_FIELDS ) ); bool fill = aPlotter->GetColorMode(); - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( item.Type() != LIB_FIELD_T ) 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_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 continue; @@ -652,14 +651,14 @@ bool LIB_PART::PinsConflictWith( LIB_PART& aOtherPart, bool aTestNums, bool aTes LIB_PINS thisPinList; GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 ); - BOOST_FOREACH( LIB_PIN* eachThisPin, thisPinList ) + for( LIB_PIN* eachThisPin : thisPinList ) { wxASSERT( eachThisPin ); LIB_PINS otherPinList; aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 ); bool foundMatch = false; - BOOST_FOREACH( LIB_PIN* eachOtherPin, otherPinList ) + for( LIB_PIN* eachOtherPin : otherPinList ) { wxASSERT( eachOtherPin ); // Same position? @@ -822,7 +821,7 @@ bool LIB_PART::Save( OUTPUTFORMATTER& aFormatter ) aFormatter.Print( 0, "DRAW\n" ); - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( item.Type() == LIB_FIELD_T ) continue; @@ -1275,7 +1274,7 @@ void LIB_PART::GetFields( LIB_FIELDS& aList ) } // Now grab all the rest of fields. - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( item.Type() != LIB_FIELD_T ) continue; @@ -1292,7 +1291,7 @@ void LIB_PART::GetFields( LIB_FIELDS& aList ) LIB_FIELD* LIB_PART::GetField( int aId ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( item.Type() != LIB_FIELD_T ) continue; @@ -1309,7 +1308,7 @@ LIB_FIELD* LIB_PART::GetField( int aId ) 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 ) continue; @@ -1381,7 +1380,7 @@ bool LIB_PART::LoadDateAndTime( char* aLine ) void LIB_PART::SetOffset( const wxPoint& aOffset ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { item.SetOffset( aOffset ); } @@ -1409,7 +1408,7 @@ bool LIB_PART::HasConversion() const void LIB_PART::ClearStatus() { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { item.m_Flags = 0; } @@ -1420,7 +1419,7 @@ int LIB_PART::SelectItems( EDA_RECT& aRect, int aUnit, int aConvert, bool aEditP { int itemCount = 0; - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { 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 ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( !item.IsSelected() ) continue; @@ -1464,7 +1463,7 @@ void LIB_PART::MoveSelectedItems( const wxPoint& aOffset ) void LIB_PART::ClearSelectedItems() { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { item.m_Flags = 0; } @@ -1536,7 +1535,7 @@ void LIB_PART::CopySelectedItems( const wxPoint& aOffset ) void LIB_PART::MirrorSelectedItemsH( const wxPoint& aCenter ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( !item.IsSelected() ) continue; @@ -1550,7 +1549,7 @@ void LIB_PART::MirrorSelectedItemsH( const wxPoint& aCenter ) void LIB_PART::MirrorSelectedItemsV( const wxPoint& aCenter ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( !item.IsSelected() ) continue; @@ -1564,7 +1563,7 @@ void LIB_PART::MirrorSelectedItemsV( const wxPoint& aCenter ) void LIB_PART::RotateSelectedItems( const wxPoint& aCenter ) { - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { if( !item.IsSelected() ) continue; @@ -1581,7 +1580,7 @@ void LIB_PART::RotateSelectedItems( const wxPoint& aCenter ) LIB_ITEM* LIB_PART::LocateDrawItem( int aUnit, int aConvert, 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) ) || ( 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. - BOOST_FOREACH( LIB_ITEM& item, drawings ) + for( LIB_ITEM& item : drawings ) { // Only pins are duplicated. if( item.Type() != LIB_PIN_T ) diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 31372db48f..5e27a6ed71 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -43,8 +43,6 @@ #include #include -#include - #include #include @@ -896,7 +894,7 @@ wxArrayString PART_LIBS::GetLibraryNames( bool aSorted ) wxArrayString cacheNames; wxArrayString names; - BOOST_FOREACH( PART_LIB& lib, *this ) + for( PART_LIB& lib : *this ) { if( lib.IsCache() && aSorted ) cacheNames.Add( lib.GetName() ); @@ -919,7 +917,7 @@ LIB_PART* PART_LIBS::FindLibPart( const wxString& aPartName, const wxString& aLi { LIB_PART* part = NULL; - BOOST_FOREACH( PART_LIB& lib, *this ) + for( PART_LIB& lib : *this ) { if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName ) continue; @@ -938,7 +936,7 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aEntryName, const wxStri { LIB_ALIAS* entry = NULL; - BOOST_FOREACH( PART_LIB& lib, *this ) + for( PART_LIB& lib : *this ) { if( !!aLibraryName && lib.GetName() != aLibraryName ) continue; @@ -954,7 +952,7 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aEntryName, const wxStri void PART_LIBS::FindLibraryEntries( const wxString& aEntryName, std::vector& aEntries ) { - BOOST_FOREACH( PART_LIB& lib, *this ) + for( PART_LIB& lib : *this ) { LIB_ALIAS* entry = lib.FindEntry( aEntryName ); @@ -970,7 +968,7 @@ void PART_LIBS::FindLibraryNearEntries( std::vector& aCandidates, const wxString& aEntryName, const wxString& aLibraryName ) { - BOOST_FOREACH( PART_LIB& lib, *this ) + for( PART_LIB& lib : *this ) { if( !!aLibraryName && lib.GetName() != aLibraryName ) continue; diff --git a/eeschema/component_references_lister.cpp b/eeschema/component_references_lister.cpp index 596b3bd42a..ce197761ba 100644 --- a/eeschema/component_references_lister.cpp +++ b/eeschema/component_references_lister.cpp @@ -39,8 +39,6 @@ #include #include -#include - //#define USE_OLD_ALGO @@ -332,7 +330,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, // Check whether this component is in aLockedUnitMap. 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(); for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI ) diff --git a/eeschema/component_tree_search_container.cpp b/eeschema/component_tree_search_container.cpp index e6ec911f84..01cc334153 100644 --- a/eeschema/component_tree_search_container.cpp +++ b/eeschema/component_tree_search_container.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -113,7 +112,7 @@ COMPONENT_TREE_SEARCH_CONTAINER::COMPONENT_TREE_SEARCH_CONTAINER( PART_LIBS* aLi COMPONENT_TREE_SEARCH_CONTAINER::~COMPONENT_TREE_SEARCH_CONTAINER() { - BOOST_FOREACH( TREE_NODE* node, m_nodes ) + for( TREE_NODE* node : m_nodes ) delete node; m_nodes.clear(); @@ -158,7 +157,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName, aNodeName, wxEmptyString, wxEmptyString ); m_nodes.push_back( lib_node ); - BOOST_FOREACH( const wxString& aName, aAliasNameList ) + for( const wxString& aName : aAliasNameList ) { LIB_ALIAS* a; @@ -226,7 +225,7 @@ LIB_ALIAS* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedAlias( int* aUnit ) 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 ) { @@ -272,7 +271,7 @@ public: ~EDA_COMBINED_MATCHER() { - BOOST_FOREACH( const EDA_PATTERN_MATCH* matcher, m_matchers ) + for( const EDA_PATTERN_MATCH* matcher : m_matchers ) delete matcher; } @@ -284,7 +283,7 @@ public: { 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 ); @@ -336,7 +335,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch // on an i5. Good enough, no index needed. // 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->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(); 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 ) 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; bool any_change = false; - BOOST_FOREACH( TREE_NODE* node, m_nodes ) + for( TREE_NODE* node : m_nodes ) { 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* preselected_node = NULL; - BOOST_FOREACH( TREE_NODE* node, m_nodes ) + for( TREE_NODE* node : m_nodes ) { if( node->MatchScore == 0 ) continue; diff --git a/eeschema/dialogs/dialog_rescue_each.cpp b/eeschema/dialogs/dialog_rescue_each.cpp index 7c67b94a32..144e765986 100644 --- a/eeschema/dialogs/dialog_rescue_each.cpp +++ b/eeschema/dialogs/dialog_rescue_each.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -127,7 +126,7 @@ bool DIALOG_RESCUE_EACH::TransferDataToWindow() void DIALOG_RESCUE_EACH::PopulateConflictList() { wxVector 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.push_back( wxVariant( true ) ); @@ -151,7 +150,7 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList() RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row]; wxVector 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() ) continue; diff --git a/eeschema/find.cpp b/eeschema/find.cpp index c3f34177d7..6515cdae35 100644 --- a/eeschema/find.cpp +++ b/eeschema/find.cpp @@ -52,8 +52,6 @@ #include -#include - #include diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 6e119ae5a4..5a922f126e 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -49,8 +49,6 @@ #include #include -#include - wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( const SCHLIB_FILTER* aFilter, LIB_ALIAS* aPreselectedAlias, @@ -133,7 +131,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const SCHLIB_FILTER* aFilte if( !loaded ) { - BOOST_FOREACH( PART_LIB& lib, *libs ) + for( PART_LIB& lib : *libs ) { search_container.AddLibrary( lib ); } diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index 826adca04a..b568956570 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -41,8 +41,6 @@ #include #include -#include - LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) : LIB_ITEM( LIB_POLYLINE_T, aParent ) @@ -450,7 +448,7 @@ void LIB_POLYLINE::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition ) wxPoint prevPoint = startPoint; // 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 + (aPosition - point).y * (aPosition - point).y; diff --git a/eeschema/libedit_plot_component.cpp b/eeschema/libedit_plot_component.cpp index 98fad7bde4..a7b70ba075 100644 --- a/eeschema/libedit_plot_component.cpp +++ b/eeschema/libedit_plot_component.cpp @@ -41,8 +41,6 @@ #include #include -#include - void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event ) { diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index c9d102d3ba..e89fd95ac7 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -54,8 +54,6 @@ #include -#include - /* This method guarantees unique IDs for the library this run of Eeschema * 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(); - BOOST_FOREACH( const PART_LIB& lib, *libs ) + for( const PART_LIB& lib : *libs ) { if( lib.IsModified() ) { diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index 4d9425cf33..4dd4008681 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #define IS_WIRE false #define IS_BUS true diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index 374a7df0a7..39179b555f 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -34,7 +34,6 @@ #include #include -#include #include @@ -183,7 +182,7 @@ static LIB_PART* find_component( wxString aName, PART_LIBS* aLibs, bool aCached { LIB_PART *part = NULL; - BOOST_FOREACH( PART_LIB& each_lib, *aLibs ) + for( PART_LIB& each_lib : *aLibs ) { if( aCached && !each_lib.IsCache() ) continue; @@ -208,7 +207,7 @@ void RESCUER::RemoveDuplicates() it != m_all_candidates.end(); ) { bool seen_already = false; - BOOST_FOREACH( wxString& name_seen, names_seen ) + for( wxString& name_seen : names_seen ) { if( name_seen == it->GetRequestedName() ) { @@ -248,7 +247,7 @@ public: typedef std::map candidate_map_t; 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() ); @@ -266,7 +265,7 @@ public: } // 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 ) ); } @@ -298,7 +297,7 @@ public: 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; each_component->SetPartName( m_new_name ); @@ -334,7 +333,7 @@ public: 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() ); @@ -356,7 +355,7 @@ public: } // 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 ) ); } @@ -416,7 +415,7 @@ public: new_part.RemoveAllAliases(); 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; each_component->SetPartName( m_new_name ); @@ -479,7 +478,7 @@ void RESCUER::LogRescue( SCH_COMPONENT *aComponent, const wxString &aOldName, 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 ) ) return false; @@ -490,7 +489,7 @@ bool RESCUER::DoRescues() 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->ClearFlags(); diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 9ac88068c4..8e772f8353 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -264,7 +263,7 @@ bool SCH_BUS_ENTRY_BASE::IsDanglingStateChanged( std::vector& bool start_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 ) continue; diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 95e96b2226..4981d5baa1 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -666,7 +665,7 @@ SCH_FIELD* SCH_COMPONENT::GetField( int aFieldNdx ) const void SCH_COMPONENT::GetFields( std::vector& 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() ) ) aVector.push_back( &each_field ); @@ -1671,7 +1670,7 @@ bool SCH_COMPONENT::IsPinDanglingStateChanged( std::vector &a 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 // internal connection. While technically connected, it is not particularly useful @@ -1727,7 +1726,7 @@ bool SCH_COMPONENT::IsDanglingStateChanged( std::vector& aIte bool SCH_COMPONENT::IsDangling() const { - BOOST_FOREACH( bool each, m_isDangling ) + for( bool each : m_isDangling ) { if( each ) return true; diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index e044927d5c..ecf4421cfa 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -39,8 +39,6 @@ #include #include -#include - SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) : SCH_ITEM( NULL, SCH_LINE_T ) @@ -380,7 +378,7 @@ bool SCH_LINE::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemLi if( GetLayer() == LAYER_WIRE ) { - BOOST_FOREACH( DANGLING_END_ITEM item, aItemList ) + for( DANGLING_END_ITEM item : aItemList ) { if( item.GetItem() == this ) continue; diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 20a18b99a8..753809a247 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -54,7 +54,6 @@ #include #include -#include #define EESCHEMA_FILE_STAMP "EESchema" @@ -493,7 +492,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION ) < 0 ) 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 ) return false; diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 33338b7a2a..58b702044d 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -162,7 +162,7 @@ bool SCH_SHEET::Save( FILE* aFile ) const /* 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 ) ) 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 // parent, after swapping. - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) + for( SCH_SHEET_PIN& sheetPin : m_pins ) { sheetPin.SetParent( this ); } - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, sheet->m_pins ) + for( SCH_SHEET_PIN& sheetPin : sheet->m_pins ) { sheetPin.SetParent( sheet ); } @@ -379,7 +379,7 @@ void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin ) 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 ) return true; @@ -391,7 +391,7 @@ bool SCH_SHEET::HasPin( const wxString& aName ) bool SCH_SHEET::IsVerticalOrientation() const { - BOOST_FOREACH( SCH_SHEET_PIN pin, m_pins ) + for( SCH_SHEET_PIN pin : m_pins ) { if( pin.GetEdge() > 1 ) return true; @@ -402,7 +402,7 @@ bool SCH_SHEET::IsVerticalOrientation() const 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. */ EDA_ITEM* DrawStruct = m_screen->GetDrawItems(); @@ -515,7 +515,7 @@ void SCH_SHEET::CleanupSheet() 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 ) ) return &pin; @@ -626,7 +626,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, /* Draw text : SheetLabel */ - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) + for( SCH_SHEET_PIN& sheetPin : m_pins ) { if( !sheetPin.IsMoving() ) sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor ); @@ -862,7 +862,7 @@ void SCH_SHEET::Rotate(wxPoint aPosition) m_size.y = -m_size.y; } - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) + for( SCH_SHEET_PIN& sheetPin : m_pins ) { sheetPin.Rotate( aPosition ); } @@ -874,7 +874,7 @@ void SCH_SHEET::MirrorX( int aXaxis_position ) MIRROR( m_pos.y, aXaxis_position ); 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 ); } @@ -886,7 +886,7 @@ void SCH_SHEET::MirrorY( int aYaxis_position ) MIRROR( m_pos.x, aYaxis_position ); 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 ); } @@ -909,7 +909,7 @@ void SCH_SHEET::Resize( const wxSize& aSize ) m_size = aSize; /* 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() ); } @@ -952,7 +952,7 @@ void SCH_SHEET::renumberPins() { int id = 2; - BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins ) + for( SCH_SHEET_PIN& pin : m_pins ) { pin.SetNumber( id ); id++; @@ -978,7 +978,7 @@ bool SCH_SHEET::IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemL { bool currentState = IsDangling(); - BOOST_FOREACH( SCH_SHEET_PIN& pinsheet, GetPins() ) + for( SCH_SHEET_PIN& pinsheet : GetPins() ) { 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 // parent, after assigning. - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, m_pins ) + for( SCH_SHEET_PIN& sheetPin : m_pins ) { sheetPin.SetParent( this ); } @@ -1233,7 +1233,7 @@ void SCH_SHEET::Show( int nestLevel, std::ostream& os ) const << TO_UTF8( m_name ) << '"' << ">\n"; // 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 ); } diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index 2629ec0a3b..ddb7e7970c 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -31,7 +31,6 @@ #define SCH_SHEEET_H #include -#include #include @@ -505,7 +504,7 @@ public: { m_pos += aMoveVector; - BOOST_FOREACH( SCH_SHEET_PIN& pin, m_pins ) + for( SCH_SHEET_PIN& pin : m_pins ) { pin.Move( aMoveVector ); } diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp index 9938555722..74023b0746 100644 --- a/eeschema/sch_sheet_path.cpp +++ b/eeschema/sch_sheet_path.cpp @@ -43,7 +43,6 @@ #include -#include #include @@ -586,7 +585,7 @@ void SCH_SHEET_LIST::GetMultiUnitComponents( PART_LIBS* aLibs, SCH_MULTI_UNIT_REFERENCE_MAP 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 unsigned n_refs = pair.second.GetCount(); diff --git a/eeschema/symbedit.cpp b/eeschema/symbedit.cpp index fd5b4eb80c..a36a4d211d 100644 --- a/eeschema/symbedit.cpp +++ b/eeschema/symbedit.cpp @@ -42,8 +42,6 @@ #include #include -#include - void LIB_EDIT_FRAME::LoadOneSymbol() { @@ -114,7 +112,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol() LIB_PART* first = lib->GetFirstEntry()->GetPart(); LIB_ITEMS& drawList = first->GetDrawItemList(); - BOOST_FOREACH( LIB_ITEM& item, drawList ) + for( LIB_ITEM& item : drawList ) { if( item.Type() == LIB_FIELD_T ) continue; @@ -217,7 +215,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol() LIB_ITEMS& drawList = part->GetDrawItemList(); - BOOST_FOREACH( LIB_ITEM& item, drawList ) + for( LIB_ITEM& item : drawList ) { if( item.Type() == LIB_FIELD_T ) continue; diff --git a/include/footprint_info.h b/include/footprint_info.h index 7af63e4017..2559752f06 100644 --- a/include/footprint_info.h +++ b/include/footprint_info.h @@ -31,7 +31,6 @@ #include -#include #include #include diff --git a/pcbnew/autorouter/spread_footprints.cpp b/pcbnew/autorouter/spread_footprints.cpp index 15519f36fb..e67e5c0aad 100644 --- a/pcbnew/autorouter/spread_footprints.cpp +++ b/pcbnew/autorouter/spread_footprints.cpp @@ -35,7 +35,6 @@ */ #include -#include #include #include @@ -194,7 +193,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector* aFootprints, // calculate also the area needed by these footprints std::vector footprintList; - BOOST_FOREACH( MODULE* footprint, *aFootprints ) + for( MODULE* footprint : *aFootprints ) { footprint->CalculateBoundingBox(); @@ -221,7 +220,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector* aFootprints, undoList.m_Status = 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 picker.SetItem( footprint ); diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index f2cd0cf422..a5129cc069 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -42,7 +42,6 @@ #include #include #include -#include #include @@ -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, 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 ) ) aLayers[aCount++] = each_layer; diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index ff80e156df..64796eafee 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -113,7 +113,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) if( !newFootprints.empty() ) { - BOOST_FOREACH( MODULE* footprint, newFootprints ) + for( MODULE* footprint : newFootprints ) { toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint ); } diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index 5ba9241dfb..379f1128d1 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -394,7 +394,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList() 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() ); } diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index 0058fddd57..aff9cf95f9 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -127,7 +127,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, SpreadFootprints( &newFootprints, false, false ); if( !newFootprints.empty() ) { - BOOST_FOREACH( MODULE* footprint, newFootprints ) + for( MODULE* footprint : newFootprints ) { m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint ); } diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index f840ad2484..f69557a509 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -129,7 +129,7 @@ static std::vector* kruskalMST( RN_LINKS::RN_EDGE_LIST& aEdges, // Set tags for marking cycles boost::unordered_map tags; unsigned int tag = 0; - BOOST_FOREACH( RN_NODE_PTR& node, aNodes ) + for( RN_NODE_PTR& node : aNodes ) { node->SetTag( tag ); tags[node] = tag++; @@ -220,7 +220,7 @@ void RN_NET::validateEdge( RN_EDGE_MST_PTR& aEdge ) valid = false; std::list closest = GetClosestNodes( source, WITHOUT_FLAG() ); - BOOST_FOREACH( RN_NODE_PTR& node, closest ) + for( RN_NODE_PTR& node : closest ) { if( node && node != target ) { @@ -235,7 +235,7 @@ void RN_NET::validateEdge( RN_EDGE_MST_PTR& aEdge ) valid = false; std::list closest = GetClosestNodes( target, WITHOUT_FLAG() ); - BOOST_FOREACH( RN_NODE_PTR& node, closest ) + for( RN_NODE_PTR& node : closest ) { if( node && node != source ) { @@ -343,7 +343,7 @@ void RN_NET::compute() } // Set tags to nodes as connected - BOOST_FOREACH( RN_NODE_PTR node, boardNodes ) + for( RN_NODE_PTR node : boardNodes ) node->SetTag( 0 ); return; @@ -418,7 +418,7 @@ void RN_NET::Update() compute(); - BOOST_FOREACH( RN_EDGE_MST_PTR& edge, *m_rnEdges ) + for( RN_EDGE_MST_PTR& edge : *m_rnEdges ) validateEdge( edge ); m_dirty = false; @@ -492,7 +492,7 @@ void RN_NET::RemoveItem( const D_PAD* aPad ) RN_PAD_DATA& pad_data = it->second; 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 ); m_pads.erase( aPad ); @@ -534,13 +534,13 @@ void RN_NET::RemoveItem( const ZONE_CONTAINER* aZone ) // Remove all subpolygons that make the zone std::deque& polygons = zoneData.m_Polygons; - BOOST_FOREACH( RN_POLY& polygon, polygons ) + for( RN_POLY& polygon : polygons ) removeNode( polygon.GetNode(), aZone ); polygons.clear(); // Remove all connections added by the zone std::deque& edges = zoneData.m_Edges; - BOOST_FOREACH( RN_EDGE_MST_PTR edge, edges ) + for( RN_EDGE_MST_PTR edge : edges ) removeEdge( edge, aZone ); edges.clear(); @@ -614,7 +614,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes(); // Copy nodes - BOOST_FOREACH( const RN_NODE_PTR& node, nodes ) + for( const RN_NODE_PTR& node : nodes ) closest.push_back( node ); // Sort by the distance from aNode @@ -638,7 +638,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, const RN_LINKS::RN_NODE_SET& nodes = m_links.GetNodes(); // Copy nodes - BOOST_FOREACH( const RN_NODE_PTR& node, nodes ) + for( const RN_NODE_PTR& node : nodes ) closest.push_back( node ); // Sort by the distance from aNode @@ -660,7 +660,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, 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 AddBlockedNode( node ); @@ -734,25 +734,25 @@ void RN_NET::GetAllItems( std::list& aOutput, RN_ITEM_TYP { 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( item ) ); } 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( item ) ); } 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( item ) ); } 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( item ) ); } } @@ -760,7 +760,7 @@ void RN_NET::GetAllItems( std::list& aOutput, RN_ITEM_TYP void RN_NET::ClearSimple() { - BOOST_FOREACH( const RN_NODE_PTR& node, m_blockedNodes ) + for( const RN_NODE_PTR& node : m_blockedNodes ) node->SetFlag( false ); 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 ) { - 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 ) { @@ -863,7 +863,7 @@ void RN_DATA::AddBlocked( const BOARD_ITEM* aItem ) return; // 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 ); } else if( aItem->Type() == PCB_MODULE_T ) @@ -951,7 +951,7 @@ void RN_NET::processZones() RN_ZONE_DATA& zoneData = it->second; // 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 ); zoneData.m_Edges.clear(); @@ -1006,7 +1006,7 @@ void RN_NET::processPads() std::deque& edges = it->second.m_Edges; // Reset existing connections - BOOST_FOREACH( RN_EDGE_MST_PTR edge, edges ) + for( RN_EDGE_MST_PTR edge : edges ) m_links.RemoveConnection( edge ); LSET layers = pad->GetLayerSet(); diff --git a/pcbnew/ratsnest_data.h b/pcbnew/ratsnest_data.h index 9bae8fbe40..d272e7903e 100644 --- a/pcbnew/ratsnest_data.h +++ b/pcbnew/ratsnest_data.h @@ -37,7 +37,6 @@ #include #include -#include #include @@ -687,7 +686,7 @@ public: */ void ClearSimple() { - BOOST_FOREACH( RN_NET& net, m_nets ) + for( RN_NET& net : m_nets ) net.ClearSimple(); } diff --git a/pcbnew/ratsnest_viewitem.cpp b/pcbnew/ratsnest_viewitem.cpp index d31c0bde94..a2b6c89bbb 100644 --- a/pcbnew/ratsnest_viewitem.cpp +++ b/pcbnew/ratsnest_viewitem.cpp @@ -33,7 +33,6 @@ #include #include -#include namespace KIGFX { @@ -74,7 +73,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const aGal->SetStrokeColor( color.Brightened( 0.8 ) ); // 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 if( node->GetRefCount() > 1 ) @@ -100,7 +99,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const if( edges == NULL ) 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& targetNode = edge->GetTargetNode(); diff --git a/pcbnew/router/length_tuner_tool.cpp b/pcbnew/router/length_tuner_tool.cpp index 5f53e62e54..e2f56c0dd4 100644 --- a/pcbnew/router/length_tuner_tool.cpp +++ b/pcbnew/router/length_tuner_tool.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include "class_draw_panel_gal.h" diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index 9265430210..a6cedda2ff 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include #include #include @@ -281,7 +279,7 @@ const PNS_DIFF_PAIR PNS_DP_GATEWAY::Entry() const void PNS_DP_GATEWAYS::BuildOrthoProjections( PNS_DP_GATEWAYS& aEntries, 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 ); SEG guide_s( midpoint, midpoint + VECTOR2I( 1, 0 ) ); @@ -304,7 +302,7 @@ void PNS_DP_GATEWAYS::BuildOrthoProjections( PNS_DP_GATEWAYS& aEntries, targets.BuildForCursor( proj ); - BOOST_FOREACH( PNS_DP_GATEWAY t, targets.Gateways() ) + for( PNS_DP_GATEWAY t : targets.Gateways() ) { t.SetPriority( aOrthoScore ); m_gateways.push_back( t ); @@ -318,9 +316,9 @@ bool PNS_DP_GATEWAYS::FitGateways( PNS_DP_GATEWAYS& aEntry, PNS_DP_GATEWAYS& aTa { std::vector 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++ ) { @@ -346,7 +344,7 @@ bool PNS_DP_GATEWAYS::FitGateways( PNS_DP_GATEWAYS& aEntry, PNS_DP_GATEWAYS& aTa DP_CANDIDATE best; bool found = false; - BOOST_FOREACH( DP_CANDIDATE c, candidates ) + for( DP_CANDIDATE c : candidates ) { 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 ) { - BOOST_FOREACH( PNS_DP_GATEWAY &g, m_gateways ) + for( PNS_DP_GATEWAY &g : m_gateways ) { if( !g.HasEntryLines() ) { diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index 322cd33c4d..9711ed60ae 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include @@ -532,7 +531,7 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI double bestDist = std::numeric_limits::max(); bool found = false; - BOOST_FOREACH( PNS_ITEM* item, items ) + for( PNS_ITEM* item : items ) { if( item->Kind() == aItem->Kind() ) { diff --git a/pcbnew/router/pns_dp_meander_placer.cpp b/pcbnew/router/pns_dp_meander_placer.cpp index 5179e194af..258cca8030 100644 --- a/pcbnew/router/pns_dp_meander_placer.cpp +++ b/pcbnew/router/pns_dp_meander_placer.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include // God forgive me doing this... @@ -128,14 +127,14 @@ int PNS_DP_MEANDER_PLACER::origPathLength() const int totalP = 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( item ) ) 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( item ) ) totalN += l->CLine().Length(); @@ -206,13 +205,13 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem ) 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( item ) ) 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( item ) ) 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; - BOOST_FOREACH( const PNS_DIFF_PAIR::COUPLED_SEGMENTS& sp, coupledSegments ) + for( const PNS_DIFF_PAIR::COUPLED_SEGMENTS& sp : coupledSegments ) { SEG base = baselineSegment( sp ); @@ -267,7 +266,7 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem ) tunedP.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 ) { diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index a30e7cd83e..65b2e23e0a 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include "pns_dragger.h" #include "pns_shove.h" #include "pns_router.h" @@ -86,7 +84,7 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia ) if( !jt ) return false; - BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) + for( PNS_ITEM* item : jt->LinkList() ) { 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->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( item ) ) { diff --git a/pcbnew/router/pns_index.h b/pcbnew/router/pns_index.h index 6c895dc8a0..abeeb61224 100644 --- a/pcbnew/router/pns_index.h +++ b/pcbnew/router/pns_index.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/pcbnew/router/pns_itemset.cpp b/pcbnew/router/pns_itemset.cpp index 06561a7fe8..dc7b12c857 100644 --- a/pcbnew/router/pns_itemset.cpp +++ b/pcbnew/router/pns_itemset.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include "pns_itemset.h" #include "pns_line.h" @@ -53,7 +51,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterLayers( int aStart, int aEnd, bool aInvert ) else 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 ) { @@ -71,7 +69,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask, bool aInvert ) { ENTRIES newItems; - BOOST_FOREACH( const ENTRY& ent, m_items ) + for( const ENTRY& ent : m_items ) { if( ent.item->OfKind( aKindMask ) ^ aInvert ) { @@ -89,7 +87,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterMarker( int aMarker, bool aInvert ) { ENTRIES newItems; - BOOST_FOREACH( const ENTRY& ent, m_items ) + for( const ENTRY& ent : m_items ) { if( ent.item->Marker() & aMarker ) { @@ -107,7 +105,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert ) { ENTRIES newItems; - BOOST_FOREACH( const ENTRY& ent, m_items ) + for( const ENTRY& ent : m_items ) { if( ( ent.item->Net() == aNet ) ^ aInvert ) { @@ -125,7 +123,7 @@ PNS_ITEMSET& PNS_ITEMSET::ExcludeItem( const PNS_ITEM* aItem ) { ENTRIES newItems; - BOOST_FOREACH( const ENTRY& ent, m_items ) + for( const ENTRY& ent : m_items ) { if( ent.item != aItem ) diff --git a/pcbnew/router/pns_itemset.h b/pcbnew/router/pns_itemset.h index 728d0aed11..e39a65435a 100644 --- a/pcbnew/router/pns_itemset.h +++ b/pcbnew/router/pns_itemset.h @@ -22,7 +22,6 @@ #define __PNS_ITEMSET_H #include -#include #include "pns_item.h" @@ -118,7 +117,7 @@ public: { int n = 0; - BOOST_FOREACH( PNS_ITEM* item, m_items ) + for( PNS_ITEM* item : m_items ) { if( item->Kind() & aKindMask ) n++; @@ -205,7 +204,7 @@ public: { int n = 0; - BOOST_FOREACH( const PNS_ITEM* item, m_items ) + for( const PNS_ITEM* item : m_items ) { if( item->OfKind( kind ) ) { diff --git a/pcbnew/router/pns_joint.h b/pcbnew/router/pns_joint.h index eab4a562a1..e3aef6594c 100644 --- a/pcbnew/router/pns_joint.h +++ b/pcbnew/router/pns_joint.h @@ -145,7 +145,7 @@ public: PNS_VIA* Via() { - BOOST_FOREACH( PNS_ITEM* item, m_linkedItems.Items() ) + for( PNS_ITEM* item : m_linkedItems.Items() ) { if( item->OfKind( VIA ) ) return static_cast( item ); @@ -208,7 +208,7 @@ public: if( aJoint.IsLocked() ) m_locked = true; - BOOST_FOREACH( PNS_ITEM* item, aJoint.LinkList() ) + for( PNS_ITEM* item : aJoint.LinkList() ) { m_linkedItems.Add( item ); } diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 9e50260eb3..b823641d84 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include @@ -88,7 +87,7 @@ void PNS_LINE::Mark( int aMarker ) if( m_segmentRefs ) { - BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) + for( PNS_SEGMENT* s : *m_segmentRefs ) s->Mark( aMarker ); } } @@ -98,7 +97,7 @@ void PNS_LINE::Unmark() { if( m_segmentRefs ) { - BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) + for( PNS_SEGMENT* s : *m_segmentRefs ) s->Unmark(); } @@ -112,7 +111,7 @@ int PNS_LINE::Marker() const if( m_segmentRefs ) { - BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) + for( PNS_SEGMENT* s : *m_segmentRefs ) { marker |= s->Marker(); } @@ -734,7 +733,7 @@ void PNS_LINE::SetRank( int aRank ) if( m_segmentRefs ) { - BOOST_FOREACH( PNS_SEGMENT* s, *m_segmentRefs ) + for( PNS_SEGMENT* s : *m_segmentRefs ) s->SetRank( aRank ); } } @@ -747,7 +746,7 @@ int PNS_LINE::Rank() const if( m_segmentRefs ) { - BOOST_FOREACH( PNS_SEGMENT *s, *m_segmentRefs ) + for( PNS_SEGMENT *s : *m_segmentRefs ) min_rank = std::min( min_rank, s->Rank() ); rank = ( min_rank == INT_MAX ) ? -1 : min_rank; } diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 7f4efb4176..7f7f51062d 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include @@ -121,7 +120,7 @@ bool PNS_LINE_PLACER::handleSelfIntersections() // if there is more than one intersection, find the one that is // 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 ) { @@ -971,13 +970,13 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE& aLatest ) int removedCount = 0; int total = 0; - BOOST_FOREACH( PNS_LINE& line, lines ) + for( PNS_LINE& line : lines ) { total++; if( !( line.ContainsSegment( seg ) ) && line.SegmentCount() ) { - BOOST_FOREACH( PNS_SEGMENT *ss, *line.LinkedSegments() ) + for( PNS_SEGMENT *ss : *line.LinkedSegments() ) toErase.insert( ss ); 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 ); } - BOOST_FOREACH( PNS_SEGMENT *s, toErase ) + for( PNS_SEGMENT *s : toErase ) aNode->Remove( s ); aNode->Remove( &aLatest ); diff --git a/pcbnew/router/pns_meander.cpp b/pcbnew/router/pns_meander.cpp index 6739401cd8..2252d9f80e 100644 --- a/pcbnew/router/pns_meander.cpp +++ b/pcbnew/router/pns_meander.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include // God forgive me doing this... #include @@ -578,7 +576,7 @@ void PNS_MEANDERED_LINE::AddMeander( PNS_MEANDER_SHAPE* aShape ) void PNS_MEANDERED_LINE::Clear() { - BOOST_FOREACH( PNS_MEANDER_SHAPE* m, m_meanders ) + for( PNS_MEANDER_SHAPE* m : m_meanders ) { delete m; } diff --git a/pcbnew/router/pns_meander_placer.cpp b/pcbnew/router/pns_meander_placer.cpp index 14b9f9bf98..a71b312be1 100644 --- a/pcbnew/router/pns_meander_placer.cpp +++ b/pcbnew/router/pns_meander_placer.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include // God forgive me doing this... #include @@ -94,7 +92,7 @@ bool PNS_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) int PNS_MEANDER_PLACER::origPathLength() const { 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( item ) ) { @@ -148,7 +146,7 @@ bool PNS_MEANDER_PLACER::doMove( const VECTOR2I& aP, PNS_ITEM* aEndItem, int aTa 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( item ) ) { @@ -160,7 +158,7 @@ bool PNS_MEANDER_PLACER::doMove( const VECTOR2I& aP, PNS_ITEM* aEndItem, int aTa { tuned.Clear(); - BOOST_FOREACH( PNS_MEANDER_SHAPE* m, m_result.Meanders() ) + for( PNS_MEANDER_SHAPE* m : m_result.Meanders() ) { if( m->Type() != MT_EMPTY ) { diff --git a/pcbnew/router/pns_meander_placer_base.cpp b/pcbnew/router/pns_meander_placer_base.cpp index 0a655e44fe..bb154513ec 100644 --- a/pcbnew/router/pns_meander_placer_base.cpp +++ b/pcbnew/router/pns_meander_placer_base.cpp @@ -108,7 +108,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE int remaining = aElongation; bool finished = false; - BOOST_FOREACH( PNS_MEANDER_SHAPE* m, aTuned.Meanders() ) + for( PNS_MEANDER_SHAPE* m : aTuned.Meanders() ) { if( m->Type() != MT_CORNER ) { @@ -140,7 +140,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE remaining = aElongation; 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 ) { @@ -159,7 +159,7 @@ void PNS_MEANDER_PLACER_BASE::tuneLineLength( PNS_MEANDERED_LINE& aTuned, int aE 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 ) { diff --git a/pcbnew/router/pns_meander_skew_placer.cpp b/pcbnew/router/pns_meander_skew_placer.cpp index 3d4626d1d2..ed186420fb 100644 --- a/pcbnew/router/pns_meander_skew_placer.cpp +++ b/pcbnew/router/pns_meander_skew_placer.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include // God forgive me doing this... #include @@ -110,7 +108,7 @@ int PNS_MEANDER_SKEW_PLACER::origPathLength( ) const int PNS_MEANDER_SKEW_PLACER::itemsetLength( const PNS_ITEMSET& aSet ) const { 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( item ) ) { @@ -130,13 +128,13 @@ int PNS_MEANDER_SKEW_PLACER::currentSkew() const 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( item ) ) 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( item ) ) Router()->DisplayDebugLine( l->CLine(), 4, 10000 ); diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 3f9bf12c87..30355a8862 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -305,7 +305,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::NearestObstacle( const PNS_LINE* aItem, nearest.m_item = NULL; nearest.m_distFirst = INT_MAX; - BOOST_FOREACH( PNS_OBSTACLE obs, obs_list ) + for( PNS_OBSTACLE obs : obs_list ) { VECTOR2I ip_first, ip_last; 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 ); - BOOST_FOREACH( SHAPE_LINE_CHAIN::INTERSECTION isect, isect_list ) + for( SHAPE_LINE_CHAIN::INTERSECTION isect : isect_list ) { int dist = aLine.CLine().Length() + ( 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 ); - BOOST_FOREACH( SHAPE_LINE_CHAIN::INTERSECTION isect, isect_list ) + for( SHAPE_LINE_CHAIN::INTERSECTION isect : isect_list ) { 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 ) { - BOOST_FOREACH( const PNS_ITEM* item, aSet.CItems() ) + for( const PNS_ITEM* item : aSet.CItems() ) { 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 ); 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 ) ) items.Add( item ); @@ -640,7 +640,7 @@ void PNS_NODE::removeLine( PNS_LINE* aLine ) assert( segRefs != NULL ); - BOOST_FOREACH( PNS_SEGMENT* seg, *segRefs ) + for( PNS_SEGMENT* seg : *segRefs ) { removeSegment( seg ); } @@ -686,7 +686,7 @@ void PNS_NODE::removeVia( PNS_VIA* aVia ) } while( split ); // 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 ) linkJoint ( p, item->Layers(), net, item ); @@ -852,7 +852,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector& aFo PNS_JOINT* current = searchQueue.front(); searchQueue.pop_front(); - BOOST_FOREACH( PNS_ITEM* item, current->LinkList() ) + for( PNS_ITEM* item : current->LinkList() ) { if ( item->OfKind( PNS_ITEM::SEGMENT ) ) { @@ -870,7 +870,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector& aFo } } - BOOST_FOREACH(PNS_JOINT* jt, processed) + for(PNS_JOINT* jt : processed) aFoundJoints.push_back( jt ); } #endif @@ -878,7 +878,7 @@ void PNS_NODE::MapConnectivity ( PNS_JOINT* aStart, std::vector& aFo int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& aA, PNS_JOINT& aB, std::vector& aLines ) { - BOOST_FOREACH( PNS_ITEM* item, aA.LinkList() ) + for( PNS_ITEM* item : aA.LinkList() ) { if( item->Kind() == PNS_ITEM::SEGMENT ) { @@ -1113,7 +1113,7 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded ) if( isRoot() ) return; - BOOST_FOREACH( PNS_ITEM* item, m_override ) + for( PNS_ITEM* item : m_override ) aRemoved.push_back( item ); 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. std::set kids = m_children; - BOOST_FOREACH( PNS_NODE* node, kids ) + for( PNS_NODE* node : kids ) { node->releaseChildren(); delete node; @@ -1138,7 +1138,7 @@ void PNS_NODE::releaseGarbage() if( !isRoot() ) return; - BOOST_FOREACH( PNS_ITEM* item, m_garbageItems ) + for( PNS_ITEM* item : m_garbageItems ) { if( !item->BelongsTo( this ) ) delete item; @@ -1153,7 +1153,7 @@ void PNS_NODE::Commit( PNS_NODE* aNode ) if( aNode->isRoot() ) return; - BOOST_FOREACH( PNS_ITEM* item, aNode->m_override ) + for( PNS_ITEM* item : aNode->m_override ) Remove( item ); for( PNS_INDEX::ITEM_SET::iterator i = aNode->m_index->begin(); @@ -1182,7 +1182,7 @@ void PNS_NODE::AllItemsInNet( int aNet, std::set& aItems ) if( l_cur ) { - BOOST_FOREACH( PNS_ITEM*item, *l_cur ) + for( PNS_ITEM*item : *l_cur ) aItems.insert( item ); } @@ -1248,7 +1248,7 @@ PNS_SEGMENT* PNS_NODE::findRedundantSegment( PNS_SEGMENT* aSeg ) if( !jtStart ) return NULL; - BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) + for( PNS_ITEM* item : jtStart->LinkList() ) { 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() ); - BOOST_FOREACH( PNS_ITEM*item, *l_cur ) + for( PNS_ITEM*item : *l_cur ) if( item->Parent() == aParent ) return item; diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index 249d8b27cd..061ae76444 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -18,8 +18,6 @@ * with this program. If not, see . */ -#include - #include #include #include @@ -271,7 +269,7 @@ int LINE_RESTRICTIONS::allowedAngles( PNS_NODE* aWorld, const PNS_LINE* aLine, c 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 ) ) return 0xff; @@ -814,7 +812,7 @@ PNS_ITEM* PNS_OPTIMIZER::findPadOrVia( int aLayer, int aNet, const VECTOR2I& aP if( !jt ) return NULL; - BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) + for( PNS_ITEM* item : jt->LinkList() ) { if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) ) 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++ ) { - BOOST_FOREACH( SHAPE_LINE_CHAIN & l, breakouts ) { + for( SHAPE_LINE_CHAIN & l : breakouts ) { 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; int p_best = -1; - BOOST_FOREACH( RtVariant& vp, variants ) + for( RtVariant& vp : variants ) { PNS_LINE tmp( *aLine, vp.second ); int cost = PNS_COST_ESTIMATOR::CornerCost( vp.second ); diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index 42d3d84ae5..4c15fe83f9 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -21,8 +21,6 @@ #include #include -#include - #include #include #include @@ -701,7 +699,7 @@ BOARD* PNS_ROUTER::GetBoard() void PNS_ROUTER::eraseView() { - BOOST_FOREACH( BOARD_ITEM* item, m_hiddenItems ) + for( BOARD_ITEM* item : m_hiddenItems ) { 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 ) { - BOOST_FOREACH( const PNS_ITEM* item, aItems.CItems() ) + for( const PNS_ITEM* item : aItems.CItems() ) 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, PNS_NODE::ITEM_VECTOR& aRemoved ) { - BOOST_FOREACH( PNS_ITEM* item, aCurrent.Items() ) + for( PNS_ITEM* item : aCurrent.Items() ) { 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 ); std::unique_ptr tmp( obs.m_item->Clone() ); @@ -838,12 +836,12 @@ void PNS_ROUTER::updateView( PNS_NODE* aNode, PNS_ITEMSET& aCurrent ) aNode->GetUpdatedItems( removed, added ); - BOOST_FOREACH( PNS_ITEM* item, added ) + for( PNS_ITEM* item : added ) { DisplayItem( item ); } - BOOST_FOREACH( PNS_ITEM* item, removed ) + for( PNS_ITEM* item : removed ) { 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 ); 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 ) ) 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; @@ -1004,7 +1002,7 @@ void PNS_ROUTER::StopRouting() std::vector nets; m_placer->GetModifiedNets( nets ); - BOOST_FOREACH ( int n, nets ) + for( int n : nets ) { // Update the ratsnest with new changes m_board->GetRatsnest()->Recalculate( n ); diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 3e724439e1..8d5765c8a9 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -23,8 +23,6 @@ #include #include -#include - #include "trace.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 ); - BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) + for( PNS_ITEM* item : jtStart->LinkList() ) { if( m_currentNode->CheckColliding( item, &l ) ) colliding = true; @@ -254,7 +252,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ProcessSingleLine( PNS_LINE& aCurrent, PNS_LI if( aObstacle.LinkedSegments() ) { - BOOST_FOREACH( PNS_SEGMENT* s, *aObstacle.LinkedSegments() ) + for( PNS_SEGMENT* s : *aObstacle.LinkedSegments() ) if( s->Marker() & MK_HEAD ) { @@ -411,7 +409,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE if( !jtStart ) return SH_INCOMPLETE; - BOOST_FOREACH( PNS_ITEM* item, jtStart->LinkList() ) + for( PNS_ITEM* item : jtStart->LinkList() ) { if( item->OfKind( PNS_ITEM::VIA ) ) { @@ -430,7 +428,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE #ifdef DEBUG 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" ); } @@ -601,7 +599,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc m_draggedViaHeadSet.Clear(); } - BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) + for( PNS_ITEM* item : jt->LinkList() ) { if( PNS_SEGMENT* seg = dyn_cast( 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" ); #endif - BOOST_FOREACH( LINE_PAIR lp, draggedLines ) + for( LINE_PAIR lp : draggedLines ) { if( lp.first.Marker() & MK_HEAD ) { @@ -742,7 +740,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onReverseCollidingVia( PNS_LINE& aCurrent, PN cur.RemoveVia(); unwindStack( &aCurrent ); - BOOST_FOREACH( PNS_ITEM* item, jt->LinkList() ) + for( PNS_ITEM* item : jt->LinkList() ) { if( item->OfKind( PNS_ITEM::SEGMENT ) && item->LayersOverlap( &aCurrent ) ) { @@ -843,7 +841,7 @@ void PNS_SHOVE::unwindStack( PNS_ITEM* aItem ) if( !l->LinkedSegments() ) return; - BOOST_FOREACH( PNS_SEGMENT* seg, *l->LinkedSegments() ) + for( PNS_SEGMENT* seg : *l->LinkedSegments() ) unwindStack( seg ); } } @@ -879,7 +877,7 @@ void PNS_SHOVE::popLine( ) if( !l.LinkedSegments() ) continue; - BOOST_FOREACH( PNS_SEGMENT *s, *l.LinkedSegments() ) + for( PNS_SEGMENT *s : *l.LinkedSegments() ) { if( i->ContainsSegment( s ) ) { @@ -1153,7 +1151,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet PNS_ITEMSET headSet; - BOOST_FOREACH( const PNS_ITEM* item, aHeadSet.CItems() ) + for( const PNS_ITEM* item : aHeadSet.CItems() ) { const PNS_LINE* headOrig = static_cast( item ); @@ -1176,7 +1174,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet m_currentNode->ClearRanks(); int n = 0; - BOOST_FOREACH( const PNS_ITEM* item, aHeadSet.CItems() ) + for( const PNS_ITEM* item : aHeadSet.CItems() ) { const PNS_LINE* headOrig = static_cast( item ); PNS_LINE head( *headOrig ); diff --git a/pcbnew/router/pns_sizes_settings.cpp b/pcbnew/router/pns_sizes_settings.cpp index dae3ea30ad..3ec1f78888 100644 --- a/pcbnew/router/pns_sizes_settings.cpp +++ b/pcbnew/router/pns_sizes_settings.cpp @@ -59,7 +59,7 @@ int PNS_SIZES_SETTINGS::inheritTrackWidth( PNS_ITEM* aItem ) PNS_ITEMSET linkedSegs = jt->Links(); linkedSegs.ExcludeItem( aItem ).FilterKinds( PNS_ITEM::SEGMENT ); - BOOST_FOREACH( PNS_ITEM* item, linkedSegs.Items() ) + for( PNS_ITEM* item : linkedSegs.Items() ) { int w = static_cast( item )->Width(); mval = std::min( w, mval ); diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 43e37086d0..504f24cb81 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -20,7 +20,6 @@ #include -#include #include #include 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 ); - BOOST_FOREACH( PNS_ITEM* item, candidates.Items() ) + for( PNS_ITEM* item : candidates.Items() ) { if( !IsCopperLayer( item->Layers().Start() ) ) continue; @@ -281,7 +280,7 @@ void PNS_TOOL_BASE::updateEndItem( TOOL_EVENT& aEvent ) std::vector nets = m_router->GetCurrentNets(); - BOOST_FOREACH( int net, nets ) + for( int net : nets ) { endItem = pickSingleItem( p, net, layer ); diff --git a/pcbnew/router/pns_topology.cpp b/pcbnew/router/pns_topology.cpp index 0bd9a377e4..df1e3c6086 100644 --- a/pcbnew/router/pns_topology.cpp +++ b/pcbnew/router/pns_topology.cpp @@ -68,7 +68,7 @@ const PNS_TOPOLOGY::JOINT_SET PNS_TOPOLOGY::ConnectedJoints( PNS_JOINT* aStart ) PNS_JOINT* current = searchQueue.front(); searchQueue.pop_front(); - BOOST_FOREACH( PNS_ITEM* item, current->LinkList() ) + for( PNS_ITEM* item : current->LinkList() ) { 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 ); - 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() ) disconnected.erase( link ); @@ -148,7 +148,7 @@ PNS_ITEM* PNS_TOPOLOGY::NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor, int best_dist = INT_MAX; PNS_ITEM* best = NULL; - BOOST_FOREACH( PNS_ITEM* item, disconnected ) + for( PNS_ITEM* item : disconnected ) { if( item->OfKind( aKindMask ) ) { @@ -188,7 +188,7 @@ bool PNS_TOPOLOGY::followTrivialPath( PNS_LINE* aLine, bool aLeft, PNS_ITEMSET& PNS_ITEM* via = 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 ) ) via = link; @@ -346,7 +346,7 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair ) if( ( refSeg = dyn_cast( aStart ) ) != NULL ) { - BOOST_FOREACH( PNS_ITEM* item, coupledItems ) + for( PNS_ITEM* item : coupledItems ) { if( PNS_SEGMENT* s = dyn_cast( item ) ) { @@ -419,7 +419,7 @@ const std::set PNS_TOPOLOGY::AssembleCluster( PNS_ITEM* aStart, int a 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 ) ) { diff --git a/pcbnew/router/pns_walkaround.cpp b/pcbnew/router/pns_walkaround.cpp index c7e7e194f3..27e3ad6f96 100644 --- a/pcbnew/router/pns_walkaround.cpp +++ b/pcbnew/router/pns_walkaround.cpp @@ -18,7 +18,6 @@ * with this program. If not, see . */ -#include #include #include diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 6dab447a2a..66e4931caa 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -20,7 +20,6 @@ #include -#include #include #include using namespace std::placeholders; diff --git a/pcbnew/tools/edit_points.cpp b/pcbnew/tools/edit_points.cpp index cbd2a777ba..1ee9d64f5f 100644 --- a/pcbnew/tools/edit_points.cpp +++ b/pcbnew/tools/edit_points.cpp @@ -22,8 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include #include "edit_points.h" @@ -74,7 +72,7 @@ int EDIT_POINTS::GetContourStartIdx( int aPointIdx ) const { int lastIdx = 0; - BOOST_FOREACH( int idx, m_contours ) + for( int idx : m_contours ) { if( idx >= aPointIdx ) return lastIdx; @@ -88,7 +86,7 @@ int EDIT_POINTS::GetContourStartIdx( int aPointIdx ) const int EDIT_POINTS::GetContourEndIdx( int aPointIdx ) const { - BOOST_FOREACH( int idx, m_contours ) + for( int idx : m_contours ) { if( idx >= aPointIdx ) return idx; @@ -100,7 +98,7 @@ int EDIT_POINTS::GetContourEndIdx( 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 ) return true; @@ -116,7 +114,7 @@ bool EDIT_POINTS::IsContourStart( int aPointIdx ) const bool EDIT_POINTS::IsContourEnd( int aPointIdx ) const { - BOOST_FOREACH( int idx, m_contours ) + for( int idx : m_contours ) { if( idx == aPointIdx ) 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 ); - 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 ); - BOOST_FOREACH( const EDIT_LINE& line, m_lines ) + for( const EDIT_LINE& line : m_lines ) { aGal->DrawCircle( line.GetPosition(), size / 2 ); } diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 907e2b98eb..9d3b7dde1b 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -43,7 +43,6 @@ #include #include -#include #include using namespace std::placeholders; @@ -976,7 +975,7 @@ void EDIT_TOOL::processUndoBuffer( const PICKED_ITEMS_LIST* aLastChange ) const std::vector& undoList = editFrame->GetScreen()->m_UndoList.m_CommandsList; bool process = false; - BOOST_FOREACH( const PICKED_ITEMS_LIST* list, undoList ) + for( const PICKED_ITEMS_LIST* list : undoList ) { if( process ) 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 if( !process ) { - BOOST_FOREACH( const PICKED_ITEMS_LIST* list, undoList ) + for( const PICKED_ITEMS_LIST* list : undoList ) processPickedList( list ); } } diff --git a/pcbnew/tools/grid_helper.cpp b/pcbnew/tools/grid_helper.cpp index 18f31d084d..ac94c2eace 100644 --- a/pcbnew/tools/grid_helper.cpp +++ b/pcbnew/tools/grid_helper.cpp @@ -22,7 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include using namespace std::placeholders; @@ -219,7 +218,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, BOARD_ITEM* aDrag clearAnchors(); - BOOST_FOREACH( BOARD_ITEM* item, queryVisible( bb ) ) + for( BOARD_ITEM* item : queryVisible( bb ) ) { computeAnchors( item, aOrigin ); } @@ -370,7 +369,7 @@ GRID_HELPER::ANCHOR* GRID_HELPER::nearestAnchor( const VECTOR2I& aPos, int aFlag double minDist = std::numeric_limits::max(); ANCHOR* best = NULL; - BOOST_FOREACH( ANCHOR& a, m_anchors ) + for( ANCHOR& a : m_anchors ) { if( !aMatchLayers[a.item->GetLayer()] ) continue; diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index d5cfeb4f12..2e5ae48c8f 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -46,7 +46,6 @@ #include using namespace std::placeholders; -#include #include MODULE_TOOLS::MODULE_TOOLS() : @@ -280,7 +279,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) selectedPads.unique(); } - BOOST_FOREACH( D_PAD* pad, selectedPads ) + for( D_PAD* pad : selectedPads ) { std::set::iterator it = allPads.find( pad ); @@ -311,7 +310,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) m_frame->OnModify(); 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->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(); m_frame->DisplayToolMsg( wxEmptyString ); @@ -550,7 +549,7 @@ int MODULE_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent ) bool enable = !settings->GetSketchMode( layers[0] ); - BOOST_FOREACH( LAYER_NUM layer, layers ) + for( LAYER_NUM layer : layers ) settings->SetSketchMode( layer, enable ); for( MODULE* module = getModel()->m_Modules; module; module = module->Next() ) @@ -584,7 +583,7 @@ int MODULE_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent ) bool enable = !settings->GetSketchMode( layers[0] ); - BOOST_FOREACH( LAYER_NUM layer, layers ) + for( LAYER_NUM layer : layers ) settings->SetSketchMode( layer, enable ); for( MODULE* module = getModel()->m_Modules; module; module = module->Next() ) diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index d962492e07..8452d18816 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -32,7 +32,6 @@ #include #include -#include PLACEMENT_TOOL::PLACEMENT_TOOL() : 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 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; @@ -324,7 +323,7 @@ int PLACEMENT_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) // Distance between items 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; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 5eab61bcde..d08ca74c50 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -24,7 +24,6 @@ */ #include -#include #include 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 ) ); - BOOST_FOREACH( BOARD_CONNECTED_ITEM* i, itemsList ) + for( BOARD_CONNECTED_ITEM* i : itemsList ) select( i ); // Inform other potentially interested tools @@ -695,7 +694,7 @@ int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) clearSelection(); 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 ); // Inform other potentially interested tools @@ -1194,7 +1193,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c { aCollector.Empty(); - BOOST_FOREACH( BOARD_ITEM* item, preferred ) + for( BOARD_ITEM* item : preferred ) aCollector.Append( item ); return; } @@ -1364,7 +1363,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c if( (unsigned) aCollector.GetCount() > rejected.size() ) // do not remove everything { - BOOST_FOREACH( BOARD_ITEM* item, rejected ) + for( BOARD_ITEM* item : rejected ) { aCollector.Remove( item ); } @@ -1405,7 +1404,7 @@ bool SELECTION_TOOL::SanitizeSelection() if( !rejected.empty() ) { - BOOST_FOREACH( BOARD_ITEM* item, rejected ) + for( BOARD_ITEM* item : rejected ) unselect( item ); // Inform other potentially interested tools @@ -1414,7 +1413,7 @@ bool SELECTION_TOOL::SanitizeSelection() if( !added.empty() ) { - BOOST_FOREACH( BOARD_ITEM* item, added ) + for( BOARD_ITEM* item : added ) select( item ); // Inform other potentially interested tools diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index 478751ce59..0e5d74bd71 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -69,8 +69,6 @@ #include #include -#include - /* DEBUG OPTION: * To emit zone data to a file when filling zones for the debugging purposes, * set this 'true' and build.