8000 py/modio: BufferedWriter: Convert to mp_rom_map_elem_t. · lable/micropython@4564504 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4564504

committed
py/modio: BufferedWriter: Convert to mp_rom_map_elem_t.
1 parent f578947 commit 4564504

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py/modio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ STATIC mp_obj_t bufwriter_flush(mp_obj_t self_in) {
112112
}
113113
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bufwriter_flush_obj, bufwriter_flush);
114114

115-
STATIC const mp_map_elem_t bufwriter_locals_dict_table[] = {
116-
{ MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj },
117-
{ MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&bufwriter_flush_obj },
115+
STATIC const mp_rom_map_elem_t bufwriter_locals_dict_table[] = {
116+
{ MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
117+
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&bufwriter_flush_obj) },
118118
};
119119
STATIC MP_DEFINE_CONST_DICT(bufwriter_locals_dict, bufwriter_locals_dict_table);
120120

@@ -127,7 +127,7 @@ STATIC const mp_obj_type_t bufwriter_type = {
127127
.name = MP_QSTR_BufferedWriter,
128128
.make_new = bufwriter_make_new,
129129
.protocol = &bufwriter_stream_p,
130-
.locals_dict = (mp_obj_t)&bufwriter_locals_dict,
130+
.locals_dict = (mp_obj_dict_t*)&bufwriter_locals_dict,
131131
};
132132
#endif // MICROPY_PY_IO_BUFFEREDWRITER
133133

0 commit comments

Comments
 (0)
0