From: Matthew Fernandez Date: Sun, 2 May 2021 02:52:43 +0000 (-0700) Subject: squash a -Wfloat-conversion due to sqrt in distBetweenPts X-Git-Tag: 2.47.2~7^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f80faf81ed44d51fe2232588eda3f44d74c7e750;p=graphviz squash a -Wfloat-conversion due to sqrt in distBetweenPts There is a dedicated libc function for doing square root of floats, but this code was incorrectly calling the version for doubles instead. This updated code is more appropriate and could even be more efficient. --- diff --git a/lib/glcomp/glutils.c b/lib/glcomp/glutils.c index 80fbff91c..4d548c001 100644 --- a/lib/glcomp/glutils.c +++ b/lib/glcomp/glutils.c @@ -721,7 +721,7 @@ GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R) { GLfloat rv=0; rv=(A.x-B.x)*(A.x-B.x) + (A.y-B.y)*(A.y-B.y) +(A.z-B.z)*(A.z-B.z); - rv=sqrt(rv); + rv=sqrtf(rv); if (rv <=R) return 0; return rv;