From 99da663e82d787cb8c365958bb6d6a5f6cca6569 Mon Sep 17 00:00:00 2001 From: Dominik Wernberger Date: Fri, 30 Oct 2020 20:31:23 +0100 Subject: [PATCH] Remove unused variables plus some more fixes from CppCheck Remove unused variables plus a few more fixes from CppCheck Remove unused variables plus a few more fixes from CppCheck --- common/build_version.cpp | 4 ++-- common/dialogs/panel_gal_display_options.h | 2 +- eeschema/netlist_exporters/netlist_exporter_cadstar.cpp | 2 -- gerbview/rs274d.cpp | 3 --- pcbnew/plugins/pcad/pcb_footprint.cpp | 5 ++--- pcbnew/router/pns_kicad_iface.cpp | 2 -- pcbnew/router/router_tool.cpp | 2 -- pcbnew/tools/selection_tool.cpp | 4 ---- utils/idftools/vrml_layer.cpp | 2 -- utils/kicad2step/pcb/oce_utils.cpp | 2 +- utils/kicad2step/pcb/oce_utils.h | 2 +- 11 files changed, 7 insertions(+), 23 deletions(-) diff --git a/common/build_version.cpp b/common/build_version.cpp index d268daec06..c05fc41c8c 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -120,10 +120,10 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) aMsg << eol << eol; if( !aBrief ) + { aMsg << "Build Info:" << eol; - - if( !aBrief ) aMsg << indent4 << "Date: " << GetBuildDate() << eol; + } aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " ("; aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")"; diff --git a/common/dialogs/panel_gal_display_options.h b/common/dialogs/panel_gal_display_options.h index 06f519ce62..3ac3a84e8e 100644 --- a/common/dialogs/panel_gal_display_options.h +++ b/common/dialogs/panel_gal_display_options.h @@ -30,7 +30,7 @@ class PAGED_DIALOG; class PANEL_GAL_DISPLAY_OPTIONS : public wxPanel { public: - PANEL_GAL_DISPLAY_OPTIONS( EDA_DRAW_FRAME* aParent, PAGED_DIALOG* aWindow ); + PANEL_GAL_DISPLAY_OPTIONS( EDA_DRAW_FRAME* aFrame, PAGED_DIALOG* aParent ); private: bool TransferDataToWindow() override; diff --git a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp index e967b15416..8212ff9084 100644 --- a/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_cadstar.cpp @@ -69,8 +69,6 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig for( unsigned i = 0; i < sheetList.size(); i++ ) { - std::vector cmps; - for( SCH_ITEM* item : sheetList[i].LastScreen()->Items().OfType( SCH_COMPONENT_T ) ) { symbol = findNextSymbol( item, &sheetList[ i ] ); diff --git a/gerbview/rs274d.cpp b/gerbview/rs274d.cpp index 2f8f3c7729..33d3bd90be 100644 --- a/gerbview/rs274d.cpp +++ b/gerbview/rs274d.cpp @@ -381,7 +381,6 @@ static void fillArcPOLY( GERBER_DRAW_ITEM* aGbrItem, // calculate polygon corners // when arc is counter-clockwise, dummyGbrItem arc goes from end to start // and we must always create a polygon from start to end. - wxPoint start_arc = start; for( int ii = 0; ii <= count; ii++ ) { double rot; @@ -397,8 +396,6 @@ static void fillArcPOLY( GERBER_DRAW_ITEM* aGbrItem, end_arc = aClockwise ? end : start; aGbrItem->m_Polygon.Append( VECTOR2I( end_arc + center ) ); - - start_arc = end_arc; } } diff --git a/pcbnew/plugins/pcad/pcb_footprint.cpp b/pcbnew/plugins/pcad/pcb_footprint.cpp index 069a761f82..a741e05dd9 100644 --- a/pcbnew/plugins/pcad/pcb_footprint.cpp +++ b/pcbnew/plugins/pcad/pcb_footprint.cpp @@ -421,10 +421,9 @@ void PCB_FOOTPRINT::Parse( XNODE* aNode, wxStatusBar* aStatusBar, tNode = tNode->GetNext(); } - } - if( lNode ) - lNode = lNode->GetParent(); + lNode = lNode->GetParent(); + } if( lNode ) lNode = FindNode( lNode, wxT( "layerContents" ) ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 3d98481859..97a87b400c 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -901,8 +901,6 @@ std::unique_ptr PNS_KICAD_IFACE_BASE::syncArc( ARC* aArc ) std::unique_ptr PNS_KICAD_IFACE_BASE::syncVia( VIA* aVia ) { - std::vector> retval; - PCB_LAYER_ID top, bottom; aVia->LayerPair( &top, &bottom ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 6e4088e4c2..d3d912ace3 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -806,8 +806,6 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent ) viaType = VIATYPE::THROUGH; } - std::pair layerPair; - switch( viaType ) { case VIATYPE::THROUGH: diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 2024901fea..1a12657566 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1206,9 +1206,6 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) netcodeList.sort(); netcodeList.unique(); - // auto select trivial connections segments which are launched from the pads - std::list launchTracks; - for( PAD* pad : padList ) selectConnectedTracks( *pad, STOP_NEVER ); @@ -2255,7 +2252,6 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, { std::set preferred; std::set rejected; - std::set forced; wxPoint where( aWhere.x, aWhere.y ); // footprints which are below this percentage of the largest footprint will be considered diff --git a/utils/idftools/vrml_layer.cpp b/utils/idftools/vrml_layer.cpp index c3a84c0fdf..fa16d062ac 100644 --- a/utils/idftools/vrml_layer.cpp +++ b/utils/idftools/vrml_layer.cpp @@ -2013,8 +2013,6 @@ bool VRML_LAYER::Get2DTriangles( std::vector< double >& aVertexList, std::list< TRIPLET_3D >::const_iterator tbeg = triplets.begin(); std::list< TRIPLET_3D >::const_iterator tend = triplets.end(); - std::vector< int > aIndexBot; - if( aTopPlane ) { while( tbeg != tend ) diff --git a/utils/kicad2step/pcb/oce_utils.cpp b/utils/kicad2step/pcb/oce_utils.cpp index 906da80494..8682317312 100644 --- a/utils/kicad2step/pcb/oce_utils.cpp +++ b/utils/kicad2step/pcb/oce_utils.cpp @@ -954,7 +954,7 @@ bool PCBMODEL::WriteSTEP( const wxString& aFileName ) } -bool PCBMODEL::getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_Label& aLabel ) +bool PCBMODEL::getModelLabel( const std::string& aFileName, TRIPLET aScale, TDF_Label& aLabel ) { std::string model_key = aFileName + "_" + std::to_string( aScale.x ) + "_" + std::to_string( aScale.y ) + "_" + std::to_string( aScale.z ); diff --git a/utils/kicad2step/pcb/oce_utils.h b/utils/kicad2step/pcb/oce_utils.h index 989e735f24..8dc751d058 100644 --- a/utils/kicad2step/pcb/oce_utils.h +++ b/utils/kicad2step/pcb/oce_utils.h @@ -99,7 +99,7 @@ class PCBMODEL std::list< KICADCURVE > m_curves; std::vector< TopoDS_Shape > m_cutouts; - bool getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_Label& aLabel ); + bool getModelLabel( const std::string& aFileName, TRIPLET aScale, TDF_Label& aLabel ); bool getModelLocation( bool aBottom, DOUBLET aPosition, double aRotation, TRIPLET aOffset, TRIPLET aOrientation, TopLoc_Location& aLocation );