x11: Fix compiler warnings

Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
This commit is contained in:
Matthias Clasen 2015-05-30 21:17:45 -04:00
parent 393df9f7e1
commit fdb9a8e142
7 changed files with 18 additions and 36 deletions

View File

@ -610,12 +610,12 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
{ {
xResourceReq *resource_req; xResourceReq *resource_req;
xGetPropertyReq *prop_req; xGetPropertyReq *prop_req;
Window window = state.children[i]; Window win = state.children[i];
if (get_wm_state) if (get_wm_state)
{ {
GetReq (GetProperty, prop_req); GetReq (GetProperty, prop_req);
prop_req->window = window; prop_req->window = win;
prop_req->property = wm_state_atom; prop_req->property = wm_state_atom;
prop_req->type = AnyPropertyType; prop_req->type = AnyPropertyType;
prop_req->delete = False; 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; 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; 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; state.child_states[i].seq[CHILD_INFO_GET_GEOMETRY] = dpy->request;
} }

View File

@ -466,10 +466,9 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
{ {
gint width, height; gint width, height;
GList *toplevels, *list; GList *toplevels, *list;
Window pointer_window, root, child; Window pointer_window;
int rootx = -1, rooty = -1; int rootx = -1, rooty = -1;
int winx, winy; int winx, winy;
unsigned int xmask;
/* FIXME: untrusted clients case not multidevice-safe */ /* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None; pointer_window = None;

View File

@ -534,7 +534,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
{ {
gint width, height; gint width, height;
GList *toplevels, *list; GList *toplevels, *list;
Window pointer_window, root, child; Window pointer_window;
/* FIXME: untrusted clients case not multidevice-safe */ /* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None; pointer_window = None;

View File

@ -214,7 +214,6 @@ translate_device_classes (GdkDisplay *display,
case XIKeyClass: case XIKeyClass:
{ {
XIKeyClassInfo *key_info = (XIKeyClassInfo *) class_info; XIKeyClassInfo *key_info = (XIKeyClassInfo *) class_info;
gint i;
_gdk_device_set_keys (device, key_info->num_keycodes); _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) if (gdk_device_get_mode (event->motion.device) == GDK_MODE_WINDOW)
{ {
GdkDevice *device = event->motion.device;
/* Update event coordinates from axes */ /* Update event coordinates from axes */
gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_X, &event->motion.x); gdk_device_get_axis (event->motion.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_Y, &event->motion.y);
} }
} }
break; break;

View File

@ -151,7 +151,7 @@ _gdk_x11_display_free_translate_queue (GdkDisplay *display)
static void static void
gdk_window_queue (GdkWindow *window, gdk_window_queue (GdkWindow *window,
GdkWindowQueueItem *item) GdkWindowQueueItem *new_item)
{ {
GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_DISPLAY (window)); GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_DISPLAY (window));
@ -205,13 +205,13 @@ gdk_window_queue (GdkWindow *window,
} }
} }
item->window = window; new_item->window = window;
item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window)); new_item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window));
g_object_add_weak_pointer (G_OBJECT (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 void

View File

@ -372,17 +372,17 @@ update_keymaps (GdkX11Keymap *keymap_x11)
for (i = 0; i < map_size; i++) for (i = 0; i < map_size; i++)
{ {
/* Get the key code at this point in the map. */ /* 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; gint j;
KeySym *syms; KeySym *syms;
guint mask; guint mask;
/* Ignore invalid keycodes. */ /* Ignore invalid keycodes. */
if (keycode < keymap_x11->min_keycode || if (code < keymap_x11->min_keycode ||
keycode > keymap_x11->max_keycode) code > keymap_x11->max_keycode)
continue; 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; mask = 0;
for (j = 0; j < keymap_x11->keysyms_per_keycode; j++) for (j = 0; j < keymap_x11->keysyms_per_keycode; j++)

View File

@ -53,20 +53,6 @@ static gboolean gdk_visual_equal (Visual *a,
Visual *b); 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) G_DEFINE_TYPE (GdkX11Visual, gdk_x11_visual, GDK_TYPE_VISUAL)
static void static void