diff --git a/eeschema/dialogs/dialog_sim_settings.cpp b/eeschema/dialogs/dialog_sim_settings.cpp index 8301c8329a..6fb55ddce8 100644 --- a/eeschema/dialogs/dialog_sim_settings.cpp +++ b/eeschema/dialogs/dialog_sim_settings.cpp @@ -365,17 +365,17 @@ int DIALOG_SIM_SETTINGS::ShowModal() { m_noiseRef, m_noiseRef->GetStringSelection() } }; - for( auto c : cmbNet ) + for( auto& c : cmbNet ) c.first->Clear(); for( const auto& net : m_circuitModel->GetNets() ) { - for( auto c : cmbNet ) + for( auto& c : cmbNet ) c.first->Append( net ); } // Try to restore the previous selection, if possible - for( auto c : cmbNet ) + for( auto& c : cmbNet ) { int idx = c.first->FindString( c.second ); diff --git a/eeschema/sim/sim_plot_panel.cpp b/eeschema/sim/sim_plot_panel.cpp index 573532d5fd..ff58c367ef 100644 --- a/eeschema/sim/sim_plot_panel.cpp +++ b/eeschema/sim/sim_plot_panel.cpp @@ -638,7 +638,7 @@ void SIM_PLOT_PANEL::ResetScales() if( m_axis_y2 ) m_axis_y2->ResetDataRange(); - for( auto t : m_traces ) + for( auto& t : m_traces ) t.second->UpdateScales(); } diff --git a/eeschema/symbol_library_manager.cpp b/eeschema/symbol_library_manager.cpp index 3f5775bc9c..e9d7f12030 100644 --- a/eeschema/symbol_library_manager.cpp +++ b/eeschema/symbol_library_manager.cpp @@ -1256,7 +1256,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::HasDerivedSymbols( const wxString& aPar void SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetRootSymbolNames( wxArrayString& aRootSymbolNames ) { - for( auto entry : m_symbols ) + for( auto& entry : m_symbols ) { if( entry->GetSymbol()->IsAlias() ) continue; diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index f7562c20c9..2effe01086 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -437,7 +437,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles() std::vector gerberExts( GerberFileExtensions ); gerberExts.push_back( DrillFileExtension ); - for( auto fileName : m_AcceptedFiles ) + for( const wxFileName& fileName : m_AcceptedFiles ) { if( IsExtensionAccepted( fileName.GetExt(), gerberExts ) ) { diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index 11d0ee161a..6f0b8cc67b 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -97,7 +97,7 @@ VVIA* DRAGGER::checkVirtualVia( const VECTOR2D& aP, SEGMENT* aSeg ) return nullptr; } - for( auto lnk : jt->LinkList() ) + for( auto& lnk : jt->LinkList() ) { if( lnk.item->IsVirtual() && lnk.item->OfKind( ITEM::VIA_T )) { diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 5fb36941b6..377fba7ee8 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -565,7 +565,7 @@ void ROUTER_TOOL::saveRouterDebugLog() const auto& events = logger->GetEvents(); - for( auto evt : events) + for( const auto& evt : events) { fprintf( f, "event %d %d %d %s\n", evt.p.x, evt.p.y, evt.type, static_cast( evt.uuid.AsString().c_str() ) ); diff --git a/qa/unittests/eeschema/test_pin_numbers.cpp b/qa/unittests/eeschema/test_pin_numbers.cpp index a0cbe095b7..1b93f7dff3 100644 --- a/qa/unittests/eeschema/test_pin_numbers.cpp +++ b/qa/unittests/eeschema/test_pin_numbers.cpp @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE( ComparePinNumbers ) }; - for( auto el : cases ) + for( auto& el : cases ) { int retval = PIN_NUMBERS::Compare( el.m_lhs, el.m_rhs ); wxString msg; diff --git a/qa/unittests/pcbnew/test_graphics_import_mgr.cpp b/qa/unittests/pcbnew/test_graphics_import_mgr.cpp index 2f81749e0d..8cae0d1850 100644 --- a/qa/unittests/pcbnew/test_graphics_import_mgr.cpp +++ b/qa/unittests/pcbnew/test_graphics_import_mgr.cpp @@ -37,7 +37,7 @@ static bool pluginHandlesExt( const GRAPHICS_IMPORT_PLUGIN& aPlugin, const std:: { const auto exts = aPlugin.GetFileExtensions(); - for( auto ext : exts ) + for( const auto& ext : exts ) { std::regex ext_reg( ext );