Fix Coverity warnings

This commit is contained in:
jean-pierre charras 2021-10-15 09:24:16 +02:00
parent 4852a8afa1
commit 0533196294
2 changed files with 2 additions and 1 deletions

View File

@ -867,7 +867,6 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
// update footprint in the current board, // update footprint in the current board,
// not just add it to the board with total disregard for the netlist... // not just add it to the board with total disregard for the netlist...
PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false ); PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
TOOL_MANAGER* toolMgr = pcbframe->GetToolManager();
if( pcbframe == nullptr ) // happens when the board editor is not active (or closed) if( pcbframe == nullptr ) // happens when the board editor is not active (or closed)
{ {
@ -875,6 +874,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
return false; return false;
} }
TOOL_MANAGER* toolMgr = pcbframe->GetToolManager();
BOARD* mainpcb = pcbframe->GetBoard(); BOARD* mainpcb = pcbframe->GetBoard();
FOOTPRINT* sourceFootprint = nullptr; FOOTPRINT* sourceFootprint = nullptr;
FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint(); FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint();

View File

@ -177,6 +177,7 @@ BOARD_EDITOR_CONTROL::BOARD_EDITOR_CONTROL() :
PCB_TOOL_BASE( "pcbnew.EditorControl" ), PCB_TOOL_BASE( "pcbnew.EditorControl" ),
m_frame( nullptr ), m_frame( nullptr ),
m_inPlaceFootprint( false ), m_inPlaceFootprint( false ),
m_placingFootprint( false ),
m_inPlaceTarget( false ) m_inPlaceTarget( false )
{ {
m_placeOrigin = std::make_unique<KIGFX::ORIGIN_VIEWITEM>( KIGFX::COLOR4D( 0.8, 0.0, 0.0, 1.0 ), m_placeOrigin = std::make_unique<KIGFX::ORIGIN_VIEWITEM>( KIGFX::COLOR4D( 0.8, 0.0, 0.0, 1.0 ),