mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
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 <damien@micropython.org>
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user