[gtk/matthiasc/for-master: 1/2] x11: Fix release build warnings



commit dccda1c9c420d4a13dfac3ec3787e0ea0c196b46
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 18 02:34:25 2020 -0500

    x11: Fix release build warnings

 gdk/x11/gdkclipboard-x11.c | 14 +++++++-------
 gdk/x11/gdkdrag-x11.c      |  4 ++++
 gdk/x11/gdkdrop-x11.c      | 10 +++++-----
 3 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/gdk/x11/gdkclipboard-x11.c b/gdk/x11/gdkclipboard-x11.c
index 2d4326c699..35eca2f65e 100644
--- a/gdk/x11/gdkclipboard-x11.c
+++ b/gdk/x11/gdkclipboard-x11.c
@@ -65,9 +65,7 @@ print_atoms (GdkX11Clipboard *cb,
              const Atom      *atoms,
              gsize            n_atoms)
 {
-  GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
-
-  GDK_DISPLAY_NOTE (display, CLIPBOARD,
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD,
       gsize i;
 
       g_printerr ("%s: %s [ ", cb->selection, prefix);
@@ -86,9 +84,7 @@ gdk_x11_clipboard_default_output_done (GObject      *clipboard,
 
   if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
     {
-      GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard));
-
-      GDK_DISPLAY_NOTE (display, CLIPBOARD,
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), CLIPBOARD,
                 g_printerr ("%s: failed to write stream: %s\n",
                             GDK_X11_CLIPBOARD (clipboard)->selection, error->message));
       g_error_free (error);
@@ -440,16 +436,20 @@ gdk_x11_clipboard_xevent (GdkDisplay   *display,
 
     case SelectionRequest:
       {
-        const char *target, *property;
+#ifdef G_ENABLE_DEBUG
+       const char *target, *property;
+#endif
 
         if (xevent->xselectionrequest.selection != cb->xselection)
           return FALSE;
 
+#ifdef G_ENABLE_DEBUG
         target = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.target);
         if (xevent->xselectionrequest.property == None)
           property = target;
         else
           property = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.property);
+#endif
 
         if (!gdk_clipboard_is_local (GDK_CLIPBOARD (cb)))
           {
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c
index ed78c284ba..fb341088c2 100644
--- a/gdk/x11/gdkdrag-x11.c
+++ b/gdk/x11/gdkdrag-x11.c
@@ -1749,16 +1749,20 @@ gdk_x11_drag_xevent (GdkDisplay   *display,
 
     case SelectionRequest:
       {
+#ifdef G_ENABLE_DEBUG
         const char *target, *property;
+#endif
 
         if (xevent->xselectionrequest.selection != xselection)
           return FALSE;
 
+#ifdef G_ENABLE_DEBUG
         target = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.target);
         if (xevent->xselectionrequest.property == None)
           property = target;
         else
           property = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.property);
+#endif
 
         if (xevent->xselectionrequest.requestor == None)
           {
diff --git a/gdk/x11/gdkdrop-x11.c b/gdk/x11/gdkdrop-x11.c
index bbf377f898..07e5a8fc89 100644
--- a/gdk/x11/gdkdrop-x11.c
+++ b/gdk/x11/gdkdrop-x11.c
@@ -145,9 +145,9 @@ gdk_x11_drop_read_got_stream (GObject      *source,
     }
   else
     {
-      const char *mime_type = ((GSList *) g_task_get_task_data (task))->data;
 #if 0
       gsize i;
+      const char *mime_type = ((GSList *) g_task_get_task_data (task))->data;
 
       for (i = 0; i < G_N_ELEMENTS (special_targets); i++)
         {
@@ -166,7 +166,7 @@ gdk_x11_drop_read_got_stream (GObject      *source,
 #endif
 
       GDK_NOTE (DND, g_printerr ("reading DND as %s now\n",
-                                mime_type));
+                                 (const char *)((GSList *) g_task_get_task_data (task))->data));
       g_task_return_pointer (task, stream, g_object_unref);
     }
 
@@ -732,14 +732,14 @@ gdk_x11_drop_do_nothing (Window   window,
                          gboolean success,
                          gpointer data)
 {
+#ifdef G_ENABLE_DEBUG
   GdkDisplay *display = data;
 
   if (!success)
     {
-      GDK_DISPLAY_NOTE (display, DND,
-                g_message ("Send event to %lx failed",
-                           window));
+      GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", window));
     }
+#endif
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]