lib/utils/pyexec: Fix compilation warning of type vs format mismatch.

This happens with some compilers on some architectures, which don't define
size_t as unsigned int. MicroPython's printf() dooesn't support obscure
format specifiers for size_t, so the obvious choice is to explicitly cast
to unsigned, to match %u used in printf().
pull/2542/merge
Paul Sokolovsky 2016-10-26 13:45:03 +03:00
rodzic c38ea32810
commit 6832cbd69d
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -120,7 +120,9 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
{
size_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes;
qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes);
printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n "
"n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n",
(unsigned)n_pool, (unsigned)n_qstr, (unsigned)n_str_data_bytes, (unsigned)n_total_bytes);
}
#if MICROPY_ENABLE_GC