[cairo] Re: cairo_get_current_point bug ?

Carl Worth cworth at cworth.org
Thu Sep 28 11:56:52 PDT 2006


On Fri, 22 Sep 2006 16:43:37 -0400, Behdad Esfahbod wrote:
> On Fri, 2006-09-22 at 15:49 -0400, Carl Worth wrote:
> > On Thu, 14 Sep 2006 16:59:11 -0700, "Mike Emmel" wrote:
> > > -void
> > > +cairo_status_t
> > >  cairo_get_current_point (cairo_t *cr, double *x_ret, double *y_ret)
> >
> > Behdad just mentioned that it's too late to do this. From an API
> > point-of-view, there would obviously be no problem, but presumably
> > changing the stack like that would not allow us to provide the ABI
> > compatibility we've promised.
>
> Like Jamey pointed already, it most probably is not an ABI problem on
> any platform that cairo has been compiled on so far.

Ah, that's encouraging. So I just went ahead and proposed a patch that
does this.

>                                                      However, it
> definitely is an API change.  One that may not break any code though.
> It will cause warnings for example if someone is using the function in
> question as an rvalue without casting.  Or if for any reason they are
> prototyping it again (will error).  Both are rare situations.

I *think* I'm comfortable with either of these. I do want to be
careful here---the simple addition of "const" in freetype's API, (to
the parameter of a callback), was something I found really annoying.

But we're not changing the signature of a callback function here, so I
do expect any API problems here to be much less likely than that
freetype case.

> take advantage of it.  Changing API in this way allows making
> cairo_device_to_user* return an error too.

There are probably a bunch of these. The patch I did for
cairo_get_current_point doesn't chase them down, but it would be
useful for someone to do an API audit looking for "missing" return
values.

> > Do we want:
> >
> > 	cairo_bool_t
> > 	cairo_has_current_point (cairo_t *cr);

We don't need this with the Boolean return from
cairo_get_current_point.

> > 	cairo_bool_t
> > 	cairo_has_path (cairo_t *cr);

This one might still be independently useful.

-Carl
-------------- 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/20060928/dec99f37/attachment.pgp


More information about the cairo mailing list