From 707b1241681c33401d5e0eb6edeace33f5970928 Mon Sep 17 00:00:00 2001 From: Simon Thum Date: Sat, 21 Mar 2009 18:19:19 +0100 Subject: [PATCH] dix: prefer lroundf() over roundf() in axis scaling it's unclear whether there actually is a problem, but in a very similar case there is (bug#21456). Also, integer addition is generally faster. Signed-off-by: Peter Hutterer --- dix/getevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/getevents.c b/dix/getevents.c index 83aedbe35..9b1908cbb 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -260,7 +260,7 @@ rescaleValuatorAxis(int coord, AxisInfoPtr from, AxisInfoPtr to, if(fmax == fmin) /* avoid division by 0 */ return 0; - return roundf(((float)(coord - fmin)) * (tmax - tmin) / + return lroundf(((float)(coord - fmin)) * (tmax - tmin) / (fmax - fmin)) + tmin; }