summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-10-01 16:36:46 +1000
committerDamien George <damien.p.george@gmail.com>2018-10-01 16:36:46 +1000
commit69e7903904750948176fbc567fc2f3728d467bf2 (patch)
tree888fea5efb1919f96f4a2a2d18b59abca796ce51 /py/obj.h
parenta9237cee8252901265891cef39590292a9565591 (diff)
py/obj.h: Use uint64_t instead of mp_int_t in repr-D MP_OBJ_IS_x macros.
This follows how it's already done in MP_OBJ_IS_OBJ: the objects are considered 64-bit unsigned ints for the purpose of bitwise manipulation.
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/obj.h b/py/obj.h
index 0781ba5c5..1e37abca6 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -171,12 +171,12 @@ static inline bool MP_OBJ_IS_OBJ(mp_const_obj_t o)
#elif MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_D
static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
- { return ((((mp_int_t)(o)) & 0xffff000000000000) == 0x0001000000000000); }
+ { return ((((uint64_t)(o)) & 0xffff000000000000) == 0x0001000000000000); }
#define MP_OBJ_SMALL_INT_VALUE(o) (((mp_int_t)((o) << 16)) >> 17)
#define MP_OBJ_NEW_SMALL_INT(small_int) (((((uint64_t)(small_int)) & 0x7fffffffffff) << 1) | 0x0001000000000001)
static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
- { return ((((mp_int_t)(o)) & 0xffff000000000000) == 0x0002000000000000); }
+ { return ((((uint64_t)(o)) & 0xffff000000000000) == 0x0002000000000000); }
#define MP_OBJ_QSTR_VALUE(o) ((((uint32_t)(o)) >> 1) & 0xffffffff)
#define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 1) | 0x0002000000000001))