Commit cbef0dba authored by Paul Sokolovsky's avatar Paul Sokolovsky

extmod/modwebsocket: Use mp_rom_map_elem_t and friends.

parent e0d49b7e
...@@ -280,13 +280,13 @@ STATIC mp_obj_t websocket_close(mp_obj_t self_in) { ...@@ -280,13 +280,13 @@ STATIC mp_obj_t websocket_close(mp_obj_t self_in) {
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(websocket_close_obj, websocket_close); STATIC MP_DEFINE_CONST_FUN_OBJ_1(websocket_close_obj, websocket_close);
STATIC const mp_map_elem_t websocket_locals_dict_table[] = { STATIC const mp_rom_map_elem_t websocket_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj }, { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_readline), (mp_obj_t)&mp_stream_unbuffered_readline_obj }, { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_write), (mp_obj_t)&mp_stream_write_obj }, { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ioctl), (mp_obj_t)&mp_stream_ioctl_obj }, { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&mp_stream_ioctl_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&websocket_close_obj }, { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&websocket_close_obj) },
}; };
STATIC MP_DEFINE_CONST_DICT(websocket_locals_dict, websocket_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(websocket_locals_dict, websocket_locals_dict_table);
...@@ -301,12 +301,12 @@ STATIC const mp_obj_type_t websocket_type = { ...@@ -301,12 +301,12 @@ STATIC const mp_obj_type_t websocket_type = {
.name = MP_QSTR_websocket, .name = MP_QSTR_websocket,
.make_new = websocket_make_new, .make_new = websocket_make_new,
.protocol = &websocket_stream_p, .protocol = &websocket_stream_p,
.locals_dict = (mp_obj_t)&websocket_locals_dict, .locals_dict = (void*)&websocket_locals_dict,
}; };
STATIC const mp_map_elem_t websocket_module_globals_table[] = { STATIC const mp_rom_map_elem_t websocket_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_websocket) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_websocket) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_websocket), (mp_obj_t)&websocket_type }, { MP_ROM_QSTR(MP_QSTR_websocket), MP_ROM_PTR(&websocket_type) },
}; };
STATIC MP_DEFINE_CONST_DICT(websocket_module_globals, websocket_module_globals_table); STATIC MP_DEFINE_CONST_DICT(websocket_module_globals, websocket_module_globals_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment