diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-14 14:38:38 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-09-19 19:06:01 +1000 |
commit | 662b9761b37b054f08fe2f7c00d0fce3a418d0b0 (patch) | |
tree | 3ab168faeb26685d511bf47caa21d2eabdd86c69 /py/modio.c | |
parent | cdb880789f61ee037cc7905ad75a7a9201d12ba5 (diff) | |
download | micropython-662b9761b37b054f08fe2f7c00d0fce3a418d0b0.tar.gz micropython-662b9761b37b054f08fe2f7c00d0fce3a418d0b0.zip |
all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.
In preparation for upcoming rework of mp_obj_type_t layout.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/modio.c')
-rw-r--r-- | py/modio.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/py/modio.c b/py/modio.c index d44c1948ab..093cb1f7e7 100644 --- a/py/modio.c +++ b/py/modio.c @@ -97,12 +97,13 @@ STATIC const mp_stream_p_t iobase_p = { .ioctl = iobase_ioctl, }; -STATIC const mp_obj_type_t mp_type_iobase = { - { &mp_type_type }, - .name = MP_QSTR_IOBase, - .make_new = iobase_make_new, - .protocol = &iobase_p, -}; +STATIC MP_DEFINE_CONST_OBJ_TYPE( + mp_type_iobase, + MP_QSTR_IOBase, + MP_TYPE_FLAG_NONE, + iobase_make_new, + protocol, &iobase_p + ); #endif // MICROPY_PY_IO_IOBASE @@ -191,13 +192,14 @@ STATIC const mp_stream_p_t bufwriter_stream_p = { .write = bufwriter_write, }; -STATIC const mp_obj_type_t mp_type_bufwriter = { - { &mp_type_type }, - .name = MP_QSTR_BufferedWriter, - .make_new = bufwriter_make_new, - .protocol = &bufwriter_stream_p, - .locals_dict = (mp_obj_dict_t *)&bufwriter_locals_dict, -}; +STATIC MP_DEFINE_CONST_OBJ_TYPE( + mp_type_bufwriter, + MP_QSTR_BufferedWriter, + MP_TYPE_FLAG_NONE, + bufwriter_make_new, + protocol, &bufwriter_stream_p, + locals_dict, (mp_obj_dict_t *)&bufwriter_locals_dict + ); #endif // MICROPY_PY_IO_BUFFEREDWRITER STATIC const mp_rom_map_elem_t mp_module_io_globals_table[] = { |