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 );
if( selectedRowCount > 1 != m_groupSelected->IsEnabled() )
if( ( selectedRowCount > 1 ) != m_groupSelected->IsEnabled() )
m_groupSelected->Enable( selectedRowCount > 1 );
}

View File

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

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* 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
* 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 );
// Find new bend point for current mode
if( segment )
{
if( twoSegments && m_wires.size() >= 2 )
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode );
else
segment->SetEndPoint( cursorPos );
}
if( twoSegments && m_wires.size() >= 2 )
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode );
else
segment->SetEndPoint( cursorPos );
for( SCH_LINE* wire : m_wires )
{