[cairo] Missing const in cairo API ?

Carl Worth cworth at cworth.org
Mon Oct 2 11:43:57 PDT 2006


On Sun, 01 Oct 2006 23:43:44 +0200, Damien Carbonne wrote:
> Why aren't they defined as :
>    cairo_public void
>    cairo_scaled_font_get_extents (const cairo_scaled_font_t  *scaled_font,
>
> cairo_font_extents_t *extents);
>
>    cairo_public cairo_status_t
>    cairo_font_face_get_status (const cairo_font_face_t *font_face);

Both cairo_scaled_font_t and cairo_font_face_t are opaque objects from
point of view of the public interface. In general we have only used
the const attribute for non-opaque objects. (For example, we never
have "const cairo_t *".)

What would be the motivation for the change? Is there actually any
practical benefit for the user to declare "const cairo_scaled_font_t *"
as opposed to "cairo_scaled_font_t *" ?

-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/20061002/4345f59a/attachment-0001.pgp


More information about the cairo mailing list