diff options
author | Daniel Stone <daniel@fooishbar.org> | 2011-06-09 15:26:55 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-09-29 12:23:52 +1000 |
commit | 8a4a4e1b8a33899653d68a21bb7ff0557a576338 (patch) | |
tree | 8f502ea69d579b2ba8182618cc3e5b10e00c6b55 /dix | |
parent | e1df51421bc392d57f88c831fe0661871a8aa769 (diff) |
Input: Use trunc instead of lrintf in acceleration code
For compatibility with all the rest of the input code.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/ptrveloc.c | 9 |
1 files 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; } |