[PATCH] Don't cast double to int: use default conversions or explicitly round.
simon.thum at gmx.de
Thu Oct 29 06:39:04 PDT 2009
Jamey Sharp wrote:
As you seem to be the second in-server user of the lrint() gang, I'd
like to ask for any insights concerning this:
So far, I'm worried whether it isn't better to ditch the implicit
conversions as well (ie. dump floor&ceil, though that sounds ugly). But
that's just because I don't have any explanation why exactly the fix in
the bug did work.
> +++ b/hw/xfree86/parser/Flags.c
> @@ -434,7 +434,7 @@ xf86uLongToString(unsigned long i)
> char *s;
> int l;
> - l = (int)(ceil(log10((double)i) + 2.5));
> + l = ceil(log10((double)i) + 2.5);
doesn't lrint(...+3) match better with the rest?
More information about the xorg-devel