From 0de3659698460e5196f6964a0975b43b8dfbf6d9 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Tue, 10 Oct 2023 20:04:22 +0300 Subject: [PATCH] Drop wl_client and user data assertions in bind handlers A client can never be NULL and user data assertions aren't really useful there. --- types/seat/wlr_seat.c | 1 - types/tablet_v2/wlr_tablet_v2.c | 1 - types/wlr_input_inhibitor.c | 1 - types/wlr_input_method_v2.c | 1 - types/wlr_layer_shell_v1.c | 1 - types/wlr_pointer_constraints_v1.c | 1 - types/wlr_server_decoration.c | 1 - types/wlr_text_input_v3.c | 1 - types/xdg_shell/wlr_xdg_shell.c | 1 - 9 files changed, 9 deletions(-) diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c index 67f5cc51..9e91c9b0 100644 --- a/types/seat/wlr_seat.c +++ b/types/seat/wlr_seat.c @@ -177,7 +177,6 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat, uint32_t version, uint32_t id) { // `wlr_seat` can be NULL if the seat global is being destroyed struct wlr_seat *wlr_seat = _wlr_seat; - assert(client); struct wl_resource *wl_resource = wl_resource_create(client, &wl_seat_interface, version, id); diff --git a/types/tablet_v2/wlr_tablet_v2.c b/types/tablet_v2/wlr_tablet_v2.c index cd179d8e..d93e92d6 100644 --- a/types/tablet_v2/wlr_tablet_v2.c +++ b/types/tablet_v2/wlr_tablet_v2.c @@ -246,7 +246,6 @@ static void wlr_tablet_manager_v2_destroy(struct wl_resource *resource) { static void tablet_v2_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { struct wlr_tablet_manager_v2 *manager = data; - assert(wl_client && manager); struct wlr_tablet_manager_client_v2 *client = calloc(1, sizeof(*client)); if (client == NULL) { diff --git a/types/wlr_input_inhibitor.c b/types/wlr_input_inhibitor.c index 484e4c22..44a7f098 100644 --- a/types/wlr_input_inhibitor.c +++ b/types/wlr_input_inhibitor.c @@ -89,7 +89,6 @@ static void input_manager_resource_destroy(struct wl_resource *resource) { static void inhibit_manager_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { struct wlr_input_inhibit_manager *manager = data; - assert(wl_client && manager); struct wl_resource *wl_resource = wl_resource_create(wl_client, &zwlr_input_inhibit_manager_v1_interface, version, id); diff --git a/types/wlr_input_method_v2.c b/types/wlr_input_method_v2.c index d9f76bcf..0e6a18ba 100644 --- a/types/wlr_input_method_v2.c +++ b/types/wlr_input_method_v2.c @@ -571,7 +571,6 @@ static const struct zwp_input_method_manager_v2_interface static void input_method_manager_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { - assert(wl_client); struct wlr_input_method_manager_v2 *im_manager = data; struct wl_resource *bound_resource = wl_resource_create(wl_client, diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c index 1e83e3b7..0f680d87 100644 --- a/types/wlr_layer_shell_v1.c +++ b/types/wlr_layer_shell_v1.c @@ -461,7 +461,6 @@ static const struct zwlr_layer_shell_v1_interface layer_shell_implementation = { static void layer_shell_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { struct wlr_layer_shell_v1 *layer_shell = data; - assert(wl_client && layer_shell); struct wl_resource *resource = wl_resource_create( wl_client, &zwlr_layer_shell_v1_interface, version, id); diff --git a/types/wlr_pointer_constraints_v1.c b/types/wlr_pointer_constraints_v1.c index 1abbeed2..03aea9f5 100644 --- a/types/wlr_pointer_constraints_v1.c +++ b/types/wlr_pointer_constraints_v1.c @@ -276,7 +276,6 @@ static const struct zwp_pointer_constraints_v1_interface static void pointer_constraints_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wlr_pointer_constraints_v1 *pointer_constraints = data; - assert(client && pointer_constraints); struct wl_resource *resource = wl_resource_create(client, &zwp_pointer_constraints_v1_interface, version, id); diff --git a/types/wlr_server_decoration.c b/types/wlr_server_decoration.c index 049494eb..3d3d1ff3 100644 --- a/types/wlr_server_decoration.c +++ b/types/wlr_server_decoration.c @@ -144,7 +144,6 @@ static void server_decoration_manager_destroy_resource( static void server_decoration_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wlr_server_decoration_manager *manager = data; - assert(client && manager); struct wl_resource *resource = wl_resource_create(client, &org_kde_kwin_server_decoration_manager_interface, version, id); diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c index 6cfd1ef0..11944f26 100644 --- a/types/wlr_text_input_v3.c +++ b/types/wlr_text_input_v3.c @@ -294,7 +294,6 @@ static const struct zwp_text_input_manager_v3_interface static void text_input_manager_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { struct wlr_text_input_manager_v3 *manager = data; - assert(wl_client && manager); struct wl_resource *resource = wl_resource_create(wl_client, &zwp_text_input_manager_v3_interface, version, id); diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c index 2f39512e..33e99e33 100644 --- a/types/xdg_shell/wlr_xdg_shell.c +++ b/types/xdg_shell/wlr_xdg_shell.c @@ -93,7 +93,6 @@ static int xdg_client_ping_timeout(void *user_data) { static void xdg_shell_bind(struct wl_client *wl_client, void *data, uint32_t version, uint32_t id) { struct wlr_xdg_shell *xdg_shell = data; - assert(wl_client && xdg_shell); struct wlr_xdg_client *client = calloc(1, sizeof(*client)); if (client == NULL) {