diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index e3015099ed..44b5176641 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -705,7 +705,9 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const case SHAPE_T::CIRCLE: { int radius = GetRadius(); - long dist = KiROUND( EuclideanNorm( aPosition - getCenter() ) ); + + VECTOR2I::extended_type dist = KiROUND( + EuclideanNorm( aPosition - getCenter() ) ); if( IsFilled() ) return dist <= radius + maxdist; // Filled circle hit-test @@ -723,7 +725,9 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const VECTOR2I relPos = aPosition - getCenter(); int radius = GetRadius(); - long dist = KiROUND( EuclideanNorm( relPos ) ); + + VECTOR2I::extended_type dist = + KiROUND( EuclideanNorm( relPos ) ); if( IsFilled() ) { diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index 5594630b44..87a7e96e1e 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -284,10 +284,10 @@ private: typedef std::numeric_limits coord_limits; const int guardValue = 1; - long maxDiff = coord_limits::max() - guardValue; + VECTOR2I::extended_type maxDiff = coord_limits::max() - guardValue; - long xDiff = long( aEnd.x ) - aOrigin.x; - long yDiff = long( aEnd.y ) - aOrigin.y; + VECTOR2I::extended_type xDiff = VECTOR2I::extended_type( aEnd.x ) - aOrigin.x; + VECTOR2I::extended_type yDiff = VECTOR2I::extended_type( aEnd.y ) - aOrigin.y; if( xDiff > maxDiff ) xDiff = maxDiff; @@ -314,8 +314,8 @@ private: typedef std::numeric_limits coord_limits; const int guardValue = 10; - long xDiff = long( aEnd.x ) - aOrigin.x; - long yDiff = long( aEnd.y ) - aOrigin.y; + VECTOR2I::extended_type xDiff = VECTOR2I::extended_type( aEnd.x ) - aOrigin.x; + VECTOR2I::extended_type yDiff = VECTOR2I::extended_type( aEnd.y ) - aOrigin.y; double maxRadius = coord_limits::max() / 2 - guardValue; double radius = std::hypot( xDiff, yDiff ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index a78478d97e..8eb8c0c213 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1078,8 +1078,8 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) typedef std::numeric_limits coord_limits; - long max = coord_limits::max() - COORDS_PADDING; - long min = -max; + int max = coord_limits::max() - COORDS_PADDING; + int min = -max; bool outOfBounds = rotPos.x < min || rotPos.x > max || rotPos.y < min || rotPos.y > max || rotEnd.x < min || rotEnd.x > max || rotEnd.y < min || rotEnd.y > max; diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index ccb1d8935c..3e4f9968be 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -299,8 +299,8 @@ VECTOR2I EDIT_TOOL::getSafeMovement( const VECTOR2I& aMovement, const BOX2I& aSo { typedef std::numeric_limits coord_limits; - long max = coord_limits::max(); - long min = -max; + int max = coord_limits::max(); + int min = -max; double left = aBBoxOffset.x + aSourceBBox.GetPosition().x; double top = aBBoxOffset.y + aSourceBBox.GetPosition().y;