From 81ff082e0d762f3d16f5e2cafd2717456d30c872 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 26 Nov 2015 20:12:47 -0500 Subject: [PATCH] Stop using MIN macros when choosing versions for wayland resources Summary: libwayland-server.so will post an error if the requested version is higher than the supported one anyway, so there's no point in doing this. Using MIN() to pick versions is a client side idiom. #kansas Reviewers: zmike, devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3385 --- src/bin/e_comp_wl.c | 6 +++--- src/bin/e_comp_wl_input.c | 2 +- src/modules/wl_desktop_shell/e_mod_main.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 4c644b3fa..467072cde 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1574,7 +1574,7 @@ _e_comp_wl_compositor_cb_bind(struct wl_client *client, void *data EINA_UNUSED, if (!(res = wl_resource_create(client, &wl_compositor_interface, - MIN(version, COMPOSITOR_VERSION), id))) + version, id))) { ERR("Could not create compositor resource: %m"); wl_client_post_no_memory(client); @@ -2010,7 +2010,7 @@ _e_comp_wl_subcompositor_cb_bind(struct wl_client *client, void *data EINA_UNUSE if (!(res = wl_resource_create(client, &wl_subcompositor_interface, - MIN(version, 1), id))) + version, id))) { ERR("Could not create subcompositor resource: %m"); wl_client_post_no_memory(client); @@ -2426,7 +2426,7 @@ _e_comp_wl_cb_output_bind(struct wl_client *client, void *data, uint32_t version if (!(output = data)) return; resource = - wl_resource_create(client, &wl_output_interface, MIN(version, 2), id); + wl_resource_create(client, &wl_output_interface, version, id); if (!resource) { wl_client_post_no_memory(client); diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 7aa0dcd00..27934481c 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -249,7 +249,7 @@ _e_comp_wl_input_cb_bind_seat(struct wl_client *client, void *data EINA_UNUSED, { struct wl_resource *res; - res = wl_resource_create(client, &wl_seat_interface, MIN(version, 4), id); + res = wl_resource_create(client, &wl_seat_interface, version, id); if (!res) { ERR("Could not create seat resource: %m"); diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 040c427d6..c18abad48 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -1323,7 +1323,7 @@ _e_shell_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t vers { struct wl_resource *res; - if (!(res = wl_resource_create(client, &wl_shell_interface, MIN(version, 1), id))) + if (!(res = wl_resource_create(client, &wl_shell_interface, version, id))) { wl_client_post_no_memory(client); return; @@ -1340,7 +1340,7 @@ _e_xdg_shell_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t { struct wl_resource *res; - if (!(res = wl_resource_create(client, &xdg_shell_interface, MIN(version, 1), id))) + if (!(res = wl_resource_create(client, &xdg_shell_interface, version, id))) { wl_client_post_no_memory(client); return;