summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/moductypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/moductypes.c')
-rw-r--r--extmod/moductypes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
index 00a69a275a..bf45797658 100644
--- a/extmod/moductypes.c
+++ b/extmod/moductypes.c
@@ -602,7 +602,7 @@ static mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
uint agg_type = GET_TYPE(offset, AGG_TYPE_BITS);
if (agg_type == PTR) {
byte *p = *(void **)self->addr;
- return mp_obj_new_int((mp_int_t)(uintptr_t)p);
+ return mp_obj_new_int_from_uint((uintptr_t)p);
}
}
MP_FALLTHROUGH
@@ -629,7 +629,7 @@ static mp_int_t uctypes_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo,
static mp_obj_t uctypes_struct_addressof(mp_obj_t buf) {
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ);
- return mp_obj_new_int((mp_int_t)(uintptr_t)bufinfo.buf);
+ return mp_obj_new_int_from_uint((uintptr_t)bufinfo.buf);
}
MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_addressof_obj, uctypes_struct_addressof);