[PATCH weston 1/8] shell: fix uninitialized variable warning

Kristian Høgsberg hoegsberg at gmail.com
Mon May 7 13:55:13 PDT 2012


On Mon, May 07, 2012 at 03:23:07PM +0300, Tiago Vignatti wrote:
> and shut-up valgrind:
>  Conditional jump or move depends on uninitialised value(s)
>     at 0xB5AFB05: shell_surface_configure (shell.c:2162)
>     by 0x407B0C: surface_attach (compositor.c:1225)
>     by 0x621FA13: ffi_call_unix64
>     by 0x621F434: ffi_call
>     by 0x4E3D3F5: wl_closure_invoke (connection.c:758)
>     by 0x4E3786C: wl_client_connection_data (wayland-server.c:255)
>     by 0x4E3AA19: wl_event_source_fd_dispatch (event-loop.c:78)
>     by 0x4E3B533: wl_event_loop_dispatch (event-loop.c:460)
>     by 0x4E38D2C: wl_display_run (wayland-server.c:907)
>     by 0x40B5DD: main (compositor.c:2748)

Ah, oops.  Thanks.
Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  src/shell.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 8c35ae8..6f1ba81 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -2149,7 +2149,7 @@ shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
>  {
>  	struct shell_surface *shsurf = get_shell_surface(es);
>  	struct desktop_shell *shell = shsurf->shell;
> -	int type_changed;
> +	int type_changed = 0;
>  
>  	if (shsurf->next_type != SHELL_SURFACE_NONE &&
>  	    shsurf->type != shsurf->next_type) {
> -- 
> 1.7.9.5
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list