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.
This commit is contained in:
Adam Jackson 2019-10-15 13:01:27 -04:00
parent a41d45eedc
commit 3671a3ee88
1 changed files with 4 additions and 4 deletions

View File

@ -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;