diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-09-08 11:59:07 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-10-11 00:18:05 +0000 |
commit | 65644c32b8062dd73b10e5f9092dfb833f469719 (patch) | |
tree | 484de882d23df09302ff279165e62d46e7b4c4b8 | |
parent | f12dd2436f2b70dc2fb8e29bee9dfaf907764ca0 (diff) |
dix: HashResourceID: use unsigned integers for bit shifting
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 <alan.coopersmith@oracle.com>
(cherry picked from commit 26a7ab09eae24fda6cbf51e03f974c7572e80e69)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1717>
-rw-r--r-- | dix/resource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/resource.c b/dix/resource.c index 055e6934e..28f2f2139 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -683,7 +683,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 |