From a6308cea602f688ac653e3466cd57767e02093a9 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 24 Nov 2016 11:54:44 +0200 Subject: [PATCH] xwayland: fix 'buffer' may be used uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warning due to --disable-glamor: CC Xwayland-xwayland.o In file included from /home/pq/local/include/wayland-client.h:40:0, from xwayland.h:35, from xwayland.c:26: xwayland.c: In function ‘block_handler’: /home/pq/local/include/wayland-client-protocol.h:3446:2: warning: ‘buffer’ may be used uninitialized in this function [-Wmaybe-uninitialized] wl_proxy_marshal((struct wl_proxy *) wl_surface, ^ xwayland.c:466:23: note: ‘buffer’ was declared here struct wl_buffer *buffer; ^ Signed-off-by: Pekka Paalanen Reviewed-by: Olivier Fourdan --- hw/xwayland/xwayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index c2ac4b3ff..9d795544d 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -474,8 +474,8 @@ xwl_window_post_damage(struct xwl_window *xwl_window) #if GLAMOR_HAS_GBM if (xwl_screen->glamor) buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap); + else #endif - if (!xwl_screen->glamor) buffer = xwl_shm_pixmap_get_wl_buffer(pixmap); wl_surface_attach(xwl_window->surface, buffer, 0, 0);