fix warnings
This commit is contained in:
@@ -37,7 +37,9 @@ static const void * decoder_src;
|
|||||||
static lv_img_src_t decoder_src_type;
|
static lv_img_src_t decoder_src_type;
|
||||||
static lv_img_header_t decoder_header;
|
static lv_img_header_t decoder_header;
|
||||||
static const lv_style_t * decoder_style;
|
static const lv_style_t * decoder_style;
|
||||||
|
#if USE_LV_FILESYSTEM
|
||||||
static lv_fs_file_t decoder_file;
|
static lv_fs_file_t decoder_file;
|
||||||
|
#endif
|
||||||
#if LV_IMG_CF_INDEXED
|
#if LV_IMG_CF_INDEXED
|
||||||
static lv_color_t decoder_index_map[256];
|
static lv_color_t decoder_index_map[256];
|
||||||
#endif
|
#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;
|
lv_res_t header_res;
|
||||||
header_res = lv_img_dsc_get_info(src, &decoder_header);
|
header_res = lv_img_dsc_get_info(src, &decoder_header);
|
||||||
if(header_res == LV_RES_INV) {
|
if(header_res == LV_RES_INV) {
|
||||||
lv_fs_close(&decoder_file);
|
|
||||||
decoder_src = NULL;
|
decoder_src = NULL;
|
||||||
decoder_src_type = LV_IMG_SRC_UNKNOWN;
|
decoder_src_type = LV_IMG_SRC_UNKNOWN;
|
||||||
LV_LOG_WARN("Built-in image decoder can't get the header info");
|
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) {
|
cf == LV_IMG_CF_INDEXED_8BIT) {
|
||||||
|
|
||||||
#if LV_IMG_CF_INDEXED
|
#if LV_IMG_CF_INDEXED
|
||||||
|
#if USE_LV_FILESYSTEM
|
||||||
lv_color32_t palette_file[256];
|
lv_color32_t palette_file[256];
|
||||||
|
#endif
|
||||||
|
|
||||||
lv_color32_t * palette_p = NULL;
|
lv_color32_t * palette_p = NULL;
|
||||||
uint8_t px_size = lv_img_color_format_get_px_size(cf);
|
uint8_t px_size = lv_img_color_format_get_px_size(cf);
|
||||||
uint32_t palette_size = 1 << px_size;
|
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_seek(&decoder_file, 4); /*Skip the header*/
|
||||||
lv_fs_read(&decoder_file, palette_file, palette_size * sizeof(lv_color32_t), NULL);
|
lv_fs_read(&decoder_file, palette_file, palette_size * sizeof(lv_color32_t), NULL);
|
||||||
palette_p = palette_file;
|
palette_p = palette_file;
|
||||||
#else
|
|
||||||
palette_file[0] = 0; /*Just to solve warnings*/
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
palette_p = (lv_color32_t *)((lv_img_dsc_t *)decoder_src)->data;
|
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*/
|
/*It was opened with built-in decoder*/
|
||||||
if(decoder_src) {
|
if(decoder_src) {
|
||||||
|
#if USE_LV_FILESYSTEM
|
||||||
if(decoder_src_type == LV_IMG_SRC_FILE) {
|
if(decoder_src_type == LV_IMG_SRC_FILE) {
|
||||||
lv_fs_close(&decoder_file);
|
lv_fs_close(&decoder_file);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
decoder_src_type = LV_IMG_SRC_UNKNOWN;
|
decoder_src_type = LV_IMG_SRC_UNKNOWN;
|
||||||
decoder_src = NULL;
|
decoder_src = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, cons
|
|||||||
#else
|
#else
|
||||||
lv_point_t pattern[LINE_MAX_WIDTH];
|
lv_point_t pattern[LINE_MAX_WIDTH];
|
||||||
#endif
|
#endif
|
||||||
int i = 0;
|
lv_coord_t i = 0;
|
||||||
|
|
||||||
/*Create a perpendicular pattern (a small line)*/
|
/*Create a perpendicular pattern (a small line)*/
|
||||||
if(width != 0) {
|
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;
|
uint32_t width_sqr = width * width;
|
||||||
/* Run for a lot of times. Meanwhile the real width will be determined as well */
|
/* 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].x = pattern_line.p_act.x;
|
||||||
pattern[i].y = pattern_line.p_act.y;
|
pattern[i].y = pattern_line.p_act.y;
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
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)
|
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)
|
static inline bool lv_img_get_upscale(const lv_obj_t * img)
|
||||||
{
|
{
|
||||||
|
(void)img;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
static inline void lv_line_set_upscale(lv_obj_t * line, bool upcale)
|
||||||
{
|
{
|
||||||
|
(void) line;
|
||||||
|
(void) upcale;
|
||||||
}
|
}
|
||||||
/*=====================
|
/*=====================
|
||||||
* Getter functions
|
* 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)
|
static inline bool lv_line_get_upscale(const lv_obj_t * line)
|
||||||
{
|
{
|
||||||
|
(void) line;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user