Commit 3671a3ee authored by Adam Jackson's avatar Adam Jackson 🥃

mi: Fix undefined shift in miSetVisualTypesAndMasks

The masks we end up building will occupy all 32 bits of an unsigned int,
which means we had better build the shifts out of unsigned ints, because
left-shifting a signed int all the way into the sign bit is undefined.
parent a41d45ee
......@@ -278,14 +278,14 @@ miCreateDefColormap(ScreenPtr pScreen)
#define _RZ(d) ((d + 2) / 3)
#define _RS(d) 0
#define _RM(d) ((1 << _RZ(d)) - 1)
#define _RM(d) ((1U << _RZ(d)) - 1)
#define _GZ(d) ((d - _RZ(d) + 1) / 2)
#define _GS(d) _RZ(d)
#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
#define _GM(d) (((1U << _GZ(d)) - 1) << _GS(d))
#define _BZ(d) (d - _RZ(d) - _GZ(d))
#define _BS(d) (_RZ(d) + _GZ(d))
#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
#define _CE(d) (1 << _RZ(d))
#define _BM(d) (((1U << _BZ(d)) - 1) << _BS(d))
#define _CE(d) (1U << _RZ(d))
typedef struct _miVisuals {
struct _miVisuals *next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment