[Spice-devel] [spice-server 2/8] Move RedChannel::data to ClientCbs::cbs_data

Christophe Fergeau cfergeau at redhat.com
Wed Mar 16 09:41:45 UTC 2016


On Tue, Mar 15, 2016 at 05:11:36PM -0400, Frediano Ziglio wrote:
> > -static void red_channel_client_default_disconnect(RedChannelClient *base)
> > +static void red_channel_client_default_disconnect(RedChannelClient *base,
> > gpointer cbs_data)
> >  {
> >      red_channel_client_disconnect(base);
> >  }
> > @@ -1062,7 +1062,7 @@ RedChannel *red_channel_create(int size,
> >  
> >      client_cbs.connect = red_channel_client_default_connect;
> >      client_cbs.disconnect = red_channel_client_default_disconnect;
> > -    client_cbs.migrate = red_channel_client_default_migrate;
> > +    client_cbs.migrate =
> > (channel_client_migrate_proc)red_channel_client_default_migrate;
> > 
> 
> I don't like these kind of cast. Why don't you add a parameter (unused)
> to these functions?

red_channel_client_default_migrate() is not used only as a
ClientCbs::migrate vfunc, it's also called a few times in other code
(red_migrate_display() for example).
red_channel_client_default_migrate(rcc, NULL) did not look so great
there, and I prefer to have a cast rather than an intermediate function
with the right number of args calling directly the real function with
one arg less.

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/20160316/eee0e16f/attachment.sig>


More information about the Spice-devel mailing list