From 6d3c5e4301df363055dc256e6692c610e4d0b918 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 26 Apr 2014 10:47:29 +0100 Subject: Add ARRAY_SIZE macro, and use it where possible. --- py/builtintables.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'py/builtintables.c') diff --git a/py/builtintables.c b/py/builtintables.c index e6461ad80..ab60183c6 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -118,8 +118,8 @@ const mp_obj_dict_t mp_builtin_object_dict_obj = { .map = { .all_keys_are_qstrs = 1, .table_is_fixed_array = 1, - .used = sizeof(mp_builtin_object_table) / sizeof(mp_map_elem_t), - .alloc = sizeof(mp_builtin_object_table) / sizeof(mp_map_elem_t), + .used = ARRAY_SIZE(mp_builtin_object_table), + .alloc = ARRAY_SIZE(mp_builtin_object_table), .table = (mp_map_elem_t*)mp_builtin_object_table, }, }; @@ -158,8 +158,8 @@ const mp_obj_dict_t mp_builtin_module_dict_obj = { .map = { .all_keys_are_qstrs = 1, .table_is_fixed_array = 1, - .used = sizeof(mp_builtin_module_table) / sizeof(mp_map_elem_t), - .alloc = sizeof(mp_builtin_module_table) / sizeof(mp_map_elem_t), + .used = ARRAY_SIZE(mp_builtin_module_table), + .alloc = ARRAY_SIZE(mp_builtin_module_table), .table = (mp_map_elem_t*)mp_builtin_module_table, }, }; -- cgit v1.2.3