Re: Call for testers: Const status accessors

M Joonas Pihlaja <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Fri, 5 Aug 2011, Andrea Canciani wrote:

> The attached patch modifies cairo status accessors to accept a const
> argument. This should be ok with C, but other languages might have
> different issues.

Cairo shouldn't be exporting const opaque pointer types since it's
none of the callers business what happens inside an opaque object.
Const correctness in APIs isn't relevant in C unless the caller has
full visibility into the structure and layout of an object.  IMHO
using constness of an opaque pointer to reflect an operation's
mutation-freeness of the underlying object, as seems to be the case in
this patch, is an abuse of a perfectly fine qualifier, especially in
C.  C++ in particular is a different case all together as it has much
more support for this kind of semantic tagging using the const
qualifier.

Joonas
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.