← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Clarify fabs() overload

 

Patch committed in product branch r6024.  Thanks.

On 7/27/2015 6:49 PM, Simon Richter wrote:
> fabs(int) is not defined in the standard, so this is ambiguous. Moving the
> cast inside the argument clarifies which overload we want, and gives the
> correct return type.
> ---
>  common/geometry/shape_poly_set.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp
> index b70f84e..ec4e67e 100644
> --- a/common/geometry/shape_poly_set.cpp
> +++ b/common/geometry/shape_poly_set.cpp
> @@ -257,7 +257,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
>  
>      PolyTree solution;
>  
> -    c.ArcTolerance = (double)fabs( aFactor ) / M_PI / aCircleSegmentsCount;
> +    c.ArcTolerance = fabs( (double) aFactor ) / M_PI / aCircleSegmentsCount;
>  
>      c.Execute( solution, aFactor );
>  
> 



References