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
This commit is contained in:
parent
9365129a5a
commit
81ff082e0d
|
@ -1574,7 +1574,7 @@ _e_comp_wl_compositor_cb_bind(struct wl_client *client, void *data EINA_UNUSED,
|
||||||
|
|
||||||
if (!(res =
|
if (!(res =
|
||||||
wl_resource_create(client, &wl_compositor_interface,
|
wl_resource_create(client, &wl_compositor_interface,
|
||||||
MIN(version, COMPOSITOR_VERSION), id)))
|
version, id)))
|
||||||
{
|
{
|
||||||
ERR("Could not create compositor resource: %m");
|
ERR("Could not create compositor resource: %m");
|
||||||
wl_client_post_no_memory(client);
|
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 =
|
if (!(res =
|
||||||
wl_resource_create(client, &wl_subcompositor_interface,
|
wl_resource_create(client, &wl_subcompositor_interface,
|
||||||
MIN(version, 1), id)))
|
version, id)))
|
||||||
{
|
{
|
||||||
ERR("Could not create subcompositor resource: %m");
|
ERR("Could not create subcompositor resource: %m");
|
||||||
wl_client_post_no_memory(client);
|
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;
|
if (!(output = data)) return;
|
||||||
|
|
||||||
resource =
|
resource =
|
||||||
wl_resource_create(client, &wl_output_interface, MIN(version, 2), id);
|
wl_resource_create(client, &wl_output_interface, version, id);
|
||||||
if (!resource)
|
if (!resource)
|
||||||
{
|
{
|
||||||
wl_client_post_no_memory(client);
|
wl_client_post_no_memory(client);
|
||||||
|
|
|
@ -249,7 +249,7 @@ _e_comp_wl_input_cb_bind_seat(struct wl_client *client, void *data EINA_UNUSED,
|
||||||
{
|
{
|
||||||
struct wl_resource *res;
|
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)
|
if (!res)
|
||||||
{
|
{
|
||||||
ERR("Could not create seat resource: %m");
|
ERR("Could not create seat resource: %m");
|
||||||
|
|
|
@ -1323,7 +1323,7 @@ _e_shell_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t vers
|
||||||
{
|
{
|
||||||
struct wl_resource *res;
|
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);
|
wl_client_post_no_memory(client);
|
||||||
return;
|
return;
|
||||||
|
@ -1340,7 +1340,7 @@ _e_xdg_shell_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t
|
||||||
{
|
{
|
||||||
struct wl_resource *res;
|
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);
|
wl_client_post_no_memory(client);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue