mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Fixed warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
This commit is contained in:
@@ -1484,7 +1484,7 @@ static void StopDrawToBitmap(HDC hdc, HBITMAP *hhbm)
|
|||||||
static void DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize)
|
static void DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize)
|
||||||
{
|
{
|
||||||
/* The case of no pen (PenSize = 0) is automatically taken care of. */
|
/* The case of no pen (PenSize = 0) is automatically taken care of. */
|
||||||
const int penadjust = (int)SDL_floor(pensize / 2.0f - 0.5f);
|
const int penadjust = (int)SDL_floorf(pensize / 2.0f - 0.5f);
|
||||||
left += pensize / 2;
|
left += pensize / 2;
|
||||||
top += pensize / 2;
|
top += pensize / 2;
|
||||||
right -= penadjust;
|
right -= penadjust;
|
||||||
|
Reference in New Issue
Block a user