Prevent 'unused variable' warnings when compiled without asserts

This commit is contained in:
Consolatis 2024-02-10 18:02:30 +01:00
parent e9552fb661
commit a5c6b2f83d
4 changed files with 10 additions and 8 deletions

View file

@ -628,11 +628,15 @@ seat_set_focus_layer(struct seat *seat, struct wlr_layer_surface_v1 *layer)
static void
pressed_surface_destroy(struct wl_listener *listener, void *data)
{
struct wlr_surface *surface = data;
struct seat *seat = wl_container_of(listener, seat,
pressed_surface_destroy);
assert(surface == seat->pressed.surface);
/*
* Using data directly prevents 'unused variable'
* warning when compiling without asserts
*/
assert(data == seat->pressed.surface);
seat_reset_pressed(seat);
}