[Mesa-dev] [PATCH] wayland-drm: update use of struct wl_resource to avoid deprecated struct definition

Pekka Paalanen ppaalanen at gmail.com
Wed Feb 8 13:42:38 UTC 2017


On Tue,  7 Feb 2017 17:29:53 -0500
Micah Fedke <micah.fedke at collabora.co.uk> wrote:

> Signed-off-by: Micah Fedke <micah.fedke at collabora.co.uk>
> ---
>  src/egl/wayland/wayland-drm/wayland-drm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c
> index 4fc12521d2..5c2bb0369e 100644
> --- a/src/egl/wayland/wayland-drm/wayland-drm.c
> +++ b/src/egl/wayland/wayland-drm/wayland-drm.c
> @@ -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,

Hi,

this looks good to me:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

It would also be good to add #define WL_HIDE_DEPRECATED to all
wayland-related .c files before #includes so that the compiler will
catch any attempts to use the deprecated definitions again.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170208/6a762c0f/attachment.sig>


More information about the mesa-dev mailing list