[PATCH xserver] xwayland: Fix compiler warning in GLAMOR Xv

Olivier Fourdan ofourdan at redhat.com
Fri Apr 15 09:01:11 UTC 2016


Hi all,

Gentle reminder, I sent this patch 2 weeks ago, could someone please review this fairly trivial fix for me?

Cheers,
Olivier

----- Original Message -----
> XvWindowMask is defined as 0x00020000 and cannot fit in the XvAdaptor
> type which is defined as an unsigned char, thus causing a compiler
> warning:
> 
>   xwayland-glamor-xv.c: In function ‘xwl_glamor_xv_add_adaptors’:
>   xwayland-glamor-xv.c:339:16: warning: large integer implicitly
>   truncated to unsigned type [-Woverflow]
> 
> This XvWindowMask value is actually not used for XvAdaptor itself but by
> the server in its xf86xv implementation, so we don't even need that mask
> in our xwayland-glamor-xv implementation.
> 
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> ---
>  hw/xwayland/xwayland-glamor-xv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xwayland/xwayland-glamor-xv.c
> b/hw/xwayland/xwayland-glamor-xv.c
> index c99418d..65f93c6 100644
> --- a/hw/xwayland/xwayland-glamor-xv.c
> +++ b/hw/xwayland/xwayland-glamor-xv.c
> @@ -336,7 +336,7 @@ xwl_glamor_xv_add_adaptors(ScreenPtr pScreen)
>  
>      pa = xnfcalloc(1, sizeof(XvAdaptorRec));
>      pa->pScreen = pScreen;
> -    pa->type = (unsigned int) (XvWindowMask | XvInputMask | XvImageMask);
> +    pa->type = (unsigned char) (XvInputMask | XvImageMask);
>      pa->ddStopVideo = xwl_glamor_xv_stop_video;
>      pa->ddPutImage = xwl_glamor_xv_put_image;
>      pa->ddSetPortAttribute = xwl_glamor_xv_set_port_attribute;
> --
> 2.5.5
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list