mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user