1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

chore(image): fix warning of unchecked return value (#4730)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu 2023-11-02 16:19:09 +08:00 committed by GitHub
parent 93885918d4
commit 3539083d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -242,10 +242,11 @@ static void obj_test_task_cb(lv_timer_t * tmr)
case 14:
obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_buttons, true);
lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_delete, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
lv_timer_set_repeat_count(msgbox_tmr, 1);
lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0);
{
lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_delete, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
lv_timer_set_repeat_count(msgbox_tmr, 1);
lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0);
}
break;
case 15:

View File

@ -151,7 +151,13 @@ void lv_image_set_src(lv_obj_t * obj, const void * src)
}
lv_image_header_t header;
lv_image_decoder_get_info(src, &header);
lv_result_t res = lv_image_decoder_get_info(src, &header);
if(res != LV_RESULT_OK) {
char buf[24];
LV_LOG_WARN("failed to get image info: %s",
src_type == LV_IMAGE_SRC_FILE ? (const char *)src : (lv_snprintf(buf, sizeof(buf), "%p", src), buf));
return;
}
/*Save the source*/
if(src_type == LV_IMAGE_SRC_VARIABLE) {