summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2019-02-10 17:29:22 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2019-02-11 10:58:04 +1000
commita4e5f74b589441077678d5d1546f7de0365a4627 (patch)
tree489ac4e13cfd657a40291659f9bdb079a4f3939f
parentf8d896ddca8f24fcbe115366db9ab3ce2badefd1 (diff)
Use fabs() instead of abs() on double values.
Silences clang warnings. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Walter Harms <wharms@bfs.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 1df1ca7..93ec74c 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2599,7 +2599,7 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw,
priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime * abs(para->scroll_dist_vert);
delay = MIN(delay, POLL_MS);
- if (abs(priv->scroll.coast_speed_y) < ddy) {
+ if (fabs(priv->scroll.coast_speed_y) < ddy) {
priv->scroll.coast_speed_y = 0;
priv->scroll.packets_this_scroll = 0;
}
@@ -2614,7 +2614,7 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw,
double ddx = para->coasting_friction * dtime;
priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime * abs(para->scroll_dist_horiz);
delay = MIN(delay, POLL_MS);
- if (abs(priv->scroll.coast_speed_x) < ddx) {
+ if (fabs(priv->scroll.coast_speed_x) < ddx) {
priv->scroll.coast_speed_x = 0;
priv->scroll.packets_this_scroll = 0;
}
@@ -2670,8 +2670,8 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
* really, this should be dependent on the touchpad size. Also,
* you'll need to find a touchpad that doesn't lie about it's
* size. Good luck. */
- if (abs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
- abs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
+ if (fabs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
+ fabs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
close_point |= (1 << j);
close_point |= (1 << i);
}