summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-09-07 21:46:45 -0700
committerKeith Packard <keithp@keithp.com>2008-09-07 21:46:45 -0700
commit9d7c43c9fe91f3e4b408f2535993e498fb322862 (patch)
tree6bfbbc5380e4dd60a1e39094381803da6b009b06
parent308da05195844bddc171f048580f7bc291f1c358 (diff)
xcb_mask must not be zero when n == 32.
left shift of a 32-bit value by 32 is undefined, don't try to use it.
-rw-r--r--aux/xcb_bitops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/aux/xcb_bitops.h b/aux/xcb_bitops.h
index 48c3401..a6872a1 100644
--- a/aux/xcb_bitops.h
+++ b/aux/xcb_bitops.h
@@ -51,7 +51,7 @@
_X_INLINE static uint32_t
xcb_mask(uint32_t n)
{
- return (1 << n) - 1;
+ return n == 32 ? ~0 : (1 << n) - 1;
}