Use MP_DEFINE_CONST_DICT macro to define module dicts.

This is just a clean-up of the code.  Generated code is exactly the
same.
This commit is contained in:
Damien George 2014-11-29 14:39:27 +00:00
parent e636279fe0
commit 3b603f29ec
32 changed files with 34 additions and 313 deletions

View File

@ -155,16 +155,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_sync), (mp_obj_t)&pyb_sync_obj },
};
STATIC const mp_obj_dict_t pyb_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(pyb_module_globals_table),
.alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
.table = (mp_map_elem_t*)pyb_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(pyb_module_globals, pyb_module_globals_table);
const mp_obj_module_t pyb_module = {
.base = { &mp_type_module },

View File

@ -68,16 +68,7 @@ STATIC const mp_map_elem_t mp_module_binascii_globals_table[] = {
// { MP_OBJ_NEW_QSTR(MP_QSTR_b2a_base64), (mp_obj_t)&mod_binascii_b2a_base64_obj },
};
STATIC const mp_obj_dict_t mp_module_binascii_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_binascii_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_binascii_globals_table),
.table = (mp_map_elem_t*)mp_module_binascii_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_binascii_globals, mp_module_binascii_globals_table);
const mp_obj_module_t mp_module_ubinascii = {
.base = { &mp_type_module },

View File

@ -649,16 +649,7 @@ STATIC const mp_map_elem_t mp_module_uctypes_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ARRAY), MP_OBJ_NEW_SMALL_INT(TYPE2SMALLINT(ARRAY, AGG_TYPE_BITS)) },
};
STATIC const mp_obj_dict_t mp_module_uctypes_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_uctypes_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_uctypes_globals_table),
.table = (mp_map_elem_t*)mp_module_uctypes_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_uctypes_globals, mp_module_uctypes_globals_table);
const mp_obj_module_t mp_module_uctypes = {
.base = { &mp_type_module },

View File

@ -105,16 +105,7 @@ STATIC const mp_map_elem_t mp_module_hashlib_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_sha256), (mp_obj_t)&sha256_type },
};
STATIC const mp_obj_dict_t mp_module_hashlib_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_hashlib_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_hashlib_globals_table),
.table = (mp_map_elem_t*)mp_module_hashlib_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_hashlib_globals, mp_module_hashlib_globals_table);
const mp_obj_module_t mp_module_uhashlib = {
.base = { &mp_type_module },

View File

@ -118,16 +118,7 @@ STATIC const mp_map_elem_t mp_module_uheapq_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_heapify), (mp_obj_t)&mod_uheapq_heapify_obj },
};
STATIC const mp_obj_dict_t mp_module_uheapq_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_uheapq_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_uheapq_globals_table),
.table = (mp_map_elem_t*)mp_module_uheapq_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_uheapq_globals, mp_module_uheapq_globals_table);
const mp_obj_module_t mp_module_uheapq = {
.base = { &mp_type_module },

View File

@ -259,16 +259,7 @@ STATIC const mp_map_elem_t mp_module_ujson_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_loads), (mp_obj_t)&mod_ujson_loads_obj },
};
STATIC const mp_obj_dict_t mp_module_ujson_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_ujson_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_ujson_globals_table),
.table = (mp_map_elem_t*)mp_module_ujson_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_ujson_globals, mp_module_ujson_globals_table);
const mp_obj_module_t mp_module_ujson = {
.base = { &mp_type_module },

View File

@ -221,16 +221,7 @@ STATIC const mp_map_elem_t mp_module_re_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG), MP_OBJ_NEW_SMALL_INT(FLAG_DEBUG) },
};
STATIC const mp_obj_dict_t mp_module_re_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_re_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_re_globals_table),
.table = (mp_map_elem_t*)mp_module_re_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_re_globals, mp_module_re_globals_table);
const mp_obj_module_t mp_module_ure = {
.base = { &mp_type_module },

View File

@ -87,16 +87,7 @@ STATIC const mp_map_elem_t mp_module_uzlib_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_decompress), (mp_obj_t)&mod_uzlib_decompress_obj },
};
STATIC const mp_obj_dict_t mp_module_uzlib_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_uzlib_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_uzlib_globals_table),
.table = (mp_map_elem_t*)mp_module_uzlib_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_uzlib_globals, mp_module_uzlib_globals_table);
const mp_obj_module_t mp_module_uzlib = {
.base = { &mp_type_module },

View File

@ -37,16 +37,7 @@ STATIC const mp_map_elem_t mp_module_array_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&mp_type_array },
};
STATIC const mp_obj_dict_t mp_module_array_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_array_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_array_globals_table),
.table = (mp_map_elem_t*)mp_module_array_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_array_globals, mp_module_array_globals_table);
const mp_obj_module_t mp_module_array = {
.base = { &mp_type_module },

View File

@ -162,16 +162,7 @@ STATIC const mp_map_elem_t mp_module_cmath_globals_table[] = {
//{ MP_OBJ_NEW_QSTR(MP_QSTR_isnan), (mp_obj_t)&mp_cmath_isnan_obj },
};
STATIC const mp_obj_dict_t mp_module_cmath_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_cmath_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_cmath_globals_table),
.table = (mp_map_elem_t*)mp_module_cmath_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_cmath_globals, mp_module_cmath_globals_table);
const mp_obj_module_t mp_module_cmath = {
.base = { &mp_type_module },

View File

@ -37,16 +37,7 @@ STATIC const mp_map_elem_t mp_module_collections_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_namedtuple), (mp_obj_t)&mp_namedtuple_obj },
};
STATIC const mp_obj_dict_t mp_module_collections_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_collections_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_collections_globals_table),
.table = (mp_map_elem_t*)mp_module_collections_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_collections_globals, mp_module_collections_globals_table);
const mp_obj_module_t mp_module_collections = {
.base = { &mp_type_module },

View File

@ -100,16 +100,7 @@ STATIC const mp_map_elem_t mp_module_gc_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_mem_alloc), (mp_obj_t)&gc_mem_alloc_obj },
};
STATIC const mp_obj_dict_t mp_module_gc_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_gc_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_gc_globals_table),
.table = (mp_map_elem_t*)mp_module_gc_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_gc_globals, mp_module_gc_globals_table);
const mp_obj_module_t mp_module_gc = {
.base = { &mp_type_module },

View File

@ -52,16 +52,7 @@ STATIC const mp_map_elem_t mp_module_io_globals_table[] = {
#endif
};
STATIC const mp_obj_dict_t mp_module_io_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_io_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_io_globals_table),
.table = (mp_map_elem_t*)mp_module_io_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_io_globals, mp_module_io_globals_table);
const mp_obj_module_t mp_module_io = {
.base = { &mp_type_module },

View File

@ -221,16 +221,7 @@ STATIC const mp_map_elem_t mp_module_math_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_lgamma), (mp_obj_t)&mp_math_lgamma_obj },
};
STATIC const mp_obj_dict_t mp_module_math_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_math_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_math_globals_table),
.table = (mp_map_elem_t*)mp_module_math_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_math_globals, mp_module_math_globals_table);
const mp_obj_module_t mp_module_math = {
.base = { &mp_type_module },

View File

@ -67,16 +67,7 @@ STATIC const mp_map_elem_t mp_module_micropython_globals_table[] = {
#endif
};
STATIC const mp_obj_dict_t mp_module_micropython_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_micropython_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_micropython_globals_table),
.table = (mp_map_elem_t*)mp_module_micropython_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_micropython_globals, mp_module_micropython_globals_table);
const mp_obj_module_t mp_module_micropython = {
.base = { &mp_type_module },

View File

@ -205,16 +205,7 @@ STATIC const mp_map_elem_t mp_module_struct_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_unpack), (mp_obj_t)&struct_unpack_obj },
};
STATIC const mp_obj_dict_t mp_module_struct_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_struct_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_struct_globals_table),
.table = (mp_map_elem_t*)mp_module_struct_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_struct_globals, mp_module_struct_globals_table);
const mp_obj_module_t mp_module_struct = {
.base = { &mp_type_module },

View File

@ -120,16 +120,7 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
#endif
};
STATIC const mp_obj_dict_t mp_module_sys_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_sys_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_sys_globals_table),
.table = (mp_map_elem_t*)mp_module_sys_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_sys_globals, mp_module_sys_globals_table);
const mp_obj_module_t mp_module_sys = {
.base = { &mp_type_module },

View File

@ -106,8 +106,8 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
.map = { \
.all_keys_are_qstrs = 1, \
.table_is_fixed_array = 1, \
.used = sizeof(table_name) / sizeof(mp_map_elem_t), \
.alloc = sizeof(table_name) / sizeof(mp_map_elem_t), \
.used = MP_ARRAY_SIZE(table_name), \
.alloc = MP_ARRAY_SIZE(table_name), \
.table = (mp_map_elem_t*)table_name, \
}, \
}

View File

@ -145,23 +145,14 @@ STATIC const mp_map_elem_t stm_%s_globals_table[] = {
print("""};
STATIC const mp_obj_dict_t stm_%s_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = sizeof(stm_%s_globals_table) / sizeof(mp_map_elem_t),
.alloc = sizeof(stm_%s_globals_table) / sizeof(mp_map_elem_t),
.table = (mp_map_elem_t*)stm_%s_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(stm_%s_globals, stm_%s_globals_table);
const mp_obj_module_t stm_%s_obj = {
.base = { &mp_type_module },
.name = MP_QSTR_%s,
.globals = (mp_obj_dict_t*)&stm_%s_globals,
};
""" % (mod_name_lower, mod_name_lower, mod_name_lower, mod_name_lower, mod_name_lower, mod_name_upper, mod_name_lower))
""" % (mod_name_lower, mod_name_lower, mod_name_lower, mod_name_upper, mod_name_lower))
def main():
cmd_parser = argparse.ArgumentParser(description='Extract ST constants from a C header file.')

View File

@ -79,16 +79,7 @@ STATIC const mp_map_elem_t mp_module_network_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_route), (mp_obj_t)&network_route_obj },
};
STATIC const mp_obj_dict_t mp_module_network_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_network_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_network_globals_table),
.table = (mp_map_elem_t*)mp_module_network_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_network_globals, mp_module_network_globals_table);
const mp_obj_module_t mp_module_network = {
.base = { &mp_type_module },

View File

@ -574,16 +574,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
#endif
};
STATIC const mp_obj_dict_t pyb_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(pyb_module_globals_table),
.alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
.table = (mp_map_elem_t*)pyb_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(pyb_module_globals, pyb_module_globals_table);
const mp_obj_module_t pyb_module = {
.base = { &mp_type_module },

View File

@ -126,16 +126,7 @@ STATIC const mp_map_elem_t stm_module_globals_table[] = {
#include "modstmconst.gen.c"
};
STATIC const mp_obj_dict_t stm_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(stm_module_globals_table),
.alloc = MP_ARRAY_SIZE(stm_module_globals_table),
.table = (mp_map_elem_t*)stm_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(stm_module_globals, stm_module_globals_table);
const mp_obj_module_t stm_module = {
.base = { &mp_type_module },

View File

@ -351,16 +351,7 @@ STATIC const mp_map_elem_t os_module_globals_table[] = {
#endif
};
STATIC const mp_obj_dict_t os_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(os_module_globals_table),
.alloc = MP_ARRAY_SIZE(os_module_globals_table),
.table = (mp_map_elem_t*)os_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(os_module_globals, os_module_globals_table);
const mp_obj_module_t mp_module_uos = {
.base = { &mp_type_module },

View File

@ -292,16 +292,7 @@ STATIC const mp_map_elem_t mp_module_select_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_poll), (mp_obj_t)&mp_select_poll_obj },
};
STATIC const mp_obj_dict_t mp_module_select_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_select_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_select_globals_table),
.table = (mp_map_elem_t*)mp_module_select_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_select_globals, mp_module_select_globals_table);
const mp_obj_module_t mp_module_uselect = {
.base = { &mp_type_module },

View File

@ -133,16 +133,7 @@ STATIC const mp_map_elem_t mp_module_usocket_globals_table[] = {
*/
};
STATIC const mp_obj_dict_t mp_module_usocket_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(mp_module_usocket_globals_table),
.alloc = MP_ARRAY_SIZE(mp_module_usocket_globals_table),
.table = (mp_map_elem_t*)mp_module_usocket_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(mp_module_usocket_globals, mp_module_usocket_globals_table);
const mp_obj_module_t mp_module_usocket = {
.base = { &mp_type_module },

View File

@ -344,16 +344,7 @@ STATIC const mp_map_elem_t time_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_time_obj },
};
STATIC const mp_obj_dict_t time_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(time_module_globals_table),
.alloc = MP_ARRAY_SIZE(time_module_globals_table),
.table = (mp_map_elem_t*)time_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
const mp_obj_module_t mp_module_utime = {
.base = { &mp_type_module },

View File

@ -354,16 +354,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
//#endif
};
STATIC const mp_obj_dict_t pyb_module_globals = {
.base = {&mp_type_dict},
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = MP_ARRAY_SIZE(pyb_module_globals_table),
.alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
.table = (mp_map_elem_t*)pyb_module_globals_table,
},
};
STATIC MP_DEFINE_CONST_DICT(pyb_module_globals, pyb_module_globals_table);
const mp_obj_module_t pyb_module = {
.base = { &mp_type_module },

View File

@ -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 },

View File

@ -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 },

View File

@ -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 },

View File

@ -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 },

View File

@ -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 },