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:
PeterN
2022-11-04 07:15:59 +00:00
committed by GitHub
parent accbfd502e
commit f24286a1ae
6 changed files with 92 additions and 92 deletions

View File

@@ -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));
}
/**