diff --git a/common/geometry/shape_line_chain.cpp b/common/geometry/shape_line_chain.cpp index 44c7bad7f4..6edc0d2b14 100644 --- a/common/geometry/shape_line_chain.cpp +++ b/common/geometry/shape_line_chain.cpp @@ -439,7 +439,7 @@ SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() const VECTOR2I SHAPE_LINE_CHAIN::NearestPoint(const VECTOR2I& aP) const { int min_d = INT_MAX; - int nearest; + int nearest = 0; for ( int i = 0; i < SegmentCount() ; i++ ) { int d = CSegment(i).Distance(aP); diff --git a/include/geometry/seg.h b/include/geometry/seg.h index bb215aa05f..7b5f64ac2f 100644 --- a/include/geometry/seg.h +++ b/include/geometry/seg.h @@ -307,18 +307,7 @@ inline VECTOR2I SEG::LineProject( const VECTOR2I& aP ) const { // fixme: numerical errors for large integers assert(false); - /*const VECTOR2I d = aB - aA; - ecoord det = d.Dot(d); - ecoord dxdy = (ecoord) d.x * d.y; - - ecoord qx = - ( (extended_type) aA.x * d.y * d.y + (extended_type) d.x * d.x * x - dxdy * - (aA.y - y) ) / det; - extended_type qy = - ( (extended_type) aA.y * d.x * d.x + (extended_type) d.y * d.y * y - dxdy * - (aA.x - x) ) / det; - - return VECTOR2 ( (T) qx, (T) qy );*/ + return VECTOR2I(0, 0); } diff --git a/include/geometry/shape.h b/include/geometry/shape.h index 6d56fef79a..c759b0bbd6 100644 --- a/include/geometry/shape.h +++ b/include/geometry/shape.h @@ -77,7 +77,10 @@ class SHAPE { * Returns a dynamically allocated copy of the shape * @retval copy of the shape */ - virtual SHAPE* Clone() const { assert(false); }; + virtual SHAPE* Clone() const { + assert(false); + return NULL; + }; /** * Function Collide()