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

Grzegorz Dąbrowski gdx at o2.pl
Sun Sep 9 13:49:34 PDT 2007


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.

-- 
Grzegorz Dabrowski
Pingwinek GNU/Linux http://home.gna.org/pingwinek/




More information about the PackageKit mailing list