Stop using MIN macros when choosing versions for wayland resources
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 27 Nov 2015 01:12:47 +0000 (20:12 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 27 Nov 2015 01:12:47 +0000 (20:12 -0500)
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
src/bin/e_comp_wl_input.c
src/modules/wl_desktop_shell/e_mod_main.c

index 4c644b3..467072c 100644 (file)
@@ -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);
index 7aa0dcd..2793448 100644 (file)
@@ -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");
index 040c427..c18abad 100644 (file)
@@ -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;