From: Hans de Goede Date: Fri, 18 Jul 2014 09:06:39 +0000 (+0200) Subject: touchpad: make tp_estimate_delta return fractions X-Git-Tag: 0.5.0~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aab902cc396f6f6e43cc2a90409992017e974c44;p=platform%2Fupstream%2Flibinput.git touchpad: make tp_estimate_delta return fractions Force a cast of the input arguments to a double before the divide, rather than after the divide. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 4d4856f..b0520c7 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -163,7 +163,7 @@ tp_end_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) static double tp_estimate_delta(int x0, int x1, int x2, int x3) { - return (x0 + x1 - x2 - x3) / 4; + return (x0 + x1 - x2 - x3) / 4.0; } void