summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-11-26 20:12:47 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-26 20:12:47 -0500
commit81ff082e0d762f3d16f5e2cafd2717456d30c872 (patch)
tree25c3ae08678e9762c5f32eba62381bb92eb3945f
parent9365129a5aa464e31ca308a59fe59d8d26bb658a (diff)
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
-rw-r--r--src/bin/e_comp_wl.c6
-rw-r--r--src/bin/e_comp_wl_input.c2
-rw-r--r--src/modules/wl_desktop_shell/e_mod_main.c4
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,
1574 1574
1575 if (!(res = 1575 if (!(res =
1576 wl_resource_create(client, &wl_compositor_interface, 1576 wl_resource_create(client, &wl_compositor_interface,
1577 MIN(version, COMPOSITOR_VERSION), id))) 1577 version, id)))
1578 { 1578 {
1579 ERR("Could not create compositor resource: %m"); 1579 ERR("Could not create compositor resource: %m");
1580 wl_client_post_no_memory(client); 1580 wl_client_post_no_memory(client);
@@ -2010,7 +2010,7 @@ _e_comp_wl_subcompositor_cb_bind(struct wl_client *client, void *data EINA_UNUSE
2010 2010
2011 if (!(res = 2011 if (!(res =
2012 wl_resource_create(client, &wl_subcompositor_interface, 2012 wl_resource_create(client, &wl_subcompositor_interface,
2013 MIN(version, 1), id))) 2013 version, id)))
2014 { 2014 {
2015 ERR("Could not create subcompositor resource: %m"); 2015 ERR("Could not create subcompositor resource: %m");
2016 wl_client_post_no_memory(client); 2016 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
2426 if (!(output = data)) return; 2426 if (!(output = data)) return;
2427 2427
2428 resource = 2428 resource =
2429 wl_resource_create(client, &wl_output_interface, MIN(version, 2), id); 2429 wl_resource_create(client, &wl_output_interface, version, id);
2430 if (!resource) 2430 if (!resource)
2431 { 2431 {
2432 wl_client_post_no_memory(client); 2432 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,
249{ 249{
250 struct wl_resource *res; 250 struct wl_resource *res;
251 251
252 res = wl_resource_create(client, &wl_seat_interface, MIN(version, 4), id); 252 res = wl_resource_create(client, &wl_seat_interface, version, id);
253 if (!res) 253 if (!res)
254 { 254 {
255 ERR("Could not create seat resource: %m"); 255 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
1323{ 1323{
1324 struct wl_resource *res; 1324 struct wl_resource *res;
1325 1325
1326 if (!(res = wl_resource_create(client, &wl_shell_interface, MIN(version, 1), id))) 1326 if (!(res = wl_resource_create(client, &wl_shell_interface, version, id)))
1327 { 1327 {
1328 wl_client_post_no_memory(client); 1328 wl_client_post_no_memory(client);
1329 return; 1329 return;
@@ -1340,7 +1340,7 @@ _e_xdg_shell_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t
1340{ 1340{
1341 struct wl_resource *res; 1341 struct wl_resource *res;
1342 1342
1343 if (!(res = wl_resource_create(client, &xdg_shell_interface, MIN(version, 1), id))) 1343 if (!(res = wl_resource_create(client, &xdg_shell_interface, version, id)))
1344 { 1344 {
1345 wl_client_post_no_memory(client); 1345 wl_client_post_no_memory(client);
1346 return; 1346 return;