Skip to content

Commit 254cfa6

Browse files
committed
py: Use uintptr_t instead of mp_uint_t in MP_TAGPTR_* macros.
1 parent 9f6976b commit 254cfa6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

py/bc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ const byte *mp_bytecode_print_str(const byte *ip);
9999
#define mp_bytecode_print_inst(code) mp_bytecode_print2(code, 1)
100100

101101
// Helper macros to access pointer with least significant bits holding flags
102-
#define MP_TAGPTR_PTR(x) ((void*)((mp_uint_t)(x) & ~((mp_uint_t)3)))
103-
#define MP_TAGPTR_TAG0(x) ((mp_uint_t)(x) & 1)
104-
#define MP_TAGPTR_TAG1(x) ((mp_uint_t)(x) & 2)
105-
#define MP_TAGPTR_MAKE(ptr, tag) ((void*)((mp_uint_t)(ptr) | (tag)))
102+
#define MP_TAGPTR_PTR(x) ((void*)((uintptr_t)(x) & ~((uintptr_t)3)))
103+
#define MP_TAGPTR_TAG0(x) ((uintptr_t)(x) & 1)
104+
#define MP_TAGPTR_TAG1(x) ((uintptr_t)(x) & 2)
105+
#define MP_TAGPTR_MAKE(ptr, tag) ((void*)((uintptr_t)(ptr) | (tag)))
106106

107107
#if MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE
108108

0 commit comments

Comments
 (0)