[mutter] wayland/keyboard: Stop using temporary wl_list 'l'
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/keyboard: Stop using temporary wl_list 'l'
- Date: Wed, 12 Oct 2016 02:01:31 +0000 (UTC)
commit 4a3781d7dbc9ce01865fdb5154246d16d7c399ef
Author: Jonas Ådahl <jadahl gmail com>
Date: Tue Sep 20 16:46:16 2016 +0800
wayland/keyboard: Stop using temporary wl_list 'l'
The variable name 'l' usually refers to a GList iterator, but here it's
just a short hand for a specific list. Stop using this shorthand, since
it just makes it harder to read what list is used.
https://bugzilla.gnome.org/show_bug.cgi?id=771646
src/wayland/meta-wayland-keyboard.c | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index de4540c..d62d737 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -264,10 +264,8 @@ meta_wayland_keyboard_broadcast_key (MetaWaylandKeyboard *keyboard,
uint32_t state)
{
struct wl_resource *resource;
- struct wl_list *l;
- l = &keyboard->focus_resource_list;
- if (!wl_list_empty (l))
+ if (!wl_list_empty (&keyboard->focus_resource_list))
{
MetaWaylandInputDevice *input_device =
META_WAYLAND_INPUT_DEVICE (keyboard);
@@ -275,7 +273,7 @@ meta_wayland_keyboard_broadcast_key (MetaWaylandKeyboard *keyboard,
keyboard->key_serial =
meta_wayland_input_device_next_serial (input_device);
- wl_resource_for_each (resource, l)
+ wl_resource_for_each (resource, &keyboard->focus_resource_list)
{
wl_keyboard_send_key (resource, keyboard->key_serial, time, key, state);
}
@@ -350,10 +348,8 @@ static void
meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
{
struct wl_resource *resource;
- struct wl_list *l;
- l = &keyboard->focus_resource_list;
- if (!wl_list_empty (l))
+ if (!wl_list_empty (&keyboard->focus_resource_list))
{
MetaWaylandInputDevice *input_device =
META_WAYLAND_INPUT_DEVICE (keyboard);
@@ -361,7 +357,7 @@ meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
serial = meta_wayland_input_device_next_serial (input_device);
- wl_resource_for_each (resource, l)
+ wl_resource_for_each (resource, &keyboard->focus_resource_list)
keyboard_send_modifiers (keyboard, resource, serial);
}
}
@@ -837,16 +833,14 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
if (keyboard->focus_surface != NULL)
{
struct wl_resource *resource;
- struct wl_list *l;
- l = &keyboard->focus_resource_list;
- if (!wl_list_empty (l))
+ if (!wl_list_empty (&keyboard->focus_resource_list))
{
uint32_t serial;
serial = meta_wayland_input_device_next_serial (input_device);
- wl_resource_for_each (resource, l)
+ wl_resource_for_each (resource, &keyboard->focus_resource_list)
{
wl_keyboard_send_leave (resource, serial, keyboard->focus_surface->resource);
}
@@ -861,7 +855,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
if (surface != NULL)
{
struct wl_resource *resource;
- struct wl_list *l;
keyboard->focus_surface = surface;
wl_resource_add_destroy_listener (keyboard->focus_surface->resource,
&keyboard->focus_surface_listener);
@@ -870,13 +863,12 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
&keyboard->resource_list,
wl_resource_get_client (keyboard->focus_surface->resource));
- l = &keyboard->focus_resource_list;
- if (!wl_list_empty (l))
+ if (!wl_list_empty (&keyboard->focus_resource_list))
{
keyboard->focus_serial =
meta_wayland_input_device_next_serial (input_device);
- wl_resource_for_each (resource, l)
+ wl_resource_for_each (resource, &keyboard->focus_resource_list)
{
broadcast_focus (keyboard, resource);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]