From 45385994752c1ee30d115bd77165449e918b3daf Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 5 Dec 2025 16:03:51 +1100 Subject: [PATCH] py/emitinlinerv32: Change mask arg of is_in_signed_mask to uint32_t. Prior to this change mpy-cross would fail to build under Windows with: D:\a\micropython\micropython\py\emitinlinerv32.c(398,40): warning C4319: '~': zero extending 'unsigned int' to 'mp_uint_t' of greater size [D:\a\micropython\micropython\mpy-cross\mpy-cross.vcxproj] Signed-off-by: Damien George --- py/emitinlinerv32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py/emitinlinerv32.c b/py/emitinlinerv32.c index a5f4c49c29..e81b152087 100644 --- a/py/emitinlinerv32.c +++ b/py/emitinlinerv32.c @@ -390,9 +390,9 @@ static const opcode_t OPCODES[] = { // These two checks assume the bitmasks are contiguous. -static bool is_in_signed_mask(mp_uint_t mask, mp_uint_t value) { - mp_uint_t leading_zeroes = mp_clz(mask); - if (leading_zeroes == 0 || leading_zeroes > 32) { +static bool is_in_signed_mask(uint32_t mask, mp_uint_t value) { + uint32_t leading_zeroes = mp_clz(mask); + if (leading_zeroes == 0) { return true; } mp_uint_t positive_mask = ~(mask & ~(1U << (31 - leading_zeroes)));