wayland-drm: avoid deprecated use of struct wl_resource
authorMicah Fedke <micah.fedke@collabora.co.uk>
Tue, 7 Feb 2017 22:29:53 +0000 (17:29 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 Sep 2017 18:02:34 +0000 (19:02 +0100)
Wayland v1.2 with commit 1488c96a5db ("Add accessor functions for
wl_resource and deprecate wl_client_add_resource") paves the way towards
making wl_resource opaque.

Namely, new helpers were introduced and the struct was annotated as
deprecated.

Since wayland headers are normally installed in /usr/include, which is
in -isystem, GCC did not generate warnings as documented in the manual.
  "Warnings from system headers are normally suppressed..."

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[Emil Velikov: add commit message]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
src/egl/wayland/wayland-drm/wayland-drm.c

index fc33e4d8fc97c8ca2953cf60d6845eadb4214c48..2e256aea6d5d453396afa1f55c0eb12fbedc38b7 100644 (file)
@@ -55,7 +55,7 @@ struct wl_drm {
 static void
 destroy_buffer(struct wl_resource *resource)
 {
-       struct wl_drm_buffer *buffer = resource->data;
+       struct wl_drm_buffer *buffer = wl_resource_get_user_data(resource);
        struct wl_drm *drm = buffer->drm;
 
        drm->callbacks->release_buffer(drm->user_data, buffer);
@@ -77,7 +77,7 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,
               int32_t offset1, int32_t stride1,
               int32_t offset2, int32_t stride2)
 {
-       struct wl_drm *drm = resource->data;
+       struct wl_drm *drm = wl_resource_get_user_data(resource);
        struct wl_drm_buffer *buffer;
 
        buffer = calloc(1, sizeof *buffer);
@@ -187,7 +187,7 @@ static void
 drm_authenticate(struct wl_client *client,
                 struct wl_resource *resource, uint32_t id)
 {
-       struct wl_drm *drm = resource->data;
+       struct wl_drm *drm = wl_resource_get_user_data(resource);
 
        if (drm->callbacks->authenticate(drm->user_data, id) < 0)
                wl_resource_post_error(resource,