From f80faf81ed44d51fe2232588eda3f44d74c7e750 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 1 May 2021 19:52:43 -0700 Subject: [PATCH] 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. --- lib/glcomp/glutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.40.0