Hi Peter,
in light of [0], I propose the attached patch. I don't have the time to
fully investigate this (I still don't have a clue why exactly gcc warns
not this but the case in the bug), but to me it seems better to use the
l*() variants anyway.
[0] http://bugs.freedesktop.org/show_bug.cgi?id=21456
>From 4572fc899ef338ff285421503475cf5393a5deed Mon Sep 17 00:00:00 2001
From: Simon Thum <[email protected]>
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.
---
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
_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel