From 4b3ac52b1d40e0c95d5ead12c862f2c6c8c977cd Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 15 Aug 2022 08:03:30 -0700 Subject: [PATCH] Fix shadowed variables --- common/dialogs/panel_setup_netclasses.cpp | 32 +++++++++---------- .../dialog_global_edit_tracks_and_vias.cpp | 18 +++++------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index 00ac8b3b1c..b3e06c8f92 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -338,44 +338,44 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow() int row = 0; auto getCell = - [&]( int aRow, int aCol ) -> long long int + [this, units]( int aRow, int aCol ) -> long long int { return ValueFromString( units, m_netclassGrid->GetCellValue( aRow, aCol ) ); }; auto getCellStr = - [&]( int aRow, int aCol ) -> wxString + [this]( int aRow, int aCol ) -> wxString { return m_netclassGrid->GetCellValue( aRow, aCol ); }; auto gridRowToNetclass = - [&]( int row, const std::shared_ptr& nc ) + [&]( int aRow, const std::shared_ptr& nc ) { - nc->SetName( m_netclassGrid->GetCellValue( row, GRID_NAME ) ); + nc->SetName( m_netclassGrid->GetCellValue( aRow, GRID_NAME ) ); if( m_isEEschema ) { - nc->SetWireWidth( getCell( row, GRID_WIREWIDTH - EESCHEMA_COL_OFFSET ) ); - nc->SetBusWidth( getCell( row, GRID_BUSWIDTH - EESCHEMA_COL_OFFSET ) ); + nc->SetWireWidth( getCell( aRow, GRID_WIREWIDTH - EESCHEMA_COL_OFFSET ) ); + nc->SetBusWidth( getCell( aRow, GRID_BUSWIDTH - EESCHEMA_COL_OFFSET ) ); - wxString color = getCellStr( row, GRID_SCHEMATIC_COLOR - EESCHEMA_COL_OFFSET ); + wxString color = getCellStr( aRow, GRID_SCHEMATIC_COLOR - EESCHEMA_COL_OFFSET ); nc->SetSchematicColor( wxColour( color ) ); - wxString lineStyle = getCellStr( row, GRID_LINESTYLE - EESCHEMA_COL_OFFSET ); + wxString lineStyle = getCellStr( aRow, GRID_LINESTYLE - EESCHEMA_COL_OFFSET ); nc->SetLineStyle( g_lineStyleNames.Index( lineStyle ) ); wxASSERT_MSG( nc->GetLineStyle() >= 0, "Line style name not found." ); } else { - nc->SetClearance( getCell( row, GRID_CLEARANCE ) ); - nc->SetTrackWidth( getCell( row, GRID_TRACKSIZE ) ); - nc->SetViaDiameter( getCell( row, GRID_VIASIZE ) ); - nc->SetViaDrill( getCell( row, GRID_VIADRILL ) ); - nc->SetuViaDiameter( getCell( row, GRID_uVIASIZE ) ); - nc->SetuViaDrill( getCell( row, GRID_uVIADRILL ) ); - nc->SetDiffPairWidth( getCell( row, GRID_DIFF_PAIR_WIDTH ) ); - nc->SetDiffPairGap( getCell( row, GRID_DIFF_PAIR_GAP ) ); + nc->SetClearance( getCell( aRow, GRID_CLEARANCE ) ); + nc->SetTrackWidth( getCell( aRow, GRID_TRACKSIZE ) ); + nc->SetViaDiameter( getCell( aRow, GRID_VIASIZE ) ); + nc->SetViaDrill( getCell( aRow, GRID_VIADRILL ) ); + nc->SetuViaDiameter( getCell( aRow, GRID_uVIASIZE ) ); + nc->SetuViaDrill( getCell( aRow, GRID_uVIADRILL ) ); + nc->SetDiffPairWidth( getCell( aRow, GRID_DIFF_PAIR_WIDTH ) ); + nc->SetDiffPairGap( getCell( aRow, GRID_DIFF_PAIR_GAP ) ); } }; diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index 7ad6ca9b40..db81371d81 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -234,20 +234,20 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid() row++; auto setNetclassValue = - [&]( int row, int col, int value ) + [this, units]( int aRow, int aCol, int aVal ) { - m_netclassGrid->SetCellValue( row, col, StringFromValue( units, value, true ) ); + m_netclassGrid->SetCellValue( aRow, aCol, StringFromValue( units, aVal, true ) ); }; auto buildRow = - [&]( int row, const std::shared_ptr& nc ) + [this, &setNetclassValue]( int aRow, const std::shared_ptr& aNc ) { - m_netclassGrid->SetCellValue( row, GRID_NAME, nc->GetName() ); - setNetclassValue( row, GRID_TRACKSIZE, nc->GetTrackWidth() ); - setNetclassValue( row, GRID_VIASIZE, nc->GetViaDiameter() ); - setNetclassValue( row, GRID_VIADRILL, nc->GetViaDrill() ); - setNetclassValue( row, GRID_uVIASIZE, nc->GetuViaDiameter() ); - setNetclassValue( row, GRID_uVIADRILL, nc->GetuViaDrill() ); + m_netclassGrid->SetCellValue( aRow, GRID_NAME, aNc->GetName() ); + setNetclassValue( aRow, GRID_TRACKSIZE, aNc->GetTrackWidth() ); + setNetclassValue( aRow, GRID_VIASIZE, aNc->GetViaDiameter() ); + setNetclassValue( aRow, GRID_VIADRILL, aNc->GetViaDrill() ); + setNetclassValue( aRow, GRID_uVIASIZE, aNc->GetuViaDiameter() ); + setNetclassValue( aRow, GRID_uVIADRILL, aNc->GetuViaDrill() ); }; const std::shared_ptr& settings = m_brd->GetDesignSettings().m_NetSettings;