From 7baece69e9b6fee312648760f12831032c89200c Mon Sep 17 00:00:00 2001 From: 7dog123 Date: Mon, 18 Aug 2025 13:31:49 -0500 Subject: [PATCH] Use uintptr_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uintptr_t is part of the C standard (), so it works on all major platforms, including Linux, macOS, and Windows, for both 32-bit and 64-bit architectures. On 32-bit systems, uintptr_t is a 32-bit unsigned integer. On 64-bit systems, uintptr_t is a 64-bit unsigned integer. It’s specifically designed for storing pointer values as integers safely, so any pointer-to-integer or integer-to-pointer cast using uintptr_t is portable and safe, unlike using unsigned int, which can break on 64-bit systems. --- tools/romimg/src/romimg.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/romimg/src/romimg.h b/tools/romimg/src/romimg.h index ae4a4f7e4be..532cc3343f1 100644 --- a/tools/romimg/src/romimg.h +++ b/tools/romimg/src/romimg.h @@ -21,11 +21,10 @@ #define __ROMING_H__ #include "dprintf.h" -#if defined(_WIN32) || defined(WIN32) -#define RMIMG_PTRCAST unsigned int -#else -#define RMIMG_PTRCAST unsigned char * -#endif +#include // for uintptr_t + +#define RMIMG_PTRCAST uintptr_t + struct RomDirEntry { char name[10];