aboutsummaryrefslogtreecommitdiff
path: root/py/objnamedtuple.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-03-25 19:35:08 +1100
committerDamien George <damien.p.george@gmail.com>2017-03-29 12:56:17 +1100
commit6213ad7f466df12c734dc527993bbb46c9d9eb5c (patch)
treef8a1c358820c211d5b6241e12c014628728408e0 /py/objnamedtuple.c
parentf7816188b701552036c9f3f2c6d1eb06462087d1 (diff)
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.
Diffstat (limited to 'py/objnamedtuple.c')
-rw-r--r--py/objnamedtuple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c
index 2371518b9..52468747b 100644
--- a/py/objnamedtuple.c
+++ b/py/objnamedtuple.c
@@ -158,7 +158,7 @@ STATIC mp_obj_t mp_obj_new_namedtuple_type(qstr name, size_t n_fields, mp_obj_t
STATIC mp_obj_t new_namedtuple_type(mp_obj_t name_in, mp_obj_t fields_in) {
qstr name = mp_obj_str_get_qstr(name_in);
- mp_uint_t n_fields;
+ size_t n_fields;
mp_obj_t *fields;
#if MICROPY_CPYTHON_COMPAT
if (MP_OBJ_IS_STR(fields_in)) {