Fix some compiler and Coverity warnings

This commit is contained in:
Ian McInerney 2020-12-16 23:54:53 +00:00
parent 048900dda7
commit fc20eaa083
5 changed files with 13 additions and 5 deletions

View File

@ -332,6 +332,7 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
case RPT_SEVERITY_ERROR: prefix += _( "Error: " ); break;
case RPT_SEVERITY_WARNING: prefix += _( "Warning: " ); break;
case RPT_SEVERITY_EXCLUSION:
case RPT_SEVERITY_UNDEFINED:
case RPT_SEVERITY_INFO:
case RPT_SEVERITY_ACTION:

View File

@ -237,6 +237,9 @@ void DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser( wxCommandEvent& aEvent )
void DIALOG_CHANGE_SYMBOLS::updateFieldsList()
{
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
wxCHECK( frame, /* void */ );
SCH_SHEET_LIST hierarchy = frame->Schematic().GetSheets();
// Load non-mandatory fields from all matching symbols and their library parts

View File

@ -146,9 +146,9 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_MARKER_T ) )
{
SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
auto it = ErcSettings().m_ErcExclusions.find( marker->Serialize() );
auto it = settings.m_ErcExclusions.find( marker->Serialize() );
if( it != ErcSettings().m_ErcExclusions.end() )
if( it != settings.m_ErcExclusions.end() )
{
marker->SetExcluded( true );
settings.m_ErcExclusions.erase( it );

View File

@ -314,7 +314,7 @@ VECTOR2I EE_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, int aLayer,
if( m_enableGrid && std::abs( nearestGrid.y - aOrigin.y ) < snapDist.y )
{
pt.y = nearestGrid.y;
snapDist.x = std::abs( nearestGrid.y - aOrigin.y );
snapDist.y = std::abs( nearestGrid.y - aOrigin.y );
snapLineY = false;
}

View File

@ -115,6 +115,10 @@ int BOARD_INSPECTION_TOOL::ShowStatisticsDialog( const TOOL_EVENT& aEvent )
wxString BOARD_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem )
{
// Null items have no description
if( !aItem )
return wxString();
wxString s = aItem->GetSelectMenuText( m_frame->GetUserUnits() );
if( aItem->IsConnected() )
@ -309,7 +313,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
if( b->Type() == PCB_GROUP_T )
{
PCB_GROUP* bg = static_cast<PCB_GROUP*>( a );
PCB_GROUP* bg = static_cast<PCB_GROUP*>( b );
if( bg->GetItems().empty() )
{
@ -317,7 +321,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
return 0;
}
a = *bg->GetItems().begin();
b = *bg->GetItems().begin();
}
if( a->Type() == PCB_TRACE_T || a->Type() == PCB_ARC_T )