From 26a7ab09eae24fda6cbf51e03f974c7572e80e69 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Sep 2024 11:59:07 -0700 Subject: [PATCH] dix: HashResourceID: use unsigned integers for bit shifting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears warning from gcc 14.1: ../dix/resource.c: In function ‘HashResourceID’: ../dix/resource.c:691:44: warning: left shift of negative value [-Wshift-negative-value] 691 | return (id ^ (id >> numBits)) & ~((~0) << numBits); | ^~ Signed-off-by: Alan Coopersmith Part-of: --- dix/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/resource.c b/dix/resource.c index 356483bac..ffaf1d29d 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -688,7 +688,7 @@ HashResourceID(XID id, unsigned int numBits) id &= mask; if (numBits < 9) return (id ^ (id >> numBits) ^ (id >> (numBits<<1))) & ~((~0U) << numBits); - return (id ^ (id >> numBits)) & ~((~0) << numBits); + return (id ^ (id >> numBits)) & ~((~0U) << numBits); } static XID