remove use of double literals with ydelta in make_flat_labeled_edge
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 2 May 2021 03:03:51 +0000 (20:03 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 May 2021 16:40:28 +0000 (09:40 -0700)
Commit ebe7517ae4eb86ee4bf34e1af31a174f1f0a4049 altered these lines to use
double literals instead of integer literals for `5` and `6`. It is not clear why
it did this as ydelta is an integer variable. The effect of that change was to
ask the compiler to perform the computation itself using doubles and then reduce
it to an integer result. This commit reverts that part of the diff to simply use
integer computation throughout. This change was motivated by the compiler
diagnosing this issue with -Wfloat-conversion.

lib/dotgen/dotsplines.c

index bd449a9ba6511b2406b5051111e9196ea3b1b483..eea0a5e902cf08f43f2f39bfb459d38fb37588fa 100644 (file)
@@ -1409,8 +1409,8 @@ make_flat_labeled_edge(graph_t* g, spline_info_t* sp, path* P, edge_t* e, int et
        lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2;
        ydelta = ND_coord(ln).y - GD_rank(g)[ND_rank(tn)].ht1 -
                ND_coord(tn).y + GD_rank(g)[ND_rank(tn)].ht2;
-       ydelta /= 6.;
-       lb.LL.y = lb.UR.y - MAX(5.,ydelta); 
+       ydelta /= 6;
+       lb.LL.y = lb.UR.y - MAX(5,ydelta);
 
        boxn = 0;
        makeFlatEnd (g, sp, P, tn, e, &tend, TRUE);