From: Matthew Fernandez Date: Sun, 2 May 2021 03:03:51 +0000 (-0700) Subject: remove use of double literals with ydelta in make_flat_labeled_edge X-Git-Tag: 2.47.2~7^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db09ae06fddad8f8153e64c5a1163180a2005707;p=graphviz remove use of double literals with ydelta in make_flat_labeled_edge 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. --- diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index bd449a9ba..eea0a5e90 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -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);