Coverity issue fixes.

This commit is contained in:
Wayne Stambaugh 2023-08-27 15:16:29 -04:00
parent f4bf3bf611
commit e4feb8826b
7 changed files with 19 additions and 9 deletions

View File

@ -461,6 +461,9 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
if( symbol->IsAlias() )
{
LIB_SYMBOL_SPTR parent = symbol->GetRootSymbol().lock();
wxCHECK( parent, CLI::EXIT_CODES::ERR_UNKNOWN );
symbolToPlot = parent.get();
}
@ -815,4 +818,4 @@ DS_PROXY_VIEW_ITEM* EESCHEMA_JOBS_HANDLER::getDrawingSheetProxyView( SCHEMATIC*
drawingSheet->SetSheetPath( "" );
return drawingSheet;
}
}

View File

@ -431,6 +431,8 @@ INSPECT_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* aTestItem, void* aTestData
}
else if( aTestItem->Type() == PCB_FOOTPRINT_T )
{
wxCHECK( footprint, INSPECT_RESULT::CONTINUE );
if( footprint->HitTest( m_refPos, accuracy )
&& footprint->HitTestAccurate( m_refPos, accuracy ) )
{

View File

@ -292,6 +292,7 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile )
svgPlotOptions.m_colorTheme = ""; // will use default
svgPlotOptions.m_mirror = m_printMirror;
svgPlotOptions.m_plotFrame = svgPlotOptions.m_pageSizeMode == 0;
svgPlotOptions.m_drillShapeOption = 2; // actual size hole.
for( LSEQ seq = all_selected.Seq(); seq; ++seq )
{

View File

@ -424,8 +424,8 @@ void DP_GATEWAYS::BuildFromPrimitivePair( const DP_PRIMITIVE_PAIR& aPair, bool a
{
VECTOR2I majorDirection;
VECTOR2I p0_p, p0_n;
int orthoFanDistance;
int diagFanDistance;
int orthoFanDistance = 0;
int diagFanDistance = 0;
const SHAPE* shP = nullptr;
if( aPair.PrimP() == nullptr )

View File

@ -239,6 +239,7 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode,
obs.m_head = const_cast<ITEM*>( aHead );
obs.m_item = const_cast<ITEM*>( this );
obs.m_clearance = clearance;
obs.m_distFirst = 0;
aCtx->obstacles.insert( obs );
}
else

View File

@ -41,7 +41,7 @@ public:
if( aInitialItem )
m_items.emplace_back( aInitialItem );
if( aBecomeOwner )
if( aBecomeOwner && aInitialItem )
aInitialItem->SetOwner( this );
}

View File

@ -124,8 +124,8 @@ bool ROUTER::RoutingInProgress() const
const ITEM_SET ROUTER::QueryHoverItems( const VECTOR2I& aP, bool aUseClearance )
{
NODE* node;
int clearance;
NODE* node = nullptr;
int clearance = 0;
if( m_state == IDLE || m_placer == nullptr )
{
@ -154,12 +154,15 @@ const ITEM_SET ROUTER::QueryHoverItems( const VECTOR2I& aP, bool aUseClearance )
opts.m_differentNetsOnly = false;
opts.m_overrideClearance = clearance;
node->QueryColliding( &test, obs, opts );
PNS::ITEM_SET ret;
for( const OBSTACLE& obstacle : obs )
ret.Add( obstacle.m_item, false );
wxCHECK( node, ret );
node->QueryColliding( &test, obs, opts );
for( const OBSTACLE& obstacle : obs )
ret.Add( obstacle.m_item, false );
return ret;
}