summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-10-24 11:04:18 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-10-25 10:00:58 +1000
commit1843c4aeae3e83ef34c92cfe9bea5c1c5c4f91d2 (patch)
tree4bc786f170b0e5d05a21a9cad9fa7fcf1eec5d48 /src
parentef2f95dfeec663caeb999eb10e1213bc9c518951 (diff)
touchpad: switch from fabs() to abs()
silence clang warning: evdev-mt-touchpad.c:1017:7: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 38b638b5..7867122b 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1013,8 +1013,8 @@ tp_detect_jumps(const struct tp_dispatch *tp, struct tp_touch *t)
/* called before tp_motion_history_push, so offset 0 is the most
* recent coordinate */
last = tp_motion_history_offset(t, 0);
- dx = fabs(t->point.x - last->x) / tp->device->abs.absinfo_x->resolution;
- dy = fabs(t->point.y - last->y) / tp->device->abs.absinfo_y->resolution;
+ dx = 1.0 * abs(t->point.x - last->x) / tp->device->abs.absinfo_x->resolution;
+ dy = 1.0 * abs(t->point.y - last->y) / tp->device->abs.absinfo_y->resolution;
return hypot(dx, dy) > JUMP_THRESHOLD_MM;
}