From c25354f13a345a374585688d7ca7a7791fea1d9e Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 23 Mar 2010 09:56:21 +0100 Subject: Third time around (and use the next branch for collaboration) There is (obviously, from the recent commit flaws) a need to keep a volatile branch for collaboration, to allow for digested commits in master. The next branch will rebase occasionally, so one cannot rely on commit ids from that branch. This patch corrects the commit mistake for the third time, to never change that line again. Signed-off-by: Henrik Rydberg --- src/state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state.c b/src/state.c index b9b7bbc..72bb759 100644 --- a/src/state.c +++ b/src/state.c @@ -37,7 +37,7 @@ static int fincmp(const void *a, const void *b) return ((struct FingerState *)a)->id - ((struct FingerState *)b)->id; } -inline int abs15(int x) +static inline int clamp15(int x) { return x < -XMAX ? -XMAX : x > XMAX ? XMAX : x; } @@ -45,8 +45,8 @@ inline int abs15(int x) /* abslute scale is assumed to fit in 15 bits */ inline int dist2(const struct FingerData *a, const struct FingerData *b) { - int dx = abs15(a->position_x - b->position_x); - int dy = abs15(a->position_y - b->position_y); + int dx = clamp15(a->position_x - b->position_x); + int dy = clamp15(a->position_y - b->position_y); return dx * dx + dy * dy; } -- cgit v1.2.3