Re: [spice-gtk v1 4/4] gtk-session: better variable name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Dec 06, 2018 at 03:47:26AM -0500, Frediano Ziglio wrote:
> >          for (m = 0; m < SPICE_N_ELEMENTS(atom2agent); m++) {
> >              if (atom2agent[m].vdagent == types[n] && !target_selected[m]) {
> >                  found = TRUE;
> > -                g_return_val_if_fail(i < SPICE_N_ELEMENTS(atom2agent),
> > FALSE);
> > -                targets[i].target = (gchar*)atom2agent[m].xatom;
> > -                targets[i].info = m;
> > +                g_return_val_if_fail(num_targets <
> > SPICE_N_ELEMENTS(atom2agent), FALSE);
> > +                targets[num_targets].target = (gchar*)atom2agent[m].xatom;
> > +                targets[num_targets].info = m;
> >                  target_selected[m] = TRUE;
> > -                i += 1;
> > +                num_targets += 1;
> 
> Really minor, why not "num_targets++;" ?

Why not indeed. I'll change it.

> Very OT: sometimes I miss the "with" statement from Pascal!

:)

> >              }
> >          }
> >          if (!found) {
> > @@ -806,8 +806,8 @@ static gboolean clipboard_grab(SpiceMainChannel *main,
> > guint selection,
> >      }
> >  
> >      g_free(s->clip_targets[selection]);
> > -    s->nclip_targets[selection] = i;
> > -    s->clip_targets[selection] = g_memdup(targets, sizeof(GtkTargetEntry) *
> > i);
> > +    s->nclip_targets[selection] = num_targets;
> > +    s->clip_targets[selection] = g_memdup(targets, sizeof(GtkTargetEntry) *
> > num_targets);
> >      /* Receiving a grab implies we've released our own grab */
> >      s->clip_grabbed[selection] = FALSE;
> >  
> > @@ -817,8 +817,12 @@ static gboolean clipboard_grab(SpiceMainChannel *main,
> > guint selection,
> >          return TRUE;
> >      }
> >  
> > -    if (!gtk_clipboard_set_with_owner(cb, targets, i,
> > -                                      clipboard_get, clipboard_clear,
> > G_OBJECT(self))) {
> > +    if (!gtk_clipboard_set_with_owner(cb,
> > +                                      targets,
> > +                                      num_targets,
> > +                                      clipboard_get,
> > +                                      clipboard_clear,
> > +                                      G_OBJECT(self))) {
> >          g_warning("clipboard grab failed");
> >          return FALSE;
> >      }
> 
> Otherwise,
> Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> 
> Frediano

Thanks,
Victor

Attachment: signature.asc
Description: PGP signature

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

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]