[PATCH xf86-input-joystick] Silence clang warnings on floating point abs() / pow() calls.

Matthieu Herrb matthieu at herrb.eu
Sun Feb 10 16:15:00 UTC 2019


Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
---
 src/jstk_axis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index cb4a004..37bb66b 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -136,11 +136,11 @@ jstkAxisTimer(OsTimerPtr        timer,
 	     */
 
             /* How many pixels should this axis move the cursor */
-            p1 = (pow((abs((float)axis->value) - (float)axis->deadzone) *
+            p1 = (powf((fabsf((float)axis->value) - (float)axis->deadzone) *
                   scale / 23, 1.4f) + 100.0f) *
                  ((float)NEXTTIMER / 40000.0f);
             /* How many "pixels" should this axis scroll */
-            p2 = ((pow((abs((float)axis->value) - (float)axis->deadzone) *
+            p2 = ((powf((fabsf((float)axis->value) - (float)axis->deadzone) *
                   scale / 1000.0f, 2.5f)) + 200.0f) *
                  ((float)NEXTTIMER / 200000.0f);
         } else if (axis->type == JSTK_TYPE_ACCELERATED) {
-- 
2.20.1



More information about the xorg-devel mailing list