Re: [PATCH] trivial: Initialize boolean in declaration



Apparently it's getting a "could be used uninitialized" warning, but the
variable is pretty clearly initialized.  Perhaps a bug in that gcc?

The nautilus styleguide specifies that variables should be initialized
separately from their declaration, so I'd rather not change these.

-dave

On Tue, 2004-01-06 at 15:29, Christian Neumair wrote:
> gcc (GCC) 3.3.3 20031229 that ships with Debian/Sid doesn't like a
> gboolean declaration in libnautilus-private/nautilus-icon-container.
> c:1768.
> The attached trivial patch removes the warning by initializing the
> gboolean at declaration time.
> In many other places the same is done, e.g. in libnautilus-private/
> nautilus-audio-player.c:301,302.
> 
> regs,
>  Chris
> 
> ______________________________________________________________________
> Index: libnautilus-private/nautilus-icon-container.c
> ===================================================================
> RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
> retrieving revision 1.357
> diff -u -r1.357 nautilus-icon-container.c
> --- libnautilus-private/nautilus-icon-container.c	5 Jan 2004 21:11:57 -0000	1.357
> +++ libnautilus-private/nautilus-icon-container.c	6 Jan 2004 20:31:13 -0000
> @@ -1765,11 +1765,9 @@
>  select_one_unselect_others (NautilusIconContainer *container,
>  			    NautilusIcon *icon_to_select)
>  {
> -	gboolean selection_changed;
> +	gboolean selection_changed = FALSE;
>  	GList *p;
>  	NautilusIcon *icon;
> -
> -	selection_changed = FALSE;
>  	
>  	for (p = container->details->icons; p != NULL; p = p->next) {
>  		icon = p->data;




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