[Spice-devel] [spice-gtk v1 3/4] gtk-session: remove single goto usage

Victor Toso victortoso at redhat.com
Wed Dec 5 16:17:22 UTC 2018


On Wed, Dec 05, 2018 at 11:06:56AM -0500, Frediano Ziglio wrote:
> > 
> > From: Victor Toso <me at victortoso.com>
> > 
> > Returning TRUE here should be fine. Not much error handling around the
> > label.
> 
> About "Returning TRUE here should be fine" not sure why you
> used the "should", any doubt? Is it like "maybe in the future
> there could be a need for a label to do more clean up" ?

I'm not native speaker. I meant that I don't expect problems in
returning TRUE instead of being unsure that this change is fine.
 
> > Signed-off-by: Victor Toso <victortoso at redhat.com>
> 
> Otherwise,
> 
> Acked-by: Frediano Ziglio <fziglio at redhat.com>

Let me know if I should change the commit log.
Thanks for review,
Victor
 
> > ---
> >  src/spice-gtk-session.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> > index 1615172..bf3c1fb 100644
> > --- a/src/spice-gtk-session.c
> > +++ b/src/spice-gtk-session.c
> > @@ -813,8 +813,9 @@ static gboolean clipboard_grab(SpiceMainChannel *main,
> > guint selection,
> >  
> >      if (read_only(self) ||
> >          !s->auto_clipboard_enable ||
> > -        s->nclip_targets[selection] == 0)
> > -        goto skip_grab_clipboard;
> > +        s->nclip_targets[selection] == 0) {
> > +        return TRUE;
> > +    }
> >  
> >      if (!gtk_clipboard_set_with_owner(cb, targets, i,
> >                                        clipboard_get, clipboard_clear,
> >                                        G_OBJECT(self))) {
> > @@ -824,7 +825,6 @@ static gboolean clipboard_grab(SpiceMainChannel *main,
> > guint selection,
> >      s->clipboard_by_guest[selection] = TRUE;
> >      s->clip_hasdata[selection] = FALSE;
> >  
> > -skip_grab_clipboard:
> >      return TRUE;
> >  }
> >  
> 
> Frediano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20181205/8ac69a11/attachment.sig>


More information about the Spice-devel mailing list