absract_surface -> cairo_surface_t* vs void*
"Enrico Weigelt, metux IT consult" <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Hi folks, I've seen many places where an (abstract) surface structure is passed as void* pointer, which is then directly typecaste'd to the actual structure. Should we change it to use cairo_surface_t* intead and then use container_of() for the typecast instead ? By the way: I'd also propose an additional sanity check: * put in an magic value (more precisely: an array of magics - for deeper inheritance) into cairo_surface_t, so we can check individual instances for correct class * add some macros for the typecasting and type check * make the whole thing (compile-time) optional --mtx mit freundlichen Grüßen -- Enrico Weigelt, metux IT consulting +49-151-27565287 -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo