fix warnings
This commit is contained in:
@@ -284,8 +284,8 @@ static void lv_refr_area_no_vdb(const lv_area_t * area_p)
|
|||||||
lv_refr_obj_and_children(top_p, area_p);
|
lv_refr_obj_and_children(top_p, area_p);
|
||||||
|
|
||||||
/*Also refresh top and sys layer unconditionally*/
|
/*Also refresh top and sys layer unconditionally*/
|
||||||
lv_refr_obj_and_children(lv_layer_top(), &start_mask);
|
lv_refr_obj_and_children(lv_layer_top(), area_p);
|
||||||
lv_refr_obj_and_children(lv_layer_sys(), &start_mask);
|
lv_refr_obj_and_children(lv_layer_sys(), area_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -34,17 +34,17 @@
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#if LV_VDB_SIZE != 0
|
#if LV_VDB_SIZE != 0
|
||||||
const void (*px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_vpx;
|
void (*const px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_vpx;
|
||||||
const void (*fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_vfill;
|
void (*const fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_vfill;
|
||||||
const void (*letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa) = lv_vletter;
|
void (*const letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa) = lv_vletter;
|
||||||
const void (*map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
void (*const map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||||
lv_color_t recolor, lv_opa_t recolor_opa) = lv_vmap;
|
lv_color_t recolor, lv_opa_t recolor_opa) = lv_vmap;
|
||||||
#else
|
#else
|
||||||
const void (*px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_rpx;
|
void (*const px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_rpx;
|
||||||
const void (*fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_rfill;
|
void (*const fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa) = lv_rfill;
|
||||||
const void (*letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa) = lv_rletter;
|
void (*const letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa) = lv_rletter;
|
||||||
const void (*map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
void (*const map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||||
lv_color_t recolor, lv_opa_t recolor_opa) = lv_rmap;
|
lv_color_t recolor, lv_opa_t recolor_opa) = lv_rmap;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ void lv_draw_aa_hor_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_
|
|||||||
/**********************
|
/**********************
|
||||||
* GLOBAL VARIABLES
|
* GLOBAL VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
extern const void (*px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
|
extern void (*const px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
|
||||||
extern const void (*fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
|
extern void (*const fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
|
||||||
extern const void (*letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa);
|
extern void (*const letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa);
|
||||||
extern const void (*map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
extern void (*const map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||||
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
|
||||||
lv_color_t recolor, lv_opa_t recolor_opa);
|
lv_color_t recolor, lv_opa_t recolor_opa);
|
||||||
|
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ lv_img_src_t lv_img_src_get_type(const void * src)
|
|||||||
return LV_IMG_SRC_VARIABLE; /*`lv_img_dsc_t` is design to the first byte < 0x20*/
|
return LV_IMG_SRC_VARIABLE; /*`lv_img_dsc_t` is design to the first byte < 0x20*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_LOG_WARN("lv_img_src_get_type: unknown image type");
|
||||||
return LV_IMG_SRC_UNKNOWN;
|
return LV_IMG_SRC_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_draw_label.h"
|
#include "lv_draw_label.h"
|
||||||
|
#include "lv_draw_rbasic.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
|
|||||||
@@ -182,11 +182,7 @@ static void line_draw_ver(line_draw_t * line, const lv_area_t * mask, const lv_s
|
|||||||
|
|
||||||
static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, const lv_style_t * style, lv_opa_t opa_scale)
|
static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, const lv_style_t * style, lv_opa_t opa_scale)
|
||||||
{
|
{
|
||||||
lv_coord_t width;
|
|
||||||
width = style->line.width;
|
|
||||||
#if LV_ANTIALIAS
|
|
||||||
lv_coord_t width_safe = width; /*`width_safe` is always >=1*/
|
|
||||||
#endif
|
|
||||||
lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->line.opa : (uint16_t)((uint16_t) style->line.opa * opa_scale) >> 8;
|
lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->line.opa : (uint16_t)((uint16_t) style->line.opa * opa_scale) >> 8;
|
||||||
|
|
||||||
lv_point_t vect_main, vect_norm;
|
lv_point_t vect_main, vect_norm;
|
||||||
@@ -216,8 +212,16 @@ static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, cons
|
|||||||
vect_norm.x = vect_norm.x << 4;
|
vect_norm.x = vect_norm.x << 4;
|
||||||
vect_norm.y = vect_norm.y << 4;
|
vect_norm.y = vect_norm.y << 4;
|
||||||
|
|
||||||
|
lv_coord_t width;
|
||||||
|
width = style->line.width;
|
||||||
|
#if LV_ANTIALIAS
|
||||||
|
lv_coord_t width_safe; /*`width_safe` is always >=1*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The pattern stores the points of the line ending. It has the good direction and length.
|
||||||
|
* The worth case is the 45° line where pattern can have 1.41 x `width` points*/
|
||||||
#if LV_COMPILER_VLA_SUPPORTED
|
#if LV_COMPILER_VLA_SUPPORTED
|
||||||
lv_point_t pattern[width_safe];
|
lv_point_t pattern[width * 2];
|
||||||
#else
|
#else
|
||||||
lv_point_t pattern[LINE_MAX_WIDTH];
|
lv_point_t pattern[LINE_MAX_WIDTH];
|
||||||
#endif
|
#endif
|
||||||
@@ -230,7 +234,8 @@ static void line_draw_skew(line_draw_t * main_line, const lv_area_t * mask, cons
|
|||||||
line_init(&pattern_line, &p0, &vect_norm);
|
line_init(&pattern_line, &p0, &vect_norm);
|
||||||
|
|
||||||
uint32_t width_sqr = width * width;
|
uint32_t width_sqr = width * width;
|
||||||
for(i = 0; i < width * 2; i ++) { /*Run until a big number. 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 < 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;
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ lv_obj_t * lv_img_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
* and must be screen sized*/
|
* and must be screen sized*/
|
||||||
if(par != NULL) {
|
if(par != NULL) {
|
||||||
ext->auto_size = 1;
|
ext->auto_size = 1;
|
||||||
lv_obj_set_style(new_img, &lv_style_plain); /*Inherit the style by default*/
|
lv_obj_set_style(new_img, NULL); /*Inherit the style by default*/
|
||||||
} else {
|
} else {
|
||||||
ext->auto_size = 0;
|
ext->auto_size = 0;
|
||||||
lv_obj_set_style(new_img, &lv_style_plain); /*Set a style for screens*/
|
lv_obj_set_style(new_img, &lv_style_plain); /*Set a style for screens*/
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ void lv_imgbtn_set_style(lv_obj_t * imgbtn, lv_imgbtn_style_t type, lv_style_t *
|
|||||||
* @param state the state where to get the image (from `lv_btn_state_t`) `
|
* @param state the state where to get the image (from `lv_btn_state_t`) `
|
||||||
* @return pointer to an image source (a C array or path to a file)
|
* @return pointer to an image source (a C array or path to a file)
|
||||||
*/
|
*/
|
||||||
void * lv_imgbtn_get_src(lv_obj_t * imgbtn, lv_btn_state_t state)
|
const void * lv_imgbtn_get_src(lv_obj_t * imgbtn, lv_btn_state_t state)
|
||||||
{
|
{
|
||||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ static bool lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * mask, lv_desig
|
|||||||
/*Just draw an image*/
|
/*Just draw an image*/
|
||||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||||
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
||||||
void * src = ext->img_src[state];
|
const void * src = ext->img_src[state];
|
||||||
lv_style_t * style = lv_imgbtn_get_style(imgbtn, state);
|
lv_style_t * style = lv_imgbtn_get_style(imgbtn, state);
|
||||||
lv_opa_t opa_scale = lv_obj_get_opa_scale(imgbtn);
|
lv_opa_t opa_scale = lv_obj_get_opa_scale(imgbtn);
|
||||||
lv_draw_img(&imgbtn->coords, mask, src, style, opa_scale);
|
lv_draw_img(&imgbtn->coords, mask, src, style, opa_scale);
|
||||||
@@ -244,7 +244,7 @@ static void refr_img(lv_obj_t * imgbtn)
|
|||||||
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
lv_imgbtn_ext_t * ext = lv_obj_get_ext_attr(imgbtn);
|
||||||
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
lv_btn_state_t state = lv_imgbtn_get_state(imgbtn);
|
||||||
lv_img_header_t header;
|
lv_img_header_t header;
|
||||||
void * src = ext->img_src[state];
|
const void * src = ext->img_src[state];
|
||||||
|
|
||||||
lv_res_t info_res;
|
lv_res_t info_res;
|
||||||
info_res = lv_img_dsc_get_info(src, &header);
|
info_res = lv_img_dsc_get_info(src, &header);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void lv_imgbtn_set_style(lv_obj_t * imgbtn, lv_imgbtn_style_t type, lv_style_t *
|
|||||||
* @param state the state where to get the image (from `lv_btn_state_t`) `
|
* @param state the state where to get the image (from `lv_btn_state_t`) `
|
||||||
* @return pointer to an image source (a C array or path to a file)
|
* @return pointer to an image source (a C array or path to a file)
|
||||||
*/
|
*/
|
||||||
void * lv_imgbtn_get_src(lv_obj_t * imgbtn, lv_btn_state_t state);
|
const void * lv_imgbtn_get_src(lv_obj_t * imgbtn, lv_btn_state_t state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current state of the image button
|
* Get the current state of the image button
|
||||||
|
|||||||
Reference in New Issue
Block a user