Coverity fixes.

This commit is contained in:
Maciej Suminski 2016-05-11 11:18:27 +02:00
parent 74d69b6a80
commit a30c8d7848
4 changed files with 15 additions and 10 deletions

View File

@ -163,12 +163,14 @@ bool PNS_DIFF_PAIR_PLACER::propagateDpHeadForces ( const VECTOR2I& aP, VECTOR2I&
}
bool PNS_DIFF_PAIR_PLACER::attemptWalk ( PNS_NODE* aNode, PNS_DIFF_PAIR* aCurrent, PNS_DIFF_PAIR& aWalk, bool aPFirst, bool aWindCw, bool aSolidsOnly )
bool PNS_DIFF_PAIR_PLACER::attemptWalk( PNS_NODE* aNode, PNS_DIFF_PAIR* aCurrent,
PNS_DIFF_PAIR& aWalk, bool aPFirst, bool aWindCw, bool aSolidsOnly )
{
PNS_WALKAROUND walkaround( aNode, Router() );
PNS_WALKAROUND::WALKAROUND_STATUS wf1;
Router()->GetClearanceFunc()->OverrideClearance( true, aCurrent->NetP(), aCurrent->NetN(), aCurrent->Gap() );
Router()->GetClearanceFunc()->OverrideClearance( true,
aCurrent->NetP(), aCurrent->NetN(), aCurrent->Gap() );
walkaround.SetSolidsOnly( aSolidsOnly );
walkaround.SetIterationLimit( Settings().WalkaroundIterationLimit() );
@ -247,13 +249,13 @@ bool PNS_DIFF_PAIR_PLACER::tryWalkDp( PNS_NODE* aNode, PNS_DIFF_PAIR &aPair, boo
PNS_DIFF_PAIR best;
double bestScore = 100000000000000.0;
for( int attempt = 0; attempt <= 1; attempt++ )
for( int attempt = 0; attempt <= 3; attempt++ )
{
PNS_DIFF_PAIR p;
PNS_NODE *tmp = m_currentNode->Branch();
bool pfirst = attempt % 2 ? true : false;
bool wind_cw = attempt / 2 ? true : false;
bool pfirst = ( attempt & 1 ) ? true : false;
bool wind_cw = ( attempt & 2 ) ? true : false;
if( attemptWalk( tmp, &aPair, p, pfirst, wind_cw, aSolidsOnly ) )
{

View File

@ -580,8 +580,8 @@ void PNS_LINE::DragSegment ( const VECTOR2I& aP, int aIndex, int aSnappingThresh
s_next = path.CSegment( index + 1 );
dragged = path.CSegment( index );
bool lockEndpointA = true;
bool lockEndpointB = true;
const bool lockEndpointA = true;
const bool lockEndpointB = true;
if( aIndex == 0 )
{

View File

@ -386,6 +386,7 @@ bool PNS_OPTIMIZER::checkColliding( PNS_ITEM* aItem, bool aUpdateCache )
return static_cast<bool>( m_world->CheckColliding( aItem ) );
#if 0
// something is wrong with the cache, need to investigate.
m_cache.Query( aItem->Shape(), m_world->GetMaxClearance(), v, false );
@ -408,6 +409,7 @@ bool PNS_OPTIMIZER::checkColliding( PNS_ITEM* aItem, bool aUpdateCache )
}
return false;
#endif
}

View File

@ -876,7 +876,8 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
const SELECTION& selection = selTool->GetSelection();
// pick up items under the cursor if needed
hoverSelection( selection );
if( !hoverSelection( selection ) )
return 0;
// we have a selection to work on now, so start the tool process