[PATCH 8/9] dix: silence compiler warning comparing CARD32 to -1

Michel Dänzer michel at daenzer.net
Thu Oct 30 20:14:41 PDT 2014


On 31.10.2014 08:52, Peter Hutterer wrote:
> window.c:3246:36: warning: comparison of constant -1 with expression of type
> 'CARD32' (aka 'unsigned int') is always true
> [-Wtautological-constant-out-of-range-compare]
>      if (optional->backingBitPlanes != ~0L)
>              ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>   dix/window.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dix/window.c b/dix/window.c
> index d43ef03..9019852 100644
> --- a/dix/window.c
> +++ b/dix/window.c
> @@ -3243,7 +3243,7 @@ CheckWindowOptionalNeed(WindowPtr w)
>           return;
>       if (optional->userProps != NULL)
>           return;
> -    if (optional->backingBitPlanes != ~0L)
> +    if (optional->backingBitPlanes != (CARD32)~0L)

Just changing ~0L to ~0UL might work?


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer


More information about the xorg-devel mailing list