[Spice-devel] [PATCH 15/16] Change spice_server_set_ticket() to use local 's'

Pavel Grunt pgrunt at redhat.com
Thu Jan 21 02:13:47 PST 2016


On Wed, 2016-01-20 at 10:50 -0500, Frediano Ziglio wrote:
> > From: Jonathon Jongsma <jjongsma at redhat.com>
> > 
> > Rather than using global 'reds' variable
> > ---
> >  server/reds.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/server/reds.c b/server/reds.c
> > index 080c0f6..c112be4 100644
> > --- a/server/reds.c
> > +++ b/server/reds.c
> > @@ -3608,16 +3608,16 @@ SPICE_GNUC_VISIBLE int
> > spice_server_set_ticket(SpiceServer *s,
> >  {
> >      spice_assert(reds == s);
> >  
> > -    if (reds_main_channel_connected(reds)) {
> > +    if (reds_main_channel_connected(s)) {
> >          if (fail_if_connected) {
> >              return -1;
> >          }
> >          if (disconnect_if_connected) {
> > -            reds_disconnect(reds);
> > +            reds_disconnect(s);
> >          }
> >      }
> >  
> > -    on_activating_ticketing(reds);
> > +    on_activating_ticketing(s);
> >      ticketing_enabled = 1;
> >      if (lifetime == 0) {
> >          taTicket.expiration_time = INT_MAX;
> 
> Why not changing the argument name to reds and remove the assert?
> Patch will be smaller and reds is more readable than s.
> 
> Frediano

I would also go for renaming.

Pavel

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


More information about the Spice-devel mailing list