From e332959262ea9a73ae53507fb5fea2aadd288604 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 19 Oct 2025 21:10:54 +0200 Subject: [PATCH] fix I_ReadScreen warning use uintptr to ensure same signdness, taken from srb2classic --- src/sdl/i_video.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index db017f4fa..ebf248e46 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -1340,11 +1340,12 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale) else { UINT8 * restrict source = vid.screens[0]; - INT32 w = vid.width/scale*scale, h = vid.height/scale*scale; + uintptr_t w = vid.width/scale*scale, h = vid.height/scale*scale; // size_t saves a lea + movsxd over INT32. mind your types! - for (size_t y = 0; y < h; y += scale) - for (size_t x = 0; x < w; x += scale) + // uintptr_t is even better since it's guaranteed to be the size of a pointer + for (uintptr_t y = 0; y < h; y += scale) + for (uintptr_t x = 0; x < w; x += scale) *scr++ = source[y*vid.width + x]; } }