diff options
Diffstat (limited to 'extmod/moduasyncio.c')
-rw-r--r-- | extmod/moduasyncio.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c index 6e3603fa18..500d13c5b8 100644 --- a/extmod/moduasyncio.c +++ b/extmod/moduasyncio.c @@ -144,12 +144,13 @@ STATIC const mp_rom_map_elem_t task_queue_locals_dict_table[] = { }; STATIC MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_table); -STATIC const mp_obj_type_t task_queue_type = { - { &mp_type_type }, - .name = MP_QSTR_TaskQueue, - .make_new = task_queue_make_new, - .locals_dict = (mp_obj_dict_t *)&task_queue_locals_dict, -}; +STATIC MP_DEFINE_CONST_OBJ_TYPE( + task_queue_type, + MP_QSTR_TaskQueue, + MP_TYPE_FLAG_NONE, + task_queue_make_new, + locals_dict, (mp_obj_dict_t *)&task_queue_locals_dict + ); /******************************************************************************/ // Task class @@ -286,14 +287,15 @@ STATIC mp_obj_t task_iternext(mp_obj_t self_in) { return mp_const_none; } -STATIC const mp_obj_type_t task_type = { - { &mp_type_type }, - .name = MP_QSTR_Task, - .make_new = task_make_new, - .attr = task_attr, - .getiter = task_getiter, - .iternext = task_iternext, -}; +STATIC MP_DEFINE_CONST_OBJ_TYPE( + task_type, + MP_QSTR_Task, + MP_TYPE_FLAG_NONE, + task_make_new, + attr, task_attr, + getiter, task_getiter, + iternext, task_iternext + ); /******************************************************************************/ // C-level uasyncio module |