Re: warning-reducing patch



Hi,

Looks good with notes below, should go in both gconf-1-0 branch and
HEAD with the exception of changes to public headers.

Thanks!

I plan to get a GConf release out next week with this and other fixes.

Darin Adler <darin bentspoon com> writes: 
>   static GSList*
> -copy_value_list(GSList* list)
> +copy_value_list(const GSList* list)
>   {
>     GSList* copy = NULL;
> -  GSList* tmp = list;
> +  const GSList* tmp;
> 
> -  while (tmp != NULL)
> -    {
> -      copy = g_slist_prepend(copy, gconf_value_copy(tmp->data));
> -
> -      tmp = g_slist_next(tmp);
> -    }
> +  for (tmp = list; tmp != NULL; tmp = tmp->next)
> +    copy = g_slist_prepend(copy, gconf_value_copy(tmp->data));

I dislike both for loops (you will notice all my code is while loops)
and "const GSList" so this particular change isn't my favorite. ;-)

> Index: gconf/gconf.h
> ===================================================================
> RCS file: /cvs/gnome/gconf/gconf/gconf.h,v
> retrieving revision 1.63
> diff -p -u -r1.63 gconf.h
> --- gconf/gconf.h	2001/04/28 20:28:54	1.63
> +++ gconf/gconf.h	2001/07/13 16:09:28
> @@ -83,7 +83,7 @@ GConfValue* gconf_engine_get_default_fro
>                                                     GError  **err);
>   gboolean    gconf_engine_set                     (GConfEngine  *conf,
>                                                     const gchar  *key,
> -                                                  GConfValue   *value,
> +                                                  const GConfValue *value,
>                                                     GError  **err);
>   gboolean    gconf_engine_unset                   (GConfEngine  *conf,
>                                                     const gchar  *key,

Public header, so HEAD only.

Havoc






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