[cairo] const-ness fixes for transform_distance and transform_point

Keith Packard keithp at keithp.com
Mon May 9 10:07:45 PDT 2005


On Mon, 2005-05-09 at 13:06 -0400, Owen Taylor wrote:

> This does muddle the "plain structure returns are out-parameters"
> rule that I documented in the language binding appendix.

And what about the re-entrancy issues of returning a pointer to static
data?  The C library suffers greatly from this in a number of APIs.
Passing in a pointer to thread-specific data makes this all much
clearer.

> void
> cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix);

I have a strange though here -- we could mark the cairo calls which do
not change the state of the library by annotating the cairo_t* with
'const'.  Would this be a good idea?  Or would it only clutter the
headers?  I'm not certain myself, but wanted to increase list traffic
with side discussions.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050509/e71e6091/attachment.pgp


More information about the cairo mailing list