Cleanup output format warnings (#904)

Use `PRIxxx` related macros to format the output strings so as to clear
compile warnings, e.g. PRIu32, PRId32, PRIX32, PRIX64 and so on.
And add the related macro definitions in platform_common.h if they
are not defined, as some compilers might not support them.
This commit is contained in:
Huang Qi
2021-12-20 15:51:36 +08:00
committed by GitHub
parent a41c1ad85c
commit 4cc4625a2b
9 changed files with 74 additions and 26 deletions

View File

@ -59,8 +59,8 @@ gc_init_with_pool(char *buf, gc_size_t buf_size)
gc_size_t heap_max_size;
if (buf_size < APP_HEAP_SIZE_MIN) {
os_printf("[GC_ERROR]heap init buf size (%u) < %u\n", buf_size,
APP_HEAP_SIZE_MIN);
os_printf("[GC_ERROR]heap init buf size (%" PRIu32 ") < %" PRIu32 "\n",
buf_size, (uint32)APP_HEAP_SIZE_MIN);
return NULL;
}
@ -93,7 +93,7 @@ gc_init_with_struct_and_pool(char *struct_buf, gc_size_t struct_buf_size,
}
if (struct_buf_size < sizeof(gc_handle_t)) {
os_printf("[GC_ERROR]heap init struct buf size (%u) < %zu\n",
os_printf("[GC_ERROR]heap init struct buf size (%" PRIu32 ") < %zu\n",
struct_buf_size, sizeof(gc_handle_t));
return NULL;
}
@ -104,8 +104,8 @@ gc_init_with_struct_and_pool(char *struct_buf, gc_size_t struct_buf_size,
}
if (pool_buf_size < APP_HEAP_SIZE_MIN) {
os_printf("[GC_ERROR]heap init buf size (%u) < %u\n", pool_buf_size,
APP_HEAP_SIZE_MIN);
os_printf("[GC_ERROR]heap init buf size (%" PRIu32 ") < %u\n",
pool_buf_size, APP_HEAP_SIZE_MIN);
return NULL;
}