From 8a4a4e1b8a33899653d68a21bb7ff0557a576338 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 9 Jun 2011 15:26:55 +0100 Subject: [PATCH] Input: Use trunc instead of lrintf in acceleration code For compatibility with all the rest of the input code. Signed-off-by: Daniel Stone Reviewed-by: Simon Thum --- dix/ptrveloc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index dfccf1581..c50679134 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -1167,19 +1167,14 @@ acceleratePointerPredictable( if (dx) { float tmp; tmp = mult * fdx + dev->last.remainder[0]; - /* Since it may not be apparent: lrintf() does not offer - * strong statements about rounding; however because we - * process each axis conditionally, there's no danger - * of a toggling remainder. Its lack of guarantees likely - * makes it faster on the average target. */ - tmpi = lrintf(tmp); + tmpi = trunc(tmp); valuator_mask_set(val, 0, tmpi); dev->last.remainder[0] = tmp - (float)tmpi; } if (dy) { float tmp; tmp = mult * fdy + dev->last.remainder[1]; - tmpi = lrintf(tmp); + tmpi = trunc(tmp); valuator_mask_set(val, 1, tmpi); dev->last.remainder[1] = tmp - (float)tmpi; }