Add ARRAY_SIZE macro, and use it where possible.

This commit is contained in:
Damien George
2014-04-26 10:47:29 +01:00
parent d139c489ba
commit 6d3c5e4301
28 changed files with 63 additions and 59 deletions

View File

@@ -145,8 +145,8 @@ STATIC const mp_obj_dict_t mp_module_math_globals = {
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
.used = sizeof(mp_module_math_globals_table) / sizeof(mp_map_elem_t),
.alloc = sizeof(mp_module_math_globals_table) / sizeof(mp_map_elem_t),
.used = ARRAY_SIZE(mp_module_math_globals_table),
.alloc = ARRAY_SIZE(mp_module_math_globals_table),
.table = (mp_map_elem_t*)mp_module_math_globals_table,
},
};