[cairo] Re: Some other bits...

Carl Worth cworth at cworth.org
Thu Aug 18 09:30:14 PDT 2005


On Wed, 17 Aug 2005 12:16:26 -0700, Bill Spitzak wrote:
> But then _integer_part would not work for negative numbers either,
> would have to be implemented like _integer_floor above.

As mentioned earlier, we don't want separate _integer_part and
 _integer_floor functions anyway.

> And all the 
> other code that uses >> would fail on negative numbers and have to be 
> rewritten as well.
> 
> In fact I'm fairly certain that this assumption happens tens of 
> thousands of times in Cairo and X and every program that will use Cairo, 
> thus trying to fix it is futile and serves only to slow programs down 
> and make the code hard to read.

I'm not sure what you're arguing here.

Are you saying that this bug is so common that we can assume that
platforms that don't give the desired behavior for >> with negative
numbers must not exist?

Or are you saying that the bug is so common that we should just give
up on supporting such platforms?

As for incorrect assumptions in cairo-using applications, obviously
there's nothing we can do about that. But bugs in cairo are definitely
something I want to fix. And we do also put quite a bit of effort into
working around bugs in things like X that cairo depends on.

-Carl

PS. As for how often this bug occurs in cairo, it appears from a very
quick glance that most occurrences of ">>" in the code are with
unsigned data such as color channels. I don't think it would be
infeasible to audit cairo itself for this bug.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050818/2713367c/attachment-0001.pgp


More information about the cairo mailing list