chore: fix compile warnings (#6817)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu
2024-09-30 20:58:57 +08:00
committed by GitHub
parent 0458acd998
commit 2601a26c7f
7 changed files with 13 additions and 13 deletions

View File

@@ -591,7 +591,7 @@ static void summary_create(void)
lv_table_set_cell_value(table, 0, 3, "Avg. time (render + flush)"); lv_table_set_cell_value(table, 0, 3, "Avg. time (render + flush)");
/* csv log */ /* csv log */
LV_LOG("Benchmark Summary (%"LV_PRIu32".%"LV_PRIu32".%"LV_PRIu32" %s)\r\n", LV_LOG("Benchmark Summary (%d.%d.%d %s)\r\n",
LVGL_VERSION_MAJOR, LVGL_VERSION_MAJOR,
LVGL_VERSION_MINOR, LVGL_VERSION_MINOR,
LVGL_VERSION_PATCH, LVGL_VERSION_PATCH,

View File

@@ -8,7 +8,7 @@ static void short_click_event_cb(lv_event_t * e)
lv_obj_t * info_label = lv_event_get_user_data(e); lv_obj_t * info_label = lv_event_get_user_data(e);
lv_indev_t * indev = lv_event_get_param(e); lv_indev_t * indev = lv_event_get_param(e);
uint8_t cnt = lv_indev_get_short_click_streak(indev); uint8_t cnt = lv_indev_get_short_click_streak(indev);
lv_label_set_text_fmt(info_label, "Short click streak: %"LV_PRIu32, cnt); lv_label_set_text_fmt(info_label, "Short click streak: %u", cnt);
} }
static void streak_event_cb(lv_event_t * e) static void streak_event_cb(lv_event_t * e)

View File

@@ -128,10 +128,10 @@ static void time_observer_cb(lv_observer_t * observer, lv_subject_t * subject)
lv_obj_t * label = lv_observer_get_target(observer); lv_obj_t * label = lv_observer_get_target(observer);
if(format == TIME_FORMAT_24) { if(format == TIME_FORMAT_24) {
lv_label_set_text_fmt(label, "%d:%02d", hour, minute); lv_label_set_text_fmt(label, "%" LV_PRId32 ":%02" LV_PRId32, hour, minute);
} }
else { else {
lv_label_set_text_fmt(label, "%d:%02d %s", hour + 1, minute, am_pm == TIME_AM ? "am" : "pm"); lv_label_set_text_fmt(label, "%"LV_PRId32":%02"LV_PRId32" %s", hour + 1, minute, am_pm == TIME_AM ? "am" : "pm");
} }
} }

View File

@@ -76,7 +76,7 @@ static void increment_thread_entry(void * user_data)
lv_lock(); lv_lock();
counter_label = lv_label_create(lv_scr_act()); counter_label = lv_label_create(lv_scr_act());
lv_obj_align(counter_label, LV_ALIGN_CENTER, 0, 0); lv_obj_align(counter_label, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text_fmt(counter_label, "Pressed %u times", press_count); lv_label_set_text_fmt(counter_label, "Pressed %" LV_PRIu32 " times", press_count);
lv_unlock(); lv_unlock();
while(true) { while(true) {
@@ -86,7 +86,7 @@ static void increment_thread_entry(void * user_data)
press_count += 1; press_count += 1;
lv_lock(); lv_lock();
lv_label_set_text_fmt(counter_label, "Pressed %u times", press_count); lv_label_set_text_fmt(counter_label, "Pressed %" LV_PRIu32 " times", press_count);
lv_unlock(); lv_unlock();
} }
} }

View File

@@ -44,7 +44,7 @@ typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_p
**********************/ **********************/
static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set); static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set);
static int32_t property_name_compare(const void * ref, const void * element); static int property_name_compare(const void * ref, const void * element);
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
@@ -121,7 +121,7 @@ lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_
uint32_t index = LV_PROPERTY_ID_INDEX(id); uint32_t index = LV_PROPERTY_ID_INDEX(id);
if(index == LV_PROPERTY_ID_INVALID || index >= LV_PROPERTY_ID_START) { if(index == LV_PROPERTY_ID_INVALID || index >= LV_PROPERTY_ID_START) {
LV_LOG_WARN("invalid style property id %d", id); LV_LOG_WARN("invalid style property id 0x%" LV_PRIx32, id);
value.id = LV_PROPERTY_ID_INVALID; value.id = LV_PROPERTY_ID_INVALID;
value.num = 0; value.num = 0;
return value; return value;
@@ -232,7 +232,7 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
/*id matched but we got null pointer to functions*/ /*id matched but we got null pointer to functions*/
if(set ? prop->setter == NULL : prop->getter == NULL) { if(set ? prop->setter == NULL : prop->getter == NULL) {
LV_LOG_WARN("NULL %s provided, id: %d", set ? "setter" : "getter", id); LV_LOG_WARN("NULL %s provided, id: 0x%" LV_PRIx32, set ? "setter" : "getter", id);
return LV_RESULT_INVALID; return LV_RESULT_INVALID;
} }
@@ -278,7 +278,7 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
break; break;
} }
default: { default: {
LV_LOG_WARN("Unknown property id: 0x%08x", prop->id); LV_LOG_WARN("Unknown property id: 0x%08" LV_PRIx32, prop->id);
return LV_RESULT_INVALID; return LV_RESULT_INVALID;
} }
} }
@@ -289,7 +289,7 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
/*If no setter found, try base class then*/ /*If no setter found, try base class then*/
} }
LV_LOG_WARN("Unknown property id: 0x%08x", id); LV_LOG_WARN("Unknown property id: 0x%08" LV_PRIx32, id);
return LV_RESULT_INVALID; return LV_RESULT_INVALID;
} }

View File

@@ -173,7 +173,7 @@ static void iter_inspect_cb(void * elem)
LV_UNUSED(entry); LV_UNUSED(entry);
/* size data_size cf rc type decoded src*/ /* size data_size cf rc type decoded src*/
#define IMAGE_CACHE_DUMP_FORMAT " %4dx%-4d %9d %d %d " #define IMAGE_CACHE_DUMP_FORMAT " %4dx%-4d %9"LV_PRIu32" %d %d "
switch(data->src_type) { switch(data->src_type) {
case LV_IMAGE_SRC_FILE: case LV_IMAGE_SRC_FILE:
LV_LOG_USER(IMAGE_CACHE_DUMP_FORMAT "file\t%-12p\t%s", header->w, header->h, decoded->data_size, header->cf, LV_LOG_USER(IMAGE_CACHE_DUMP_FORMAT "file\t%-12p\t%s", header->w, header->h, decoded->data_size, header->cf,

View File

@@ -161,7 +161,7 @@ static void iter_inspect_cb(void * elem)
LV_UNUSED(entry); LV_UNUSED(entry);
/* size data_size cf rc type decoded src*/ /* size data_size cf rc type decoded src*/
#define IMAGE_CACHE_DUMP_FORMAT " %4dx%-4d %9d %d %d " #define IMAGE_CACHE_DUMP_FORMAT " %4dx%-4d %9"LV_PRIu32" %d %d "
switch(data->src_type) { switch(data->src_type) {
case LV_IMAGE_SRC_FILE: case LV_IMAGE_SRC_FILE:
LV_LOG_USER(IMAGE_CACHE_DUMP_FORMAT "file\t%-12p\t%s", header->w, header->h, decoded->data_size, header->cf, LV_LOG_USER(IMAGE_CACHE_DUMP_FORMAT "file\t%-12p\t%s", header->w, header->h, decoded->data_size, header->cf,