From 6213ad7f466df12c734dc527993bbb46c9d9eb5c Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 25 Mar 2017 19:35:08 +1100 Subject: py: Convert mp_uint_t to size_t for tuple/list accessors. This patch changes mp_uint_t to size_t for the len argument of the following public facing C functions: mp_obj_tuple_get mp_obj_list_get mp_obj_get_array These functions take a pointer to the len argument (to be filled in by the function) and callers of these functions should update their code so the type of len is changed to size_t. For ports that don't use nan-boxing there should be no change in generate code because the size of the type remains the same (word sized), and in a lot of cases there won't even be a compiler warning if the type remains as mp_uint_t. The reason for this change is to standardise on the use of size_t for variables that count memory (or memory related) sizes/lengths. It helps builds that use nan-boxing. --- py/builtinimport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/builtinimport.c') diff --git a/py/builtinimport.c b/py/builtinimport.c index 17c1622ef1..8101d633fe 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -97,7 +97,7 @@ STATIC mp_import_stat_t stat_dir_or_file(vstr_t *path) { STATIC mp_import_stat_t find_file(const char *file_str, uint file_len, vstr_t *dest) { #if MICROPY_PY_SYS // extract the list of paths - mp_uint_t path_num; + size_t path_num; mp_obj_t *path_items; mp_obj_list_get(mp_sys_path, &path_num, &path_items); -- cgit v1.2.3