[cairo] looking for critic/advice

Peter Weilbacher mozilla at Weilbacher.org
Thu May 23 05:18:07 PDT 2013


On Wed, 22 May 2013, First Last wrote:

> For having this I'm using a structure defined in function.h, I'm a
> little suspicious about how I use this structure, I do some cast (
> (*_mc)) but I'm not sure that's well written

I think you need to read up C basics on pointers to structures and their
components. When you write |(* _mc).s| then that's not a cast but a
access to the component of the struct. But because that reads weird and
is used very often, C has the -> operator for this, so write |_mc->s|
instead. (You should usually also ensure that _mc is valid before
dereferencing it like this.)

But I guess all this is pretty off-topic for this list.
   Peter.


More information about the cairo mailing list