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

fix warnings

This commit is contained in:
Gabor Kiss-Vamosi 2018-09-25 11:23:50 +02:00
parent 590ca9c7a6
commit 675715a917
4 changed files with 17 additions and 8 deletions

View File

@ -37,7 +37,9 @@ static const void * decoder_src;
static lv_img_src_t decoder_src_type;
static lv_img_header_t decoder_header;
static const lv_style_t * decoder_style;
#if USE_LV_FILESYSTEM
static lv_fs_file_t decoder_file;
#endif
#if LV_IMG_CF_INDEXED
static lv_color_t decoder_index_map[256];
#endif
@ -359,7 +361,6 @@ static const uint8_t * lv_img_decoder_open(const void * src, const lv_style_t *
lv_res_t header_res;
header_res = lv_img_dsc_get_info(src, &decoder_header);
if(header_res == LV_RES_INV) {
lv_fs_close(&decoder_file);
decoder_src = NULL;
decoder_src_type = LV_IMG_SRC_UNKNOWN;
LV_LOG_WARN("Built-in image decoder can't get the header info");
@ -398,7 +399,10 @@ static const uint8_t * lv_img_decoder_open(const void * src, const lv_style_t *
cf == LV_IMG_CF_INDEXED_8BIT) {
#if LV_IMG_CF_INDEXED
#if USE_LV_FILESYSTEM
lv_color32_t palette_file[256];
#endif
lv_color32_t * palette_p = NULL;
uint8_t px_size = lv_img_color_format_get_px_size(cf);
uint32_t palette_size = 1 << px_size;
@ -408,8 +412,6 @@ static const uint8_t * lv_img_decoder_open(const void * src, const lv_style_t *
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
palette_file[0] = 0; /*Just to solve warnings*/
#endif
} else {
palette_p = (lv_color32_t *)((lv_img_dsc_t *)decoder_src)->data;
@ -528,9 +530,11 @@ static void lv_img_decoder_close(void)
/*It was opened with built-in decoder*/
if(decoder_src) {
#if USE_LV_FILESYSTEM
if(decoder_src_type == LV_IMG_SRC_FILE) {
lv_fs_close(&decoder_file);
}
#endif
decoder_src_type = LV_IMG_SRC_UNKNOWN;
decoder_src = NULL;
}

View File

@ -225,7 +225,7 @@ static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, cons
#else
lv_point_t pattern[LINE_MAX_WIDTH];
#endif
int i = 0;
lv_coord_t i = 0;
/*Create a perpendicular pattern (a small line)*/
if(width != 0) {
@ -235,7 +235,7 @@ static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, cons
uint32_t width_sqr = width * width;
/* Run for a lot of times. Meanwhile the real width will be determined as well */
for(i = 0; i < (uint32_t)sizeof(pattern); i ++) {
for(i = 0; i < (lv_coord_t)sizeof(pattern); i ++) {
pattern[i].x = pattern_line.p_act.x;
pattern[i].y = pattern_line.p_act.y;

View File

@ -79,7 +79,8 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img);
*/
static inline void lv_img_set_file(lv_obj_t * img, const char * fn)
{
(void) img;
(void) fn;
}
/**
@ -107,7 +108,8 @@ static inline void lv_img_set_style(lv_obj_t *img, lv_style_t *style)
*/
static inline void lv_img_set_upscale(lv_obj_t * img, bool upcale)
{
(void) img;
(void) upcale;
}
/*=====================
@ -152,6 +154,7 @@ static inline lv_style_t* lv_img_get_style(const lv_obj_t *img)
*/
static inline bool lv_img_get_upscale(const lv_obj_t * img)
{
(void)img;
return false;
}

View File

@ -100,7 +100,8 @@ static inline void lv_line_set_style(lv_obj_t *line, lv_style_t *style)
*/
static inline void lv_line_set_upscale(lv_obj_t * line, bool upcale)
{
(void) line;
(void) upcale;
}
/*=====================
* Getter functions
@ -137,6 +138,7 @@ static inline lv_style_t* lv_line_get_style(const lv_obj_t *line)
*/
static inline bool lv_line_get_upscale(const lv_obj_t * line)
{
(void) line;
return false;
}