[cairo] Another 1.6 item

Behdad Esfahbod behdad at behdad.org
Sat Jan 26 10:56:17 PST 2008

On Fri, 2008-01-25 at 22:06 -0800, Carl Worth wrote:
> On Fri, 25 Jan 2008 18:34:48 -0500, Behdad Esfahbod wrote:
> > So we've talked about it numerous times before.  I want to make it
> > happen now.  I'm going to change cairo_get_current_point() to return
> > cairo_status_t instead of void.  The interesting part (other than the
> > case that if cr is already in error) is returning
> > CAIRO_STATUS_NO_CURRENT_POINT, which is sourly missing from the API.
> Excellent!

Pushed now.  There were three places in cairo itself calling that
function, in toy text API.  I didn't make it propagate the error because
people have been relying on the 0,0 default current position, even if
it's not consistent (it's 0,0 in user-space, not device space, so
translate without current point behaves different from translate when
having 0,0 current point).

> And if we're turning void into cairo_status_t how about going through
> all the _destroy functions and emitting the final status value from
> them as well?

Makes sense.  Chris, do you want to do this one?

> -Carl
> PS. The destroy function's return value would then be great candidates
> for a return-value-must-not-be-ignored warning from the
> compiler. Meanwhile, requiring the status from cairo_get_current_point
> to not be ignored would be slightly obnoxious in some cases. Maybe we
> just have to live with that?

That would generate quite a few warnings internally at least.  We'll get
it out in next 1.5.x and see.


"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list