Try Coverity fixes that don't break unit tests.

This commit is contained in:
Wayne Stambaugh 2022-03-25 16:49:29 -04:00
parent 7da7864f5e
commit 150859c973
2 changed files with 5 additions and 9 deletions

View File

@ -165,14 +165,12 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
std::vector<BOARD_ITEM*> bulkRemovedItems;
std::vector<BOARD_ITEM*> itemsChanged;
wxCHECK( frame, /* void */ );
if( Empty() )
return;
if( m_isBoardEditor
&& !( aCommitFlags & ZONE_FILL_OP )
&& frame->GetPcbNewSettings()->m_AutoRefillZones )
&& !( aCommitFlags & ZONE_FILL_OP )
&& ( frame && frame->GetPcbNewSettings()->m_AutoRefillZones ) )
{
autofillZones = true;

View File

@ -237,8 +237,6 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
if( zone && zone->GetIsRuleArea() )
return true;
wxCHECK( pad, false );
item->ClearFlags( HOLE_PROXY ); // Just in case
checkDisallow( item );
@ -247,9 +245,9 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
switch( item->Type() )
{
case PCB_VIA_T: hasHole = true; break;
case PCB_PAD_T: hasHole = pad->GetDrillSizeX() > 0; break;
default: hasHole = false; break;
case PCB_VIA_T: hasHole = true; break;
case PCB_PAD_T: hasHole = pad && pad->GetDrillSizeX() > 0; break;
default: hasHole = false; break;
}
if( hasHole )