From 5aa796b5fe1310da230f8dbc1092b6acf00fb01b Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Fri, 9 Oct 2020 02:15:03 +0100 Subject: [PATCH] Cleanup compiler warnings --- eeschema/tools/lib_drawing_tools.cpp | 15 ++++----- eeschema/tools/sch_drawing_tools.cpp | 5 ++- eeschema/tools/sch_line_wire_bus_tool.cpp | 5 ++- pagelayout_editor/tools/pl_drawing_tools.cpp | 13 ++++---- pcbnew/tools/drawing_tool.cpp | 35 ++++++++++---------- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/eeschema/tools/lib_drawing_tools.cpp b/eeschema/tools/lib_drawing_tools.cpp index 55ff52dc98..173ae63f98 100644 --- a/eeschema/tools/lib_drawing_tools.cpp +++ b/eeschema/tools/lib_drawing_tools.cpp @@ -90,8 +90,8 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() ) m_toolMgr->RunAction( ACTIONS::cursorClick ); - auto setCursor = - [&]() + auto setCursor = + [&]() { if( item ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING ); @@ -259,7 +259,6 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { LIBEDIT_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings(); KICAD_T type = aEvent.Parameter(); - EE_POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); // We might be running as the same shape in another co-routine. Make sure that one // gets whacked. @@ -279,8 +278,8 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() ) m_toolMgr->RunAction( ACTIONS::cursorClick ); - auto setCursor = - [&]() + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL ); }; @@ -427,9 +426,9 @@ int LIB_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent ) m_frame->PushTool( tool ); Activate(); - auto setCursor = - [&]() - { + auto setCursor = + [&]() + { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::BULLSEYE ); }; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 1faeee1e7f..a1d77c55ec 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -622,7 +622,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) m_frame->OnModify(); } } - break; + break; case SCH_JUNCTION_T: { @@ -638,6 +638,9 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) } } break; + default: + // Do nothing + break; } m_view->ClearPreview(); diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 7fe376964b..3c3535ceb3 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -461,7 +461,6 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pairGetScreen(); - EE_POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); SCH_LINE* segment = nullptr; EE_GRID_HELPER grid( m_toolMgr ); @@ -481,8 +480,8 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, if( !m_wires.empty() ) segment = m_wires.back(); - auto setCursor = - [&]() + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::WIRE ); }; diff --git a/pagelayout_editor/tools/pl_drawing_tools.cpp b/pagelayout_editor/tools/pl_drawing_tools.cpp index e3cb9d6c45..9fd7bbde85 100644 --- a/pagelayout_editor/tools/pl_drawing_tools.cpp +++ b/pagelayout_editor/tools/pl_drawing_tools.cpp @@ -90,8 +90,8 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() ) m_toolMgr->RunAction( ACTIONS::cursorClick ); - auto setCursor = - [&]() + auto setCursor = + [&]() { if( item ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING ); @@ -205,7 +205,6 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { - PL_POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); WS_DATA_ITEM::WS_ITEM_TYPE type = aEvent.Parameter(); WS_DRAW_ITEM_BASE* item = nullptr; @@ -223,10 +222,10 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) // Prime the pump if( aEvent.HasPosition() ) m_toolMgr->RunAction( ACTIONS::cursorClick ); - - auto setCursor = - [&]() - { + + auto setCursor = + [&]() + { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL ); }; diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 05b922d76f..70bd404771 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -420,8 +420,8 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() ) m_toolMgr->RunAction( ACTIONS::cursorClick ); - auto setCursor = - [&]() + auto setCursor = + [&]() { if( text ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING ); @@ -655,8 +655,8 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) if( aEvent.HasPosition() ) m_toolMgr->PrimeTool( aEvent.Position() ); - auto setCursor = - [&]() + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MEASURE ); }; @@ -1059,9 +1059,9 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) std::string tool = aEvent.GetCommandStr().get(); m_frame->PushTool( tool ); Activate(); - - auto setCursor = - [&]() + + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING ); }; @@ -1151,8 +1151,8 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) m_controls->SetAutoPan( true ); m_controls->CaptureCursor( false ); - auto setCursor = - [&]() + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::BULLSEYE ); }; @@ -1226,7 +1226,6 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, PCB_SHAPE* // Only three shapes are currently supported assert( aShape == S_SEGMENT || aShape == S_CIRCLE || aShape == S_RECT ); GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); - POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); PCB_SHAPE*& graphic = *aGraphic; m_lineWidth = getSegmentWidth( m_frame->GetActiveLayer() ); @@ -1259,9 +1258,9 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, PCB_SHAPE* m_toolMgr->RunAction( ACTIONS::cursorClick ); frame()->SetMsgPanel( graphic ); - - auto setCursor = - [&]() + + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL ); }; @@ -1532,8 +1531,8 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool m_toolMgr->RunAction( ACTIONS::cursorClick ); // Set initial cursor - auto setCursor = - [&]() + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL ); }; @@ -1790,9 +1789,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) // Prime the pump if( aEvent.HasPosition() ) m_toolMgr->PrimeTool( aEvent.Position() ); - - auto setCursor = - [&]() + + auto setCursor = + [&]() { m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL ); };