mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user