From 1de64ade88e25c19f5693b73a1f73d6bbb919958 Mon Sep 17 00:00:00 2001 From: _VIFEXTech <1290176185@qq.com> Date: Wed, 17 Aug 2022 18:32:51 +0800 Subject: [PATCH] chore(demo/indev): fix warning (#3583) * chore(demo/indev): fix warning Signed-off-by: pengyiqiang * fix 'Micropython CI / Build rp2 port' warning Signed-off-by: pengyiqiang Co-authored-by: pengyiqiang --- demos/music/lv_demo_music.c | 2 +- src/core/lv_indev.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/demos/music/lv_demo_music.c b/demos/music/lv_demo_music.c index cb72ed162..5d3ccc703 100644 --- a/demos/music/lv_demo_music.c +++ b/demos/music/lv_demo_music.c @@ -225,7 +225,7 @@ static void auto_step_cb(lv_timer_t * t) lv_obj_t * num = lv_label_create(bg); lv_obj_set_style_text_font(num, font_large, 0); #if LV_USE_PERF_MONITOR - lv_label_set_text_fmt(num, "%d", lv_refr_get_fps_avg()); + lv_label_set_text_fmt(num, "%" LV_PRIu32, lv_refr_get_fps_avg()); #endif lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120); diff --git a/src/core/lv_indev.c b/src/core/lv_indev.c index c786f2a36..de0e97f20 100644 --- a/src/core/lv_indev.c +++ b/src/core/lv_indev.c @@ -356,16 +356,16 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data) /*Simple sanity check*/ if(data->point.x < 0) { - LV_LOG_WARN("X is %d which is smaller than zero", data->point.x); + LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x); } if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) { - LV_LOG_WARN("X is %d which is greater than hor. res", data->point.x); + LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x); } if(data->point.y < 0) { - LV_LOG_WARN("Y is %d which is smaller than zero", data->point.y); + LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y); } if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) { - LV_LOG_WARN("Y is %d which is greater than ver. res", data->point.y); + LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y); } /*Move the cursor if set and moved*/ @@ -779,10 +779,10 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) static lv_indev_state_t prev_state = LV_INDEV_STATE_RELEASED; if(prev_state != data->state) { if(data->state == LV_INDEV_STATE_PRESSED) { - LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, x, y); + LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, (int)x, (int)y); } else { - LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, x, y); + LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, (int)x, (int)y); } } @@ -816,7 +816,8 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) */ static void indev_proc_press(_lv_indev_proc_t * proc) { - LV_LOG_INFO("pressed at x:%d y:%d", proc->types.pointer.act_point.x, proc->types.pointer.act_point.y); + LV_LOG_INFO("pressed at x:%d y:%d", (int)proc->types.pointer.act_point.x, + (int)proc->types.pointer.act_point.y); indev_obj_act = proc->types.pointer.act_obj; if(proc->wait_until_release != 0) return;