From 7d1204261764ec2bbc4ff964f08c9727a46efb7f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 15 Feb 2022 19:12:52 +1100 Subject: [PATCH] Revert "work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)"" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- lib/neatogen/matrix_ops.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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]); } } -- 2.40.0