[cairo] Missing const in cairo API ?

Damien Carbonne aetdcarbonne at free.fr
Mon Oct 2 15:10:46 PDT 2006


Carl Worth a écrit :
> 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
>   
As I explained in a previous answer, I would not declare a "const 
cairo_t *" variable.
I would like to declare such a function argument.

Damien


More information about the cairo mailing list