[cairo] Tiny bug in fixed_integer_ceil

Behdad Esfahbod behdad at cs.toronto.edu
Tue Aug 16 18:58:22 PDT 2005


The current code would return 1 for 0, which is wrong.

int
_cairo_fixed_integer_ceil (cairo_fixed_t f)
{
-   if (f >= 0)
+   if (f > 0)
        return ((f - 1)>>16) + 1;
    else
        return - (-f >> 16);
}


--behdad
http://behdad.org/


More information about the cairo mailing list