fix(examples) resolve string formatting compiler warnings (#3654)

This commit is contained in:
Douglas Healy
2022-09-04 15:47:38 +02:00
committed by GitHub
parent bb4f4cecf9
commit 3b7411893f
6 changed files with 7 additions and 7 deletions
@@ -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';
}
+1 -1
View File
@@ -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);
}
}