[gtk+] x11: Fix compiler warnings



commit fdb9a8e142becbb3b00d56e741fba1f1a33ee86b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 30 21:17:45 2015 -0400

    x11: Fix compiler warnings
    
    Fix warnings due to -Wdeclaration-after-statement and -Wshadow.

 gdk/x11/gdkasync.c             |    8 ++++----
 gdk/x11/gdkdevice-core-x11.c   |    3 +--
 gdk/x11/gdkdevice-xi2.c        |    2 +-
 gdk/x11/gdkdevicemanager-xi2.c |    7 ++-----
 gdk/x11/gdkgeometry-x11.c      |   10 +++++-----
 gdk/x11/gdkkeys-x11.c          |   10 +++++-----
 gdk/x11/gdkvisual-x11.c        |   14 --------------
 7 files changed, 18 insertions(+), 36 deletions(-)
---
diff --git a/gdk/x11/gdkasync.c b/gdk/x11/gdkasync.c
index a0ad44a..51a088f 100644
--- a/gdk/x11/gdkasync.c
+++ b/gdk/x11/gdkasync.c
@@ -610,12 +610,12 @@ _gdk_x11_get_window_child_info (GdkDisplay       *display,
     {
       xResourceReq *resource_req;
       xGetPropertyReq *prop_req;
-      Window window = state.children[i];
+      Window win = state.children[i];
       
       if (get_wm_state)
        {
          GetReq (GetProperty, prop_req);
-         prop_req->window = window;
+         prop_req->window = win;
          prop_req->property = wm_state_atom;
          prop_req->type = AnyPropertyType;
          prop_req->delete = False;
@@ -625,10 +625,10 @@ _gdk_x11_get_window_child_info (GdkDisplay       *display,
          state.child_states[i].seq[CHILD_INFO_GET_PROPERTY] = dpy->request;
        }
       
-      GetResReq(GetWindowAttributes, window, resource_req);
+      GetResReq(GetWindowAttributes, win, resource_req);
       state.child_states[i].seq[CHILD_INFO_GET_WA] = dpy->request;
       
-      GetResReq(GetGeometry, window, resource_req);
+      GetResReq(GetGeometry, win, resource_req);
       state.child_states[i].seq[CHILD_INFO_GET_GEOMETRY] = dpy->request;
     }
 
diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c
index 30c8f94..2c1fb56 100644
--- a/gdk/x11/gdkdevice-core-x11.c
+++ b/gdk/x11/gdkdevice-core-x11.c
@@ -466,10 +466,9 @@ gdk_x11_device_core_window_at_position (GdkDevice       *device,
     {
       gint width, height;
       GList *toplevels, *list;
-      Window pointer_window, root, child;
+      Window pointer_window;
       int rootx = -1, rooty = -1;
       int winx, winy;
-      unsigned int xmask;
 
       /* FIXME: untrusted clients case not multidevice-safe */
       pointer_window = None;
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 66c3a31..b02f4c3 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -534,7 +534,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice       *device,
     {
       gint width, height;
       GList *toplevels, *list;
-      Window pointer_window, root, child;
+      Window pointer_window;
 
       /* FIXME: untrusted clients case not multidevice-safe */
       pointer_window = None;
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index a57ecaf..e63c35b 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -214,7 +214,6 @@ translate_device_classes (GdkDisplay      *display,
         case XIKeyClass:
           {
             XIKeyClassInfo *key_info = (XIKeyClassInfo *) class_info;
-            gint i;
 
             _gdk_device_set_keys (device, key_info->num_keycodes);
 
@@ -1508,11 +1507,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
 
         if (gdk_device_get_mode (event->motion.device) == GDK_MODE_WINDOW)
           {
-            GdkDevice *device = event->motion.device;
-
             /* Update event coordinates from axes */
-            gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_X, &event->motion.x);
-            gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_Y, &event->motion.y);
+            gdk_device_get_axis (event->motion.device, event->motion.axes, GDK_AXIS_X, &event->motion.x);
+            gdk_device_get_axis (event->motion.device, event->motion.axes, GDK_AXIS_Y, &event->motion.y);
           }
       }
       break;
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 5fac8fd..a018fb1 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -151,7 +151,7 @@ _gdk_x11_display_free_translate_queue (GdkDisplay *display)
 
 static void
 gdk_window_queue (GdkWindow          *window,
-                 GdkWindowQueueItem *item)
+                 GdkWindowQueueItem *new_item)
 {
   GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_DISPLAY (window));
   
@@ -205,13 +205,13 @@ gdk_window_queue (GdkWindow          *window,
        }
     }
 
-  item->window = window;
-  item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window));
+  new_item->window = window;
+  new_item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window));
   
   g_object_add_weak_pointer (G_OBJECT (window),
-                            (gpointer *)&(item->window));
+                            (gpointer *)&(new_item->window));
 
-  g_queue_push_tail (display_x11->translate_queue, item);
+  g_queue_push_tail (display_x11->translate_queue, new_item);
 }
 
 void
diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c
index 90284bd..a51e8e4 100644
--- a/gdk/x11/gdkkeys-x11.c
+++ b/gdk/x11/gdkkeys-x11.c
@@ -372,17 +372,17 @@ update_keymaps (GdkX11Keymap *keymap_x11)
       for (i = 0; i < map_size; i++)
         {
           /* Get the key code at this point in the map. */
-          gint keycode = keymap_x11->mod_keymap->modifiermap[i];
+          gint code = keymap_x11->mod_keymap->modifiermap[i];
           gint j;
           KeySym *syms;
           guint mask;
 
           /* Ignore invalid keycodes. */
-          if (keycode < keymap_x11->min_keycode ||
-              keycode > keymap_x11->max_keycode)
+          if (code < keymap_x11->min_keycode ||
+              code > keymap_x11->max_keycode)
             continue;
 
-          syms = keymap_x11->keymap + (keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
+          syms = keymap_x11->keymap + (code - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode;
 
           mask = 0;
           for (j = 0; j < keymap_x11->keysyms_per_keycode; j++)
@@ -398,7 +398,7 @@ update_keymaps (GdkX11Keymap *keymap_x11)
                 mask |= GDK_SUPER_MASK;
             }
 
-          keymap_x11->modmap[i/keymap_x11->mod_keymap->max_keypermod] |= mask;
+          keymap_x11->modmap[i / keymap_x11->mod_keymap->max_keypermod] |= mask;
 
           /* The fourth modifier, GDK_MOD1_MASK is 1 << 3.
            * Each group of max_keypermod entries refers to the same modifier.
diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
index f3b062d..e22c4c6 100644
--- a/gdk/x11/gdkvisual-x11.c
+++ b/gdk/x11/gdkvisual-x11.c
@@ -53,20 +53,6 @@ static gboolean gdk_visual_equal          (Visual    *a,
                                           Visual    *b);
 
 
-#ifdef G_ENABLE_DEBUG
-
-static const gchar *const visual_names[] =
-{
-  "static gray",
-  "grayscale",
-  "static color",
-  "pseudo color",
-  "true color",
-  "direct color",
-};
-
-#endif /* G_ENABLE_DEBUG */
-
 G_DEFINE_TYPE (GdkX11Visual, gdk_x11_visual, GDK_TYPE_VISUAL)
 
 static void


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