Fix: Ensure 31-bit shifts are unsigned. (#10128)
Shifting a signed 32-bit integer by 31 bits is undefined behaviour. A few more than necessary are switched to unsigned for consistentency.
This commit is contained in:
@@ -568,7 +568,7 @@ static inline void DrawCloseBox(const Rect &r, Colours colour)
|
||||
if (colour != COLOUR_WHITE) DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, FR_NONE);
|
||||
Dimension d = GetSpriteSize(SPR_CLOSEBOX);
|
||||
int s = UnScaleGUI(1); /* Offset to account for shadow of SPR_CLOSEBOX */
|
||||
DrawSprite(SPR_CLOSEBOX, (colour != COLOUR_WHITE ? TC_BLACK : TC_SILVER) | (1 << PALETTE_TEXT_RECOLOUR), CenterBounds(r.left, r.right, d.width - s), CenterBounds(r.top, r.bottom, d.height - s));
|
||||
DrawSprite(SPR_CLOSEBOX, (colour != COLOUR_WHITE ? TC_BLACK : TC_SILVER) | (1U << PALETTE_TEXT_RECOLOUR), CenterBounds(r.left, r.right, d.width - s), CenterBounds(r.top, r.bottom, d.height - s));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user