From 4b86397f9c3ab6ac225cf365e7ecfc25687a5578 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 6 Aug 2024 22:36:39 -0230 Subject: [PATCH] Fix narrowing issue. --- src/emucore/CortexM0.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emucore/CortexM0.cxx b/src/emucore/CortexM0.cxx index 4916d19a8..2eb42417f 100644 --- a/src/emucore/CortexM0.cxx +++ b/src/emucore/CortexM0.cxx @@ -51,7 +51,7 @@ namespace { inline uInt32 READ32(const uInt8* data, uInt32 addr) { return (reinterpret_cast(data))[addr >> 2]; } - inline uInt16 READ16(const uInt8* data, uInt16 addr) { + inline uInt16 READ16(const uInt8* data, uInt32 addr) { return (reinterpret_cast(data))[addr >> 1]; } @@ -690,7 +690,7 @@ void CortexM0::recompileCodeRegions() if (!std::holds_alternative(region.access)) continue; - for (size_t i = 0; i < region.size; i += 2) + for (uInt32 i = 0; i < region.size; i += 2) std::get<1>(region.access).ops[i >> 1] = decodeInstructionWord(READ16(std::get<1>(region.access).backingStore, i)); }