mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +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:
@@ -65,7 +65,7 @@ STATIC void closure_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_
|
||||
mp_obj_closure_t *o = MP_OBJ_TO_PTR(o_in);
|
||||
mp_print_str(print, "<closure ");
|
||||
mp_obj_print_helper(print, o->fun, PRINT_REPR);
|
||||
mp_printf(print, " at %p, n_closed=%u ", o, o->n_closed);
|
||||
mp_printf(print, " at %p, n_closed=%u ", o, (int)o->n_closed);
|
||||
for (mp_uint_t i = 0; i < o->n_closed; i++) {
|
||||
if (o->closed[i] == MP_OBJ_NULL) {
|
||||
mp_print_str(print, "(nil)");
|
||||
|
||||
Reference in New Issue
Block a user