[Spice-devel] [PATCH 07/11] make red_pipe_item_unref more typesafe

Christophe Fergeau cfergeau at redhat.com
Mon May 23 10:23:02 UTC 2016


On Mon, May 23, 2016 at 05:35:29AM -0400, Frediano Ziglio wrote:
> > 
> > On Fri, May 20, 2016 at 03:35:50PM -0500, Jonathon Jongsma wrote:
> > > ok, I'll take some added typesafety over a having to pass the ->parent
> > > occasionally
> > 
> > Explicitly passing ->parent does not scale well though if you start
> > adding intermediate classes in the inheritance tree.
> > 
> > Christophe
> > 
> 
> It all started when I wanted to remove/move some fields from a
> structure and finding that code continued to compile but just
> crashed... sometimes!
> Usually plain C you are expecting a compilation failure when
> fields/function disappears from source. This is IMHO a good
> thing of static languages, lot of stuff are done by the
> compiler.
> 
> When we talked about moving to C++ to solve these issues you
> said that having more code was not an issue and "just a
> problem of copy & paste"... did you change your mind?

Well, this reference is more about the boilerplate to declare a class in
gobject VS C++, which indeed is mostly a matter of c&p. I don't think I
ever said that you'd get as much support for the compiler with gobject
than with C++, which is the issue you are having here and with your
"unsafe cast" worries.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160523/5ef9326c/attachment-0001.sig>


More information about the Spice-devel mailing list