summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-03-14 22:40:39 +0000
committerDamien George <damien.p.george@gmail.com>2016-03-14 22:40:39 +0000
commit2a1cca20b1e1a93c86c8c3a3254ab7150c85ac08 (patch)
tree1a651210327a64e9d236adc61134ffd9622b9bb7 /py/runtime.c
parente7cd1699df95d201369417b36cc4b65063d5c763 (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/runtime.c')
-rw-r--r--py/runtime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/runtime.c b/py/runtime.c
index e4a4d5b3f..adbab579f 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -788,7 +788,7 @@ too_short:
"wrong number of values to unpack"));
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
- "need more than %d values to unpack", seq_len));
+ "need more than %d values to unpack", (int)seq_len));
}
too_long:
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
@@ -796,7 +796,7 @@ too_long:
"wrong number of values to unpack"));
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
- "too many values to unpack (expected %d)", num));
+ "too many values to unpack (expected %d)", (int)num));
}
}
@@ -863,7 +863,7 @@ too_short:
"wrong number of values to unpack"));
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
- "need more than %d values to unpack", seq_len));
+ "need more than %d values to unpack", (int)seq_len));
}
}