summaryrefslogtreecommitdiff
path: root/aux
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
commit3f57cdc48e5c40fe62161627bfdae613a70ed1d1 (patch)
treebb957f41fecdee951e783330f1b2d3028d4c4a50 /aux
parenteb56963f11c5f3c4031a89e75cbef385c848b59e (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.
Diffstat (limited to 'aux')
-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;
}