From 52d73703117872627b4aa76414213fb636e3c93e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 1 Apr 2022 15:16:20 +0530 Subject: [PATCH] x11: Fix unused variable warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These are emitted when XInput 2 is not available. ``` ../subprojects/gst-plugins-base/sys/ximage/ximagesink.c: In function ‘gst_x_image_sink_handle_xevents’: ../subprojects/gst-plugins-base/sys/ximage/ximagesink.c:696:29: warning: unused variable ‘state’ [-Wunused-variable] 696 | GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE; | ^~~~~ ../subprojects/gst-plugins-base/sys/ximage/ximagesink.c:694:35: warning: unused variable ‘touch_frame_open’ [-Wunused-variable] 694 | gboolean pointer_moved = FALSE, touch_frame_open = FALSE; | ^~~~~~~~~~~~~~~~ ../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c: In function ‘gst_xv_image_sink_handle_xevents’: ../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c:427:35: warning: unused variable ‘touch_frame_open’ [-Wunused-variable] 427 | gboolean pointer_moved = FALSE, touch_frame_open = FALSE; | ^~~~~~~~~~~~~~~~ ../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c:426:29: warning: unused variable ‘state’ [-Wunused-variable] 426 | GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE; | ^~~~~ ``` Part-of: --- subprojects/gst-plugins-base/sys/ximage/ximagesink.c | 5 ++++- subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-base/sys/ximage/ximagesink.c b/subprojects/gst-plugins-base/sys/ximage/ximagesink.c index a72e307..e885b72 100644 --- a/subprojects/gst-plugins-base/sys/ximage/ximagesink.c +++ b/subprojects/gst-plugins-base/sys/ximage/ximagesink.c @@ -691,9 +691,12 @@ gst_x_image_sink_handle_xevents (GstXImageSink * ximagesink) { XEvent e; gint pointer_x = 0, pointer_y = 0; - gboolean pointer_moved = FALSE, touch_frame_open = FALSE; + gboolean pointer_moved = FALSE; gboolean exposed = FALSE, configured = FALSE; +#ifdef HAVE_XI2 + gboolean touch_frame_open = FALSE; GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE; +#endif g_return_if_fail (GST_IS_X_IMAGE_SINK (ximagesink)); diff --git a/subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c b/subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c index 68b8fb7..7f98f0a 100644 --- a/subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c +++ b/subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c @@ -423,9 +423,12 @@ gst_xv_image_sink_handle_xevents (GstXvImageSink * xvimagesink) { XEvent e; gint pointer_x = 0, pointer_y = 0; - GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE; - gboolean pointer_moved = FALSE, touch_frame_open = FALSE; + gboolean pointer_moved = FALSE; gboolean exposed = FALSE, configured = FALSE; +#ifdef HAVE_XI2 + gboolean touch_frame_open = FALSE; + GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE; +#endif g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink)); -- 2.7.4