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.
This commit is contained in:
Kirill Primak 2023-10-10 20:04:22 +03:00
parent e519635cc2
commit 0de3659698
9 changed files with 0 additions and 9 deletions

View file

@ -177,7 +177,6 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
// `wlr_seat` can be NULL if the seat global is being destroyed // `wlr_seat` can be NULL if the seat global is being destroyed
struct wlr_seat *wlr_seat = _wlr_seat; struct wlr_seat *wlr_seat = _wlr_seat;
assert(client);
struct wl_resource *wl_resource = struct wl_resource *wl_resource =
wl_resource_create(client, &wl_seat_interface, version, id); wl_resource_create(client, &wl_seat_interface, version, id);

View file

@ -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, static void tablet_v2_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_tablet_manager_v2 *manager = data; struct wlr_tablet_manager_v2 *manager = data;
assert(wl_client && manager);
struct wlr_tablet_manager_client_v2 *client = calloc(1, sizeof(*client)); struct wlr_tablet_manager_client_v2 *client = calloc(1, sizeof(*client));
if (client == NULL) { if (client == NULL) {

View file

@ -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, static void inhibit_manager_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_input_inhibit_manager *manager = data; struct wlr_input_inhibit_manager *manager = data;
assert(wl_client && manager);
struct wl_resource *wl_resource = wl_resource_create(wl_client, struct wl_resource *wl_resource = wl_resource_create(wl_client,
&zwlr_input_inhibit_manager_v1_interface, version, id); &zwlr_input_inhibit_manager_v1_interface, version, id);

View file

@ -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, static void input_method_manager_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
assert(wl_client);
struct wlr_input_method_manager_v2 *im_manager = data; struct wlr_input_method_manager_v2 *im_manager = data;
struct wl_resource *bound_resource = wl_resource_create(wl_client, struct wl_resource *bound_resource = wl_resource_create(wl_client,

View file

@ -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, static void layer_shell_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_layer_shell_v1 *layer_shell = data; struct wlr_layer_shell_v1 *layer_shell = data;
assert(wl_client && layer_shell);
struct wl_resource *resource = wl_resource_create( struct wl_resource *resource = wl_resource_create(
wl_client, &zwlr_layer_shell_v1_interface, version, id); wl_client, &zwlr_layer_shell_v1_interface, version, id);

View file

@ -276,7 +276,6 @@ static const struct zwp_pointer_constraints_v1_interface
static void pointer_constraints_bind(struct wl_client *client, void *data, static void pointer_constraints_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_pointer_constraints_v1 *pointer_constraints = data; struct wlr_pointer_constraints_v1 *pointer_constraints = data;
assert(client && pointer_constraints);
struct wl_resource *resource = wl_resource_create(client, struct wl_resource *resource = wl_resource_create(client,
&zwp_pointer_constraints_v1_interface, version, id); &zwp_pointer_constraints_v1_interface, version, id);

View file

@ -144,7 +144,6 @@ static void server_decoration_manager_destroy_resource(
static void server_decoration_manager_bind(struct wl_client *client, void *data, static void server_decoration_manager_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_server_decoration_manager *manager = data; struct wlr_server_decoration_manager *manager = data;
assert(client && manager);
struct wl_resource *resource = wl_resource_create(client, struct wl_resource *resource = wl_resource_create(client,
&org_kde_kwin_server_decoration_manager_interface, version, id); &org_kde_kwin_server_decoration_manager_interface, version, id);

View file

@ -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, static void text_input_manager_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_text_input_manager_v3 *manager = data; struct wlr_text_input_manager_v3 *manager = data;
assert(wl_client && manager);
struct wl_resource *resource = wl_resource_create(wl_client, struct wl_resource *resource = wl_resource_create(wl_client,
&zwp_text_input_manager_v3_interface, version, id); &zwp_text_input_manager_v3_interface, version, id);

View file

@ -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, static void xdg_shell_bind(struct wl_client *wl_client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_xdg_shell *xdg_shell = data; struct wlr_xdg_shell *xdg_shell = data;
assert(wl_client && xdg_shell);
struct wlr_xdg_client *client = calloc(1, sizeof(*client)); struct wlr_xdg_client *client = calloc(1, sizeof(*client));
if (client == NULL) { if (client == NULL) {