[Spice-devel] [spice-server v3 10/10] sound: Convert SndChannelClient to RedChannelClient

Christophe Fergeau cfergeau at redhat.com
Thu Feb 2 15:36:20 UTC 2017


I've pushed the whole series now.

Christophe

On Mon, Jan 30, 2017 at 01:37:00PM +0100, Christophe Fergeau wrote:
> On Mon, Jan 30, 2017 at 07:02:04AM -0500, Frediano Ziglio wrote:
> > 
> > > 
> > > Fwiw, see the merged patch attached to this mail. Frediano feels
> > > strongly that these should be merged, so I'll most likely go with this
> > > version.
> > > 
> > > Christophe
> > > 
> > 
> > I noted this weird hunk (that don't apply on top of previous series
> > without last 2 patches):
> > 
> > @@ -645,9 +575,9 @@ static void snd_send(SndChannelClient * client)
> >  {
> >      RedChannelClient *rcc;
> > 
> > -    g_return_if_fail(client != NULL);
> > +    g_return_if_fail(RED_IS_CHANNEL_CLIENT(client));
> > 
> > -    rcc = client->channel_client;
> > +    rcc = RED_CHANNEL_CLIENT(client);
> >      if (!red_channel_client_pipe_is_empty(rcc) || !client->command) {
> >          return;
> >      }
> > 
> > 
> > I think would be better:
> > 
> >      RedChannelClient *rcc;
> > 
> >      rcc = RED_CHANNEL_CLIENT(client);
> >      if (!rcc || !red_channel_client_pipe_is_empty(rcc) || !client->command) {
> >          return;
> >      }
> > 
> > no reason to check for type twice, RED_CHANNEL_CLIENT handle NULL cases with
> > warning if needed.
> > 
> > Or just remove the check at all...
> 
> I *think* this can never be called with a NULL pointer, but I'm not 100%
> sure, so I prefer to have a loud warning and no crash for now if we are
> called with a NULL client.
> 
> Christophe



> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170202/30457cfa/attachment.sig>


More information about the Spice-devel mailing list