aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/libinput/backend.c8
-rw-r--r--backend/libinput/events.c5
-rw-r--r--backend/libinput/tablet_tool.c11
-rw-r--r--types/tablet_v2/wlr_tablet_v2_pad.c6
-rw-r--r--types/tablet_v2/wlr_tablet_v2_tablet.c6
-rw-r--r--types/wlr_tablet_pad.c6
-rw-r--r--types/wlr_tablet_tool.c6
7 files changed, 25 insertions, 23 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index a9595df2..c7bde4a9 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -141,13 +141,13 @@ static void backend_destroy(struct wlr_backend *wlr_backend) {
struct wlr_libinput_backend *backend =
get_libinput_backend_from_backend(wlr_backend);
- struct wl_list *wlr_devices;
- wl_array_for_each(wlr_devices, &backend->wlr_device_lists) {
+ struct wl_list **wlr_devices_ptr;
+ wl_array_for_each(wlr_devices_ptr, &backend->wlr_device_lists) {
struct wlr_input_device *wlr_dev, *next;
- wl_list_for_each_safe(wlr_dev, next, wlr_devices, link) {
+ wl_list_for_each_safe(wlr_dev, next, *wlr_devices_ptr, link) {
wlr_input_device_destroy(wlr_dev);
}
- free(wlr_devices);
+ free(*wlr_devices_ptr);
}
wlr_backend_finish(wlr_backend);
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index 1fc8cc09..f149b2f1 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -220,8 +220,9 @@ static void handle_device_removed(struct wlr_libinput_backend *backend,
wlr_input_device_destroy(dev);
}
size_t i = 0;
- struct wl_list *iter;
- wl_array_for_each(iter, &backend->wlr_device_lists) {
+ struct wl_list **ptr;
+ wl_array_for_each(ptr, &backend->wlr_device_lists) {
+ struct wl_list *iter = *ptr;
if (iter == wlr_devices) {
array_remove_at(&backend->wlr_device_lists,
i * sizeof(struct wl_list *), sizeof(struct wl_list *));
diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c
index 8b143e7f..b0427e5f 100644
--- a/backend/libinput/tablet_tool.c
+++ b/backend/libinput/tablet_tool.c
@@ -48,8 +48,9 @@ static void destroy_tablet(struct wlr_tablet *wlr_tablet) {
struct wlr_libinput_tablet *tablet =
wl_container_of(wlr_tablet, tablet, wlr_tablet);
- struct wlr_libinput_tablet_tool *tool;
- wl_array_for_each(tool, &tablet->tools) {
+ struct wlr_libinput_tablet_tool **tool_ptr;
+ wl_array_for_each(tool_ptr, &tablet->tools) {
+ struct wlr_libinput_tablet_tool *tool = *tool_ptr;
if (--tool->pad_refs == 0) {
destroy_tool(tool);
}
@@ -151,9 +152,9 @@ static void ensure_tool_reference(struct wlr_libinput_tablet_tool *tool,
struct wlr_libinput_tablet *tablet =
wl_container_of(wlr_dev, tablet, wlr_tablet);
- struct wlr_libinput_tablet_tool *iter;
- wl_array_for_each(iter, &tablet->tools) {
- if (iter == tool) { // We already have a ref
+ struct wlr_libinput_tablet_tool **tool_ptr;
+ wl_array_for_each(tool_ptr, &tablet->tools) {
+ if (*tool_ptr == tool) { // We already have a ref
// XXX: We *could* optimize the tool to the front of
// the list here, since we will probably get the next
// couple of events from the same tool.
diff --git a/types/tablet_v2/wlr_tablet_v2_pad.c b/types/tablet_v2/wlr_tablet_v2_pad.c
index 5edacb13..020cba57 100644
--- a/types/tablet_v2/wlr_tablet_v2_pad.c
+++ b/types/tablet_v2/wlr_tablet_v2_pad.c
@@ -327,9 +327,9 @@ void add_tablet_pad_client(struct wlr_tablet_seat_client_v2 *seat,
zwp_tablet_pad_v2_send_buttons(client->resource, pad->wlr_pad->button_count);
}
- const char *path;
- wl_array_for_each(path, &pad->wlr_pad->paths) {
- zwp_tablet_pad_v2_send_path(client->resource, path);
+ const char **path_ptr;
+ wl_array_for_each(path_ptr, &pad->wlr_pad->paths) {
+ zwp_tablet_pad_v2_send_path(client->resource, *path_ptr);
}
size_t i = 0;
diff --git a/types/tablet_v2/wlr_tablet_v2_tablet.c b/types/tablet_v2/wlr_tablet_v2_tablet.c
index 16042995..bf2a9159 100644
--- a/types/tablet_v2/wlr_tablet_v2_tablet.c
+++ b/types/tablet_v2/wlr_tablet_v2_tablet.c
@@ -114,9 +114,9 @@ void add_tablet_client(struct wlr_tablet_seat_client_v2 *seat,
zwp_tablet_v2_send_id(client->resource,
tablet->wlr_device->vendor, tablet->wlr_device->product);
- const char *path;
- wl_array_for_each(path, &tablet->wlr_tablet->paths) {
- zwp_tablet_v2_send_path(client->resource, path);
+ const char **path_ptr;
+ wl_array_for_each(path_ptr, &tablet->wlr_tablet->paths) {
+ zwp_tablet_v2_send_path(client->resource, *path_ptr);
}
zwp_tablet_v2_send_done(client->resource);
diff --git a/types/wlr_tablet_pad.c b/types/wlr_tablet_pad.c
index 3f9e2651..2bd996a6 100644
--- a/types/wlr_tablet_pad.c
+++ b/types/wlr_tablet_pad.c
@@ -21,9 +21,9 @@ void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad) {
return;
}
- char *path;
- wl_array_for_each(path, &pad->paths) {
- free(path);
+ char **path_ptr;
+ wl_array_for_each(path_ptr, &pad->paths) {
+ free(*path_ptr);
}
wl_array_release(&pad->paths);
diff --git a/types/wlr_tablet_tool.c b/types/wlr_tablet_tool.c
index f01ae3c3..5c0037bd 100644
--- a/types/wlr_tablet_tool.c
+++ b/types/wlr_tablet_tool.c
@@ -19,9 +19,9 @@ void wlr_tablet_destroy(struct wlr_tablet *tablet) {
return;
}
- char *path;
- wl_array_for_each(path, &tablet->paths) {
- free(path);
+ char **path_ptr;
+ wl_array_for_each(path_ptr, &tablet->paths) {
+ free(*path_ptr);
}
wl_array_release(&tablet->paths);