Skip to content

Commit

Permalink
Merge pull request #8039 from graeme-winter/uctypes-void-cast
Browse files Browse the repository at this point in the history
Additional cast through void*
  • Loading branch information
tannewt authored May 30, 2023
2 parents 62a663d + c1722ad commit 7d77f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_ob
}

} else if (agg_type == PTR) {
byte *p = *(void **)self->addr;
byte *p = *(void **)(void *)self->addr;
if (mp_obj_is_small_int(t->items[1])) {
uint val_type = GET_TYPE(MP_OBJ_SMALL_INT_VALUE(t->items[1]), VAL_TYPE_BITS);
return get_aligned(val_type, p, index);
Expand Down Expand Up @@ -574,7 +574,7 @@ STATIC mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
mp_int_t offset = MP_OBJ_SMALL_INT_VALUE(t->items[0]);
uint agg_type = GET_TYPE(offset, AGG_TYPE_BITS);
if (agg_type == PTR) {
byte *p = *(void **)self->addr;
byte *p = *(void **)(void *)self->addr;
return mp_obj_new_int((mp_int_t)(uintptr_t)p);
}
}
Expand Down

0 comments on commit 7d77f34

Please sign in to comment.