mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-31 16:27:03 +08:00
fix(examples) resolve string formatting compiler warnings (#3654)
This commit is contained in:
@@ -31,7 +31,7 @@ void lv_example_gridnav_1(void)
|
||||
lv_group_remove_obj(obj); /*Not needed, we use the gridnav instead*/
|
||||
|
||||
lv_obj_t * label = lv_label_create(obj);
|
||||
lv_label_set_text_fmt(label, "%d", i);
|
||||
lv_label_set_text_fmt(label, "%"LV_PRIu32"", i);
|
||||
lv_obj_center(label);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ static bool get_imgfont_path(const lv_font_t * font, void * img_src,
|
||||
}
|
||||
else {
|
||||
char * path = (char *)img_src;
|
||||
snprintf(path, len, "%s/%04X.%s", "A:lvgl/examples/assets/emoji", unicode, "png");
|
||||
snprintf(path, len, "%s/%04"LV_PRIX32".%s", "A:lvgl/examples/assets/emoji", unicode, "png");
|
||||
path[len - 1] = '\0';
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ static void label_event_cb(lv_event_t * e)
|
||||
if(code == LV_EVENT_MSG_RECEIVED) {
|
||||
lv_msg_t * m = lv_event_get_msg(e);
|
||||
const int32_t * v = lv_msg_get_payload(m);
|
||||
lv_label_set_text_fmt(label, "%d %%", *v);
|
||||
lv_label_set_text_fmt(label, "%"LV_PRId32" %%", *v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user