[cairo] Re: Some other bits...

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Thu Aug 18 08:33:45 PDT 2005

On 8/17/05, Bill Spitzak <spitzak at d2.com> wrote:
> Bertram Felgenhauer wrote:
> > A problem here is that the C standard does not define the
> > result of >> when applied to negative numbers, making this
> > optimization unportable. It's certainly a good optimization
> > when it works though.
> But then _integer_part would not work for negative numbers either, it
> would have to be implemented like _integer_floor above. And all the
> other code that uses >> would fail on negative numbers and have to be
> rewritten as well.

That's true. I expect this works on all architectures that provide a signed
shift right operation - compiler writers would be stupid not to use it -
and I'm not aware of any architecture that doesn't.
I think this explains why _integer_floor was written the way it was though.


More information about the cairo mailing list