Skip to content

Commit 7d77f34

Browse files
authored
Merge pull request #8039 from graeme-winter/uctypes-void-cast
Additional cast through void*
2 parents 62a663d + c1722ad commit 7d77f34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extmod/moductypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_ob
544544
}
545545

546546
} else if (agg_type == PTR) {
547-
byte *p = *(void **)self->addr;
547+
byte *p = *(void **)(void *)self->addr;
548548
if (mp_obj_is_small_int(t->items[1])) {
549549
uint val_type = GET_TYPE(MP_OBJ_SMALL_INT_VALUE(t->items[1]), VAL_TYPE_BITS);
550550
return get_aligned(val_type, p, index);
@@ -574,7 +574,7 @@ STATIC mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
574574
mp_int_t offset = MP_OBJ_SMALL_INT_VALUE(t->items[0]);
575575
uint agg_type = GET_TYPE(offset, AGG_TYPE_BITS);
576576
if (agg_type == PTR) {
577-
byte *p = *(void **)self->addr;
577+
byte *p = *(void **)(void *)self->addr;
578578
return mp_obj_new_int((mp_int_t)(uintptr_t)p);
579579
}
580580
}

0 commit comments

Comments
 (0)