[gimp] libgimpwidgets: fix warnings on Windows/macOS.



commit e43d6217fad835be6567d8f4700d05ea907ca020
Author: Jehan <jehan girinstud io>
Date:   Tue Oct 12 13:20:53 2021 +0200

    libgimpwidgets: fix warnings on Windows/macOS.
    
    The variables `screen` and `display` are only for the GDK_WINDOWING_X11
    code path.
    
    Fixing the following warnings:
    
    libgimpwidgets/gimpwidgetsutils.c: In function 'gimp_monitor_get_color_profile':
    libgimpwidgets/gimpwidgetsutils.c:502:21: warning: unused variable 'screen' [-Wunused-variable]
      502 |   GdkScreen        *screen;
          |                     ^~~~~~
    libgimpwidgets/gimpwidgetsutils.c:501:21: warning: variable 'display' set but not used 
[-Wunused-but-set-variable]
      501 |   GdkDisplay       *display;
          |                     ^~~~~~~

 libgimpwidgets/gimpwidgetsutils.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/libgimpwidgets/gimpwidgetsutils.c b/libgimpwidgets/gimpwidgetsutils.c
index 02dd697452..3d7b92a1a2 100644
--- a/libgimpwidgets/gimpwidgetsutils.c
+++ b/libgimpwidgets/gimpwidgetsutils.c
@@ -498,24 +498,23 @@ monitor_number (GdkMonitor *monitor)
 GimpColorProfile *
 gimp_monitor_get_color_profile (GdkMonitor *monitor)
 {
-  GdkDisplay       *display;
-  GdkScreen        *screen;
   GimpColorProfile *profile = NULL;
 
   g_return_val_if_fail (GDK_IS_MONITOR (monitor), NULL);
 
-  display = gdk_monitor_get_display (monitor);
-
 #if defined GDK_WINDOWING_X11
   {
-    GdkAtom  type    = GDK_NONE;
-    gint     format  = 0;
-    gint     nitems  = 0;
-    gint     number;
-    gchar   *atom_name;
-    guchar  *data    = NULL;
-
-    number = monitor_number (monitor);
+    GdkDisplay *display;
+    GdkScreen  *screen;
+    GdkAtom     type    = GDK_NONE;
+    gint        format  = 0;
+    gint        nitems  = 0;
+    gint        number;
+    gchar      *atom_name;
+    guchar     *data    = NULL;
+
+    display = gdk_monitor_get_display (monitor);
+    number  = monitor_number (monitor);
 
     if (number > 0)
       atom_name = g_strdup_printf ("_ICC_PROFILE_%d", number);


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