desktop-shell: fix shell_output_destroy_move_layer unused variable
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 13 Feb 2018 14:18:05 +0000 (16:18 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 14 Feb 2018 08:03:36 +0000 (10:03 +0200)
/home/pq/git/weston/desktop-shell/shell.c: In function ‘shell_output_destroy_move_layer’:
/home/pq/git/weston/desktop-shell/shell.c:4718:24: warning: unused variable ‘output’ [-Wunused-variable]
  struct weston_output *output = data;

Since the data pointer is not used for anything, decided to also set it
to NULL in the caller. This caused another variable to become unused.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marius-Vlad <marius-cristian.vlad@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
desktop-shell/shell.c

index 1c35d18..ceb45c7 100644 (file)
@@ -4715,7 +4715,6 @@ shell_output_destroy_move_layer(struct desktop_shell *shell,
                                struct weston_layer *layer,
                                void *data)
 {
-       struct weston_output *output = data;
        struct weston_view *view;
 
        wl_list_for_each(view, &layer->view_list.link, layer_link.link)
@@ -4727,10 +4726,9 @@ handle_output_destroy(struct wl_listener *listener, void *data)
 {
        struct shell_output *output_listener =
                container_of(listener, struct shell_output, destroy_listener);
-       struct weston_output *output = output_listener->output;
        struct desktop_shell *shell = output_listener->shell;
 
-       shell_for_each_layer(shell, shell_output_destroy_move_layer, output);
+       shell_for_each_layer(shell, shell_output_destroy_move_layer, NULL);
 
        if (output_listener->panel_surface)
                wl_list_remove(&output_listener->panel_surface_listener.link);