]> granicus.if.org Git - graphviz/commitdiff
using floats consistently in vscale
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 17 May 2021 02:31:21 +0000 (19:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 29 May 2021 00:57:39 +0000 (17:57 -0700)
By avoiding mixing doubles and floats, we avoid ever down-converting from a
float to a double and losing precision. Squashes a -Wfloat-conversion warning.

cmd/smyrna/trackball.c

index 21d196d84928a49b5f4562778925f76780bd3c8f..c160023c8e9f8d55dde9a60e845c4dfb2c3e415f 100644 (file)
@@ -119,7 +119,7 @@ static void vscale(float *v, float div)
 
 static void vnormal(float *v)
 {
-    vscale(v, 1.0 / vlength(v));
+    vscale(v, 1.0f / vlength(v));
 }
 
 static float vdot(const float *v1, const float *v2)