Skip to content

Commit

Permalink
chore: fix compile warnings (lvgl#6817)
Browse files Browse the repository at this point in the history
Signed-off-by: xuxingliang <[email protected]>
  • Loading branch information
XuNeo authored Sep 30, 2024
1 parent 0458acd commit 2601a26
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion demos/benchmark/lv_demo_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static void summary_create(void)
lv_table_set_cell_value(table, 0, 3, "Avg. time (render + flush)");

/* 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_MINOR,
LVGL_VERSION_PATCH,
Expand Down
2 changes: 1 addition & 1 deletion examples/event/lv_example_event_streak.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_indev_t * indev = lv_event_get_param(e);
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)
Expand Down
4 changes: 2 additions & 2 deletions examples/others/observer/lv_example_observer_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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 {
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");
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/porting/osal/lv_example_osal.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void increment_thread_entry(void * user_data)
lv_lock();
counter_label = lv_label_create(lv_scr_act());
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();

while(true) {
Expand All @@ -86,7 +86,7 @@ static void increment_thread_entry(void * user_data)
press_count += 1;

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();
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/core/lv_obj_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 int32_t property_name_compare(const void * ref, const void * element);
static int property_name_compare(const void * ref, const void * element);

/**********************
* STATIC VARIABLES
Expand Down Expand Up @@ -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);

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.num = 0;
return value;
Expand Down Expand Up @@ -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*/
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;
}

Expand Down Expand Up @@ -278,7 +278,7 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
break;
}
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;
}
}
Expand All @@ -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*/
}

LV_LOG_WARN("Unknown property id: 0x%08x", id);
LV_LOG_WARN("Unknown property id: 0x%08" LV_PRIx32, id);
return LV_RESULT_INVALID;
}

Expand Down
2 changes: 1 addition & 1 deletion src/misc/cache/lv_image_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void iter_inspect_cb(void * elem)
LV_UNUSED(entry);

/* 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) {
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,
Expand Down
2 changes: 1 addition & 1 deletion src/misc/cache/lv_image_header_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void iter_inspect_cb(void * elem)
LV_UNUSED(entry);

/* 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) {
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,
Expand Down

0 comments on commit 2601a26

Please sign in to comment.