Cleanup compiler warnings

This commit is contained in:
Ian McInerney 2020-10-09 02:15:03 +01:00
parent 1df35145b5
commit 5aa796b5fe
5 changed files with 36 additions and 37 deletions

View File

@ -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<LIBEDIT_SETTINGS>();
KICAD_T type = aEvent.Parameter<KICAD_T>();
EE_POINT_EDITOR* pointEditor = m_toolMgr->GetTool<EE_POINT_EDITOR>();
// 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 );
};

View File

@ -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();

View File

@ -461,7 +461,6 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_L
int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, bool aQuitOnDraw )
{
SCH_SCREEN* screen = m_frame->GetScreen();
EE_POINT_EDITOR* pointEditor = m_toolMgr->GetTool<EE_POINT_EDITOR>();
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 );
};

View File

@ -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<PL_POINT_EDITOR>();
WS_DATA_ITEM::WS_ITEM_TYPE type = aEvent.Parameter<WS_DATA_ITEM::WS_ITEM_TYPE>();
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 );
};

View File

@ -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<POINT_EDITOR>();
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 );
};