diff --git a/common/geometry/shape_collisions.cpp b/common/geometry/shape_collisions.cpp index 1cf0f2f7c0..3e8e51cdc7 100644 --- a/common/geometry/shape_collisions.cpp +++ b/common/geometry/shape_collisions.cpp @@ -331,6 +331,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed default: break; } + break; case SH_CIRCLE: switch( aB->Type() ) @@ -353,6 +354,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed default: break; } + break; case SH_LINE_CHAIN: switch( aB->Type() ) @@ -375,6 +377,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed default: break; } + break; case SH_SEGMENT: switch( aB->Type() ) @@ -397,6 +400,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed default: break; } + break; case SH_CONVEX: switch( aB->Type() ) @@ -419,6 +423,7 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, bool aNeed default: break; } + break; default: break; diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index 9473834745..6c223d7fb3 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -420,12 +420,13 @@ void SHAPE_POLY_SET::fractureSingle( ClipperLib::Paths& paths ) while( num_unconnected > 0 ) { int64_t x_min = std::numeric_limits::max(); - FractureEdge* smallestX; + FractureEdge* smallestX = NULL; // find the left-most hole edge and merge with the outline for( FractureEdgeSet::iterator i = border_edges.begin(); i != border_edges.end(); ++i ) { int64_t xt = (*i)->m_p1.X; + if( ( xt < x_min ) && ! (*i)->m_connected ) { x_min = xt; diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 1e3e22a108..c5833f0eb4 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -992,6 +992,10 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead ) return SH_INCOMPLETE; PNS_LINE* head = clone( &aCurrentHead ); + + if( !head ) + return SH_INCOMPLETE; + head->ClearSegmentLinks(); m_lineStack.clear(); @@ -1026,13 +1030,13 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead ) m_logger.Log( headVia, 0, "head-via" ); } - if ( !pushLine( head ) ) + if( !pushLine( head ) ) return SH_INCOMPLETE; st = shoveMainLoop(); - if( ( st == SH_OK || st == SH_HEAD_MODIFIED ) && head) + if( ( st == SH_OK || st == SH_HEAD_MODIFIED ) ) runOptimizer( m_currentNode, head ); if( m_newHead && st == SH_OK ) diff --git a/pcbnew/router/pns_shove.h b/pcbnew/router/pns_shove.h index b228806365..37cb04d273 100644 --- a/pcbnew/router/pns_shove.h +++ b/pcbnew/router/pns_shove.h @@ -129,7 +129,7 @@ private: void replaceItems( PNS_ITEM* aOld, PNS_ITEM* aNew ); - template T* clone ( const T* aItem ) + template T* clone( const T* aItem ) { T *cloned = aItem->Clone();