summaryrefslogtreecommitdiff
path: root/examples/natmod/uzlib/uzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/natmod/uzlib/uzlib.c')
-rw-r--r--examples/natmod/uzlib/uzlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/natmod/uzlib/uzlib.c b/examples/natmod/uzlib/uzlib.c
index 24ab15d6f..469452e8f 100644
--- a/examples/natmod/uzlib/uzlib.c
+++ b/examples/natmod/uzlib/uzlib.c
@@ -20,12 +20,12 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
decompio_type.base.type = mp_fun_table.type_type;
decompio_type.name = MP_QSTR_DecompIO;
- decompio_type.make_new = decompio_make_new;
- decompio_type.protocol = &decompio_stream_p;
+ decompio_type.make_new = &decompio_make_new;
+ MP_OBJ_TYPE_SET_SLOT(&decompio_type, protocol, &decompio_stream_p, 0);
decompio_locals_dict_table[0] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_OBJ_FROM_PTR(&mp_stream_read_obj) };
decompio_locals_dict_table[1] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_OBJ_FROM_PTR(&mp_stream_readinto_obj) };
decompio_locals_dict_table[2] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readline), MP_OBJ_FROM_PTR(&mp_stream_unbuffered_readline_obj) };
- decompio_type.locals_dict = (void*)&decompio_locals_dict;
+ MP_OBJ_TYPE_SET_SLOT(&decompio_type, locals_dict, (void*)&decompio_locals_dict, 1);
mp_store_global(MP_QSTR___name__, MP_OBJ_NEW_QSTR(MP_QSTR_uzlib));
mp_store_global(MP_QSTR_decompress, MP_OBJ_FROM_PTR(&mod_uzlib_decompress_obj));