From 4b272083d6cf3d6e3661945963c81567b7ab9bee Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 10 Apr 2023 15:45:07 +0200 Subject: [PATCH] Berry fix solidify int type (#18378) --- lib/libesp32/berry/src/be_solidifylib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libesp32/berry/src/be_solidifylib.c b/lib/libesp32/berry/src/be_solidifylib.c index 58501e059..43d9107a3 100644 --- a/lib/libesp32/berry/src/be_solidifylib.c +++ b/lib/libesp32/berry/src/be_solidifylib.c @@ -19,6 +19,7 @@ #include #include #include +#include extern const bclass be_class_list; extern const bclass be_class_map; @@ -323,7 +324,7 @@ static void m_solidify_proto(bvm *vm, bbool str_literal, bproto *pr, const char for (int32_t i = 0; i < pr->nproto; i++) { size_t sub_len = strlen(func_name) + 10; char sub_name[sub_len]; - snprintf(sub_name, sizeof(sub_name), "%s_%d", func_name, i); + snprintf(sub_name, sizeof(sub_name), "%s_%"PRId32, func_name, i); m_solidify_proto(vm, str_literal, pr->ptab[i], sub_name, indent+2, fout); logfmt(",\n"); } @@ -361,7 +362,7 @@ static void m_solidify_proto(bvm *vm, bbool str_literal, bproto *pr, const char logfmt("%*s( &(const binstruction[%2d]) { /* code */\n", indent, "", pr->codesize); for (int pc = 0; pc < pr->codesize; pc++) { uint32_t ins = pr->code[pc]; - logfmt("%*s 0x%08X, //", indent, "", ins); + logfmt("%*s 0x%08"PRIX32", //", indent, "", ins); be_print_inst(ins, pc, fout); bopcode op = IGET_OP(ins); if (op == OP_GETGBL || op == OP_SETGBL) {