summaryrefslogtreecommitdiff
path: root/py/objattrtuple.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objattrtuple.c')
-rw-r--r--py/objattrtuple.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/py/objattrtuple.c b/py/objattrtuple.c
index 04c17a2c6..c6dd3aeac 100644
--- a/py/objattrtuple.c
+++ b/py/objattrtuple.c
@@ -50,17 +50,17 @@ void mp_obj_attrtuple_print_helper(const mp_print_t *print, const qstr *fields,
STATIC void mp_obj_attrtuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
(void)kind;
- mp_obj_tuple_t *o = o_in;
- const qstr *fields = (const qstr*)o->items[o->len];
+ mp_obj_tuple_t *o = MP_OBJ_TO_PTR(o_in);
+ const qstr *fields = (const qstr*)MP_OBJ_TO_PTR(o->items[o->len]);
mp_obj_attrtuple_print_helper(print, fields, o);
}
STATIC void mp_obj_attrtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
if (dest[0] == MP_OBJ_NULL) {
// load attribute
- mp_obj_tuple_t *self = self_in;
+ mp_obj_tuple_t *self = MP_OBJ_TO_PTR(self_in);
mp_uint_t len = self->len;
- const qstr *fields = (const qstr*)self->items[len];
+ const qstr *fields = (const qstr*)MP_OBJ_TO_PTR(self->items[len]);
for (mp_uint_t i = 0; i < len; i++) {
if (fields[i] == attr) {
dest[0] = self->items[i];
@@ -77,8 +77,8 @@ mp_obj_t mp_obj_new_attrtuple(const qstr *fields, mp_uint_t n, const mp_obj_t *i
for (mp_uint_t i = 0; i < n; i++) {
o->items[i] = items[i];
}
- o->items[n] = (void*)fields;
- return o;
+ o->items[n] = MP_OBJ_FROM_PTR(fields);
+ return MP_OBJ_FROM_PTR(o);
}
const mp_obj_type_t mp_type_attrtuple = {