]> granicus.if.org Git - graphviz/commitdiff
avoid using double literals with a float variable
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 2 May 2021 03:13:10 +0000 (20:13 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 May 2021 16:40:28 +0000 (09:40 -0700)
With -Wfloat-conversion, the compiler warns that going via double literals like
this resulted in an imprecise float. To squash this warning and be more precise,
we can use float literals instead.

lib/neatogen/constrained_majorization_ipsep.c

index 8ff639640ea4774679cae1995d4a9e32fc1ffb30..e4c9f5288533d3d9c63036b76495b34153cd8f29 100644 (file)
@@ -214,8 +214,8 @@ int stress_majorization_cola(vtx_data * graph,      /* Input graph in sparse represen
                    if (j == 1 && i % 2 == 1) {
                        v = maxEdgeLen;
                        v *= v;
-                       if (v > 0.01) {
-                           v = 1.0 / v;
+                       if (v > 0.01f) {
+                           v = 1.0f / v;
                        }
                    } else
                        v = 0;