diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/modffi.c | 11 | ||||
-rw-r--r-- | unix/modos.c | 11 | ||||
-rw-r--r-- | unix/modsocket.c | 11 | ||||
-rw-r--r-- | unix/modtermios.c | 11 | ||||
-rw-r--r-- | unix/modtime.c | 11 |
5 files changed, 5 insertions, 50 deletions
diff --git a/unix/modffi.c b/unix/modffi.c index 03b76e643b..331219a14b 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -433,16 +433,7 @@ STATIC const mp_map_elem_t mp_module_ffi_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_as_bytearray), (mp_obj_t)&mod_ffi_as_bytearray_obj }, }; -STATIC const mp_obj_dict_t mp_module_ffi_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = MP_ARRAY_SIZE(mp_module_ffi_globals_table), - .alloc = MP_ARRAY_SIZE(mp_module_ffi_globals_table), - .table = (mp_map_elem_t*)mp_module_ffi_globals_table, - }, -}; +STATIC MP_DEFINE_CONST_DICT(mp_module_ffi_globals, mp_module_ffi_globals_table); const mp_obj_module_t mp_module_ffi = { .base = { &mp_type_module }, diff --git a/unix/modos.c b/unix/modos.c index 90998bcffe..712c528b4d 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -70,16 +70,7 @@ STATIC const mp_map_elem_t mp_module_os_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_stat), (mp_obj_t)&mod_os_stat_obj }, }; -STATIC const mp_obj_dict_t mp_module_os_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = MP_ARRAY_SIZE(mp_module_os_globals_table), - .alloc = MP_ARRAY_SIZE(mp_module_os_globals_table), - .table = (mp_map_elem_t*)mp_module_os_globals_table, - }, -}; +STATIC MP_DEFINE_CONST_DICT(mp_module_os_globals, mp_module_os_globals_table); const mp_obj_module_t mp_module_os = { .base = { &mp_type_module }, diff --git a/unix/modsocket.c b/unix/modsocket.c index 82d833653f..749e58328e 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -453,16 +453,7 @@ STATIC const mp_map_elem_t mp_module_socket_globals_table[] = { #undef C }; -STATIC const mp_obj_dict_t mp_module_socket_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = MP_ARRAY_SIZE(mp_module_socket_globals_table), - .alloc = MP_ARRAY_SIZE(mp_module_socket_globals_table), - .table = (mp_map_elem_t*)mp_module_socket_globals_table, - }, -}; +STATIC MP_DEFINE_CONST_DICT(mp_module_socket_globals, mp_module_socket_globals_table); const mp_obj_module_t mp_module_socket = { .base = { &mp_type_module }, diff --git a/unix/modtermios.c b/unix/modtermios.c index f9884da903..0fa0e13947 100644 --- a/unix/modtermios.c +++ b/unix/modtermios.c @@ -137,16 +137,7 @@ STATIC const mp_map_elem_t mp_module_termios_globals_table[] = { #undef C }; -STATIC const mp_obj_dict_t mp_module_termios_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = MP_ARRAY_SIZE(mp_module_termios_globals_table), - .alloc = MP_ARRAY_SIZE(mp_module_termios_globals_table), - .table = (mp_map_elem_t*)mp_module_termios_globals_table, - }, -}; +STATIC MP_DEFINE_CONST_DICT(mp_module_termios_globals, mp_module_termios_globals_table); const mp_obj_module_t mp_module_termios = { .base = { &mp_type_module }, diff --git a/unix/modtime.c b/unix/modtime.c index 15352735c6..84f041fedf 100644 --- a/unix/modtime.c +++ b/unix/modtime.c @@ -108,16 +108,7 @@ STATIC const mp_map_elem_t mp_module_time_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mod_time_time_obj }, }; -STATIC const mp_obj_dict_t mp_module_time_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = MP_ARRAY_SIZE(mp_module_time_globals_table), - .alloc = MP_ARRAY_SIZE(mp_module_time_globals_table), - .table = (mp_map_elem_t*)mp_module_time_globals_table, - }, -}; +STATIC MP_DEFINE_CONST_DICT(mp_module_time_globals, mp_module_time_globals_table); const mp_obj_module_t mp_module_time = { .base = { &mp_type_module }, |