diff options
author | Damien George <damien.p.george@gmail.com> | 2016-03-14 22:40:39 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-03-14 22:40:39 +0000 |
commit | 2a1cca20b1e1a93c86c8c3a3254ab7150c85ac08 (patch) | |
tree | 1a651210327a64e9d236adc61134ffd9622b9bb7 /py/objnamedtuple.c | |
parent | e7cd1699df95d201369417b36cc4b65063d5c763 (diff) |
py: Fix passing of some wide int types to printf varg format list.
Passing an mp_uint_t to a %d printf format is incorrect for builds where
mp_uint_t is larger than word size (eg a nanboxing build). This patch
adds some simple casting to int in these cases.
Diffstat (limited to 'py/objnamedtuple.c')
-rw-r--r-- | py/objnamedtuple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 62289f50f..76dc9a1fc 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -79,7 +79,7 @@ STATIC void namedtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { const mp_obj_namedtuple_type_t *type = (const mp_obj_namedtuple_type_t*)type_in; - mp_uint_t num_fields = type->n_fields; + size_t num_fields = type->n_fields; if (n_args + n_kw != num_fields) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_arg_error_terse_mismatch(); |