[PATCH] dix: prefer lroundf() over roundf() in axis scaling
Simon Thum
simon.thum at gmx.de
Sat Mar 21 10:19:19 PDT 2009
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.
---
dix/getevents.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dix/getevents.c b/dix/getevents.c
index a3e11f7..da24530 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -206,7 +206,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;
}
--
1.6.0.6
--------------070304010906090802080506--
More information about the xorg-devel
mailing list