Browse Source

Fix some compiler and Coverity warnings

6.0.7
Ian McInerney 5 years ago
parent
commit
fc20eaa083
  1. 1
      common/rc_item.cpp
  2. 3
      eeschema/dialogs/dialog_change_symbols.cpp
  3. 4
      eeschema/schematic.cpp
  4. 2
      eeschema/tools/ee_grid_helper.cpp
  5. 8
      pcbnew/tools/board_inspection_tool.cpp

1
common/rc_item.cpp

@ -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:

3
eeschema/dialogs/dialog_change_symbols.cpp

@ -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

4
eeschema/schematic.cpp

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

2
eeschema/tools/ee_grid_helper.cpp

@ -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;
}

8
pcbnew/tools/board_inspection_tool.cpp

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

Loading…
Cancel
Save