From: Matthew Fernandez Date: Tue, 15 Feb 2022 08:12:52 +0000 (+1100) Subject: Revert "work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt... X-Git-Tag: 3.0.0~26^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d1204261764ec2bbc4ff964f08c9727a46efb7f;p=graphviz Revert "work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)"" This reverts commit 0dfd6ab3449455907a5a684fb54cb8b54c5befd5. As of fe3f9411d2c59b463ab1b64eecfd19f2db55d2fc, Graphviz requires a C99 compiler. C99 guarantees `sqrtf` so even if the “bug” discussed in the original commit still exists, generating a `sqrtf` call is fine on a C99 toolchain. --- diff --git a/lib/neatogen/matrix_ops.c b/lib/neatogen/matrix_ops.c index 0ad5357b2..85d8ab370 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -611,11 +611,8 @@ void invert_vec(int n, float *vec) void sqrt_vec(int n, float *vec) { int i; - double d; for (i = 0; i < n; i++) { - /* do this in two steps to avoid a bug in gcc-4.00 on AIX */ - d = sqrt(vec[i]); - vec[i] = (float) d; + vec[i] = (float) sqrt(vec[i]); } }