From: Matthew Fernandez Date: Sun, 2 May 2021 03:17:30 +0000 (-0700) Subject: use hypotf to squash a -Wfloat-conversion warning X-Git-Tag: 2.47.2~7^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a9a78cf2f07c85a4b132294d24851bb1972d780;p=graphviz use hypotf to squash a -Wfloat-conversion warning For the same reason as the previous commit, this fixes an intermingling of doubles and floats, and also abbreviates code. --- diff --git a/lib/neatogen/sgd.c b/lib/neatogen/sgd.c index f66003942..6dcf63367 100644 --- a/lib/neatogen/sgd.c +++ b/lib/neatogen/sgd.c @@ -226,7 +226,7 @@ void sgd(graph_t *G, /* input graph */ float dx = pos[2*terms[ij].i] - pos[2*terms[ij].j]; float dy = pos[2*terms[ij].i+1] - pos[2*terms[ij].j+1]; - float mag = sqrt(dx*dx + dy*dy); + float mag = hypotf(dx, dy); float r = (mu * (mag-terms[ij].d)) / (2*mag); float r_x = r * dx;