Fix minor Coverity and compil warnings.

This commit is contained in:
jean-pierre charras 2022-04-01 17:42:27 +02:00
parent 6f818f4c2e
commit be6379a8f6
3 changed files with 21 additions and 20 deletions

View File

@ -1085,7 +1085,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnUpdateUI( wxUpdateUIEvent& event )
getSelectedArea( m_grid, &firstSelectedRow, &selectedRowCount ); getSelectedArea( m_grid, &firstSelectedRow, &selectedRowCount );
if( selectedRowCount > 1 != m_groupSelected->IsEnabled() ) if( ( selectedRowCount > 1 ) != m_groupSelected->IsEnabled() )
m_groupSelected->Enable( selectedRowCount > 1 ); m_groupSelected->Enable( selectedRowCount > 1 );
} }

View File

@ -154,17 +154,21 @@ protected:
SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ); SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
wxASSERT( editFrame ); wxASSERT( editFrame );
if( editFrame )
{
if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T ) if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
{ {
editFrame->SaveCopyInUndoList( editFrame->GetScreen(), editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
static_cast<SCH_ITEM*>( aItem->GetParent() ), static_cast<SCH_ITEM*>( aItem->GetParent() ),
UNDO_REDO::CHANGED, aAppend, aDirtyConnectivity ); UNDO_REDO::CHANGED, aAppend,
aDirtyConnectivity );
} }
else else
{ {
editFrame->SaveCopyInUndoList( editFrame->GetScreen(), editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
static_cast<SCH_ITEM*>( aItem ), aType, aAppend, static_cast<SCH_ITEM*>( aItem ), aType,
aDirtyConnectivity ); aAppend, aDirtyConnectivity );
}
} }
} }

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2019 CERN * Copyright (C) 2019 CERN
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -885,14 +885,11 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
segment->SetEndPoint( cursorPos ); segment->SetEndPoint( cursorPos );
// Find new bend point for current mode // Find new bend point for current mode
if( segment )
{
if( twoSegments && m_wires.size() >= 2 ) if( twoSegments && m_wires.size() >= 2 )
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos, computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode ); currentMode );
else else
segment->SetEndPoint( cursorPos ); segment->SetEndPoint( cursorPos );
}
for( SCH_LINE* wire : m_wires ) for( SCH_LINE* wire : m_wires )
{ {