[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix compiler warning about `abs'
From: |
Zach Davis |
Subject: |
[PATCH] Fix compiler warning about `abs' |
Date: |
Thu, 4 Sep 2014 13:15:22 -0500 |
Hello all-
I recently compiled master with clang, and it pointed out a warning
about abs/labs.
I wasn't able to force a bug from the warning, but it was an easy enough fix.
Zach
>From d723f275ffe67d75e2d015d0b0c629c921579200 Mon Sep 17 00:00:00 2001
From: Zach Davis <address@hidden>
Date: Thu, 4 Sep 2014 12:57:17 -0500
Subject: [PATCH] Fix compiler warning about `abs'
Clang noted that `labs' should be used instead of `abs' for longs.
* libguile/numbers.c (log_of_fraction): Use labs instead of abs.
---
libguile/numbers.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 14d98ff..14b11c8 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -9982,7 +9982,7 @@ log_of_fraction (SCM n, SCM d)
long n_size = scm_to_long (scm_integer_length (n));
long d_size = scm_to_long (scm_integer_length (d));
- if (abs (n_size - d_size) > 1)
+ if (labs (n_size - d_size) > 1)
return (scm_difference (log_of_exact_integer (n),
log_of_exact_integer (d)));
else if (scm_is_false (scm_negative_p (n)))
--
1.7.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Fix compiler warning about `abs',
Zach Davis <=