From c7ed4cec501f10479a98e380d760670312101136 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sun, 21 Mar 2010 14:18:56 +0100 Subject: Comply with MT syncronization protocol The latest semantic clarifications in the kernel MT protocol allow SYN_MT_REPORT to be sent without actually sending any finger data. Add a mask to the hardware data so that the data actually read can be tracked. Signed-off-by: Henrik Rydberg --- src/state.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 774828a..31eca70 100644 --- a/src/state.c +++ b/src/state.c @@ -36,16 +36,9 @@ static int fincmp(const void *a, const void *b) return ((struct FingerState *)a)->id - ((struct FingerState *)b)->id; } -/* seander@cs.stanford.edu */ -inline unsigned abs32(int x) -{ - int const m = x >> 31; - return (x + m) ^ m; -} - inline int abs15(int x) { - return 32767 & abs32(x); + return 32767 & (x < 0 ? -x : x); } /* abslute scale is assumed to fit in 15 bits */ -- cgit v1.2.3