[packagekit] packagekit: Branch 'master' - 14 commits

Richard Hughes hughsient at gmail.com
Sun Sep 9 12:02:00 PDT 2007


On 09/09/2007, Grzegorz Dąbrowski <gdx at o2.pl> wrote:
> On Sun, 2007-09-09 at 10:32 -0700, Richard Hughes wrote:
>
> > +gboolean
> > +pk_enum_list_append_multiple (PkEnumList *elist, guint value, ...)
> > +{
> > +     va_list args;
> > +     guint i;
> > +     guint value_temp;
> > +
> > +     /* create a new list. A list must have at least one entry */
> > +     g_ptr_array_add (elist->priv->data, GUINT_TO_POINTER(value));
> > +
> > +     /* process the valist */
> > +     va_start (args, value);
> > +     for (i=0;; i++) {
> > +             value_temp = va_arg (args, guint);
> > +             if (value_temp == 0) break;
> > +             g_ptr_array_add (elist->priv->data, GUINT_TO_POINTER(value_temp));
> > +     }
> > +     va_end (args);
> > +
> > +     return TRUE;
> > +}
>
> I'm not sure that "if (value_temp == 0) break" is a good idea, because
> some of enums have value 0.

Good point. What about -1?

Richard.


More information about the PackageKit mailing list