diff options
Diffstat (limited to 'backend/libinput/tablet_tool.c')
-rw-r--r-- | backend/libinput/tablet_tool.c | 11 |
1 files changed, 6 insertions, 5 deletions
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. |