shell: fix uninitialized variable warning
authorTiago Vignatti <tiago.vignatti@intel.com>
Mon, 7 May 2012 12:23:07 +0000 (15:23 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 7 May 2012 20:54:32 +0000 (16:54 -0400)
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)

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
src/shell.c

index 6af1d38..36bea52 100644 (file)
@@ -2154,7 +2154,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) {