commit b91efe6

Michael Forney  ·  2019-12-30 06:11:59 +0000 UTC
parent ae759b3
Remove unnecessary version checks in global bind functions

libwayland-server already does these checks for us.
12 files changed,  +0, -35
+0, -3
 1@@ -776,9 +776,6 @@ bind_compositor(struct wl_client *client, void *data, uint32_t version, uint32_t
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 4)
 6-		version = 4;
 7-
 8 	resource = wl_resource_create(client, &wl_compositor_interface, version, id);
 9 	wl_resource_set_implementation(resource, &compositor_impl, NULL, NULL);
10 }
+0, -3
 1@@ -56,9 +56,6 @@ bind_data_device_manager(struct wl_client *client, void *data, uint32_t version,
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &wl_data_device_manager_interface, version, id);
 9 	wl_resource_set_implementation(resource, &data_device_manager_impl, NULL, NULL);
10 }
+0, -2
1@@ -183,8 +183,6 @@ bind_dmabuf(struct wl_client *client, void *data, uint32_t version, uint32_t id)
2 	struct wl_resource *resource;
3 	size_t i;
4 
5-	if (version > 3)
6-		version = 3;
7 	resource = wl_resource_create(client, &zwp_linux_dmabuf_v1_interface, version, id);
8 	if (!resource) {
9 		wl_client_post_no_memory(client);
+0, -3
 1@@ -239,9 +239,6 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 2)
 6-		version = 2;
 7-
 8 	resource = wl_resource_create(client, &wl_drm_interface, version, id);
 9 	wl_resource_set_implementation(resource, &drm_impl, NULL, NULL);
10 
+0, -3
 1@@ -20,9 +20,6 @@ bind_output(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 	struct wl_resource *resource;
 3 	uint32_t flags;
 4 
 5-	if (version > 2)
 6-		version = 2;
 7-
 8 	resource = wl_resource_create(client, &wl_output_interface, version, id);
 9 
10 	if (!resource) {
+0, -3
 1@@ -46,9 +46,6 @@ bind_panel_manager(struct wl_client *client, void *data, uint32_t version, uint3
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &swc_panel_manager_interface, version, id);
 9 	wl_resource_set_implementation(resource, &panel_manager_impl, NULL, NULL);
10 }
+0, -3
 1@@ -84,9 +84,6 @@ bind_screen(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 	struct screen *screen = data;
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &swc_screen_interface, version, id);
 9 
10 	if (!resource) {
+0, -3
 1@@ -153,9 +153,6 @@ bind_seat(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 	struct seat *seat = data;
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 4)
 6-		version = 4;
 7-
 8 	resource = wl_resource_create(client, &wl_seat_interface, version, id);
 9 	wl_resource_set_implementation(resource, &seat_impl, seat, &remove_resource);
10 	wl_list_insert(&seat->resources, wl_resource_get_link(resource));
+0, -3
 1@@ -48,9 +48,6 @@ bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &wl_shell_interface, version, id);
 9 	wl_resource_set_implementation(resource, &shell_implementation, NULL, NULL);
10 }
+0, -3
 1@@ -199,9 +199,6 @@ bind_shm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
 2 	struct swc_shm *shm = data;
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &wl_shm_interface, version, id);
 9 	wl_resource_set_implementation(resource, &shm_impl, shm, NULL);
10 
+0, -3
 1@@ -53,9 +53,6 @@ bind_subcompositor(struct wl_client *client, void *data, uint32_t version, uint3
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &wl_subcompositor_interface, version, id);
 9 	wl_resource_set_implementation(resource, &subcompositor_impl, NULL, NULL);
10 }
+0, -3
 1@@ -506,9 +506,6 @@ bind_wm_base(struct wl_client *client, void *data, uint32_t version, uint32_t id
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 1)
 6-		version = 1;
 7-
 8 	resource = wl_resource_create(client, &xdg_wm_base_interface, version, id);
 9 	if (!resource) {
10 		wl_client_post_no_memory(client);