mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix warnings
This commit is contained in:
parent
76f663d31c
commit
7c52aa6932
@ -367,19 +367,20 @@ static const uint8_t * lv_img_decoder_open(const void * src, const lv_style_t *
|
||||
return LV_IMG_DECODER_OPEN_FAIL;
|
||||
}
|
||||
|
||||
#if USE_LV_FILESYSTEM
|
||||
/*Open the file if it's a file*/
|
||||
if(decoder_src_type == LV_IMG_SRC_FILE) {
|
||||
#if USE_LV_FILESYSTEM
|
||||
lv_fs_res_t res = lv_fs_open(&decoder_file, src, LV_FS_MODE_RD);
|
||||
if(res != LV_FS_RES_OK) {
|
||||
LV_LOG_WARN("Built-in image decoder can't open the file");
|
||||
return LV_IMG_DECODER_OPEN_FAIL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
LV_LOG_WARN("Image built-in decoder can read file because USE_LV_FILESYSTEM = 0");
|
||||
return LV_IMG_DECODER_OPEN_FAIL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*Process the different color formats*/
|
||||
lv_img_cf_t cf = decoder_header.cf;
|
||||
@ -408,12 +409,17 @@ static const uint8_t * lv_img_decoder_open(const void * src, const lv_style_t *
|
||||
uint32_t palette_size = 1 << px_size;
|
||||
|
||||
if(decoder_src_type == LV_IMG_SRC_FILE) {
|
||||
/*Read the palette from file*/
|
||||
#if USE_LV_FILESYSTEM
|
||||
lv_fs_seek(&decoder_file, 4); /*Skip the header*/
|
||||
lv_fs_read(&decoder_file, palette_file, palette_size * sizeof(lv_color32_t), NULL);
|
||||
palette_p = palette_file;
|
||||
#else
|
||||
LV_LOG_WARN("Image built-in decoder can read the palette because USE_LV_FILESYSTEM = 0");
|
||||
return LV_IMG_DECODER_OPEN_FAIL;
|
||||
#endif
|
||||
} else {
|
||||
/*The palette begins in the beginning of the image data. Just point to it.*/
|
||||
palette_p = (lv_color32_t *)((lv_img_dsc_t *)decoder_src)->data;
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ lv_action_t lv_btn_get_action(const lv_obj_t * btn, lv_btn_action_t type)
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_in_time(const lv_obj_t * btn, uint16_t time)
|
||||
uint16_t lv_btn_get_ink_in_time(const lv_obj_t * btn)
|
||||
{
|
||||
#if USE_LV_ANIMATION && LV_BTN_INK_EFFECT
|
||||
lv_btn_ext_t * ext = lv_obj_get_ext_attr(btn);
|
||||
@ -362,7 +362,7 @@ uint16_t lv_btn_get_ink_in_time(const lv_obj_t * btn, uint16_t time)
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_wait_time(const lv_obj_t * btn, uint16_t time)
|
||||
uint16_t lv_btn_get_ink_wait_time(const lv_obj_t * btn)
|
||||
{
|
||||
#if USE_LV_ANIMATION && LV_BTN_INK_EFFECT
|
||||
lv_btn_ext_t * ext = lv_obj_get_ext_attr(btn);
|
||||
@ -376,7 +376,7 @@ uint16_t lv_btn_get_ink_wait_time(const lv_obj_t * btn, uint16_t time)
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_out_time(const lv_obj_t * btn, uint16_t time)
|
||||
uint16_t lv_btn_get_ink_out_time(const lv_obj_t * btn)
|
||||
{
|
||||
#if USE_LV_ANIMATION && LV_BTN_INK_EFFECT
|
||||
lv_btn_ext_t * ext = lv_obj_get_ext_attr(btn);
|
||||
@ -703,9 +703,9 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
|
||||
*/
|
||||
static void lv_btn_ink_effect_anim(lv_obj_t * btn, int32_t val)
|
||||
{
|
||||
if(ink_obj) {
|
||||
if(btn) {
|
||||
ink_act_value = val;
|
||||
lv_obj_invalidate(ink_obj);
|
||||
lv_obj_invalidate(btn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -715,6 +715,8 @@ static void lv_btn_ink_effect_anim(lv_obj_t * btn, int32_t val)
|
||||
*/
|
||||
static void lv_btn_ink_effect_anim_ready(void * p)
|
||||
{
|
||||
(void) p; /*Unused*/
|
||||
|
||||
lv_btn_ext_t * ext = lv_obj_get_ext_attr(ink_obj);
|
||||
lv_btn_state_t state = lv_btn_get_state(ink_obj);
|
||||
|
||||
|
@ -242,21 +242,21 @@ static inline bool lv_btn_get_ver_fit(const lv_obj_t * btn)
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_in_time(const lv_obj_t * btn, uint16_t time);
|
||||
uint16_t lv_btn_get_ink_in_time(const lv_obj_t * btn);
|
||||
|
||||
/**
|
||||
* Get the wait time before the ink disappears
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_wait_time(const lv_obj_t * btn, uint16_t time);
|
||||
uint16_t lv_btn_get_ink_wait_time(const lv_obj_t * btn);
|
||||
|
||||
/**
|
||||
* Get time of the ink out effect (animate to the releases state)
|
||||
* @param btn pointer to a button object
|
||||
* @return the time of the ink animation
|
||||
*/
|
||||
uint16_t lv_btn_get_ink_out_time(const lv_obj_t * btn, uint16_t time);
|
||||
uint16_t lv_btn_get_ink_out_time(const lv_obj_t * btn);
|
||||
|
||||
/**
|
||||
* Get style of a button.
|
||||
|
@ -349,7 +349,7 @@ uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar)
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to the array of day names
|
||||
*/
|
||||
const char ** lv_calendar_get_day_names(const lv_obj_t * calendar, const char ** day_names)
|
||||
const char ** lv_calendar_get_day_names(const lv_obj_t * calendar)
|
||||
{
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
return ext->day_names;
|
||||
@ -360,7 +360,7 @@ const char ** lv_calendar_get_day_names(const lv_obj_t * calendar, const char **
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to the array of month names
|
||||
*/
|
||||
const char ** lv_calendar_get_month_names(const lv_obj_t * calendar, const char ** day_names)
|
||||
const char ** lv_calendar_get_month_names(const lv_obj_t * calendar)
|
||||
{
|
||||
lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);
|
||||
return ext->month_names;
|
||||
|
@ -180,14 +180,14 @@ uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar);
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to the array of day names
|
||||
*/
|
||||
const char ** lv_calendar_get_day_names(const lv_obj_t * calendar, const char ** day_names);
|
||||
const char ** lv_calendar_get_day_names(const lv_obj_t * calendar);
|
||||
|
||||
/**
|
||||
* Get the name of the month
|
||||
* @param calendar pointer to a calendar object
|
||||
* @return pointer to the array of month names
|
||||
*/
|
||||
const char ** lv_calendar_get_month_names(const lv_obj_t * calendar, const char ** day_names);
|
||||
const char ** lv_calendar_get_month_names(const lv_obj_t * calendar);
|
||||
|
||||
/**
|
||||
* Get style of a calendar.
|
||||
|
@ -126,10 +126,10 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img)
|
||||
|
||||
#if LV_LOG_LEVEL >= LV_LOG_LEVEL_INFO
|
||||
switch(src_type) {
|
||||
case LV_IMG_SRC_FILE: LV_LOG_INFO("lv_img_set_src: `LV_IMG_SRC_FILE` type found"); break;
|
||||
case LV_IMG_SRC_VARIABLE: LV_LOG_INFO("lv_img_set_src: `LV_IMG_SRC_VARIABLE` type found"); break;
|
||||
case LV_IMG_SRC_SYMBOL: LV_LOG_INFO("lv_img_set_src: `LV_IMG_SRC_SYMBOL` type found"); break;
|
||||
default: LV_LOG_WARN("lv_img_set_src: unknown type");
|
||||
case LV_IMG_SRC_FILE: LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_FILE` type found"); break;
|
||||
case LV_IMG_SRC_VARIABLE: LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_VARIABLE` type found"); break;
|
||||
case LV_IMG_SRC_SYMBOL: LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_SYMBOL` type found"); break;
|
||||
default: LV_LOG_WARN("lv_img_set_src: unknown type");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -210,7 +210,7 @@ void lv_ta_add_char(lv_obj_t * ta, uint32_t c)
|
||||
|
||||
ext->pwd_tmp = lv_mem_realloc(ext->pwd_tmp, strlen(ext->pwd_tmp) + 2); /*+2: the new char + \0 */
|
||||
lv_mem_assert(ext->pwd_tmp);
|
||||
if(ext->pwd_tmp== NULL) return;
|
||||
if(ext->pwd_tmp == NULL) return;
|
||||
|
||||
lv_txt_ins(ext->pwd_tmp, ext->cursor.pos, (const char *)letter_buf);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user