fix warnings

This commit is contained in:
Gabor Kiss-Vamosi
2020-03-10 08:34:07 +01:00
parent 48a4cc3fc6
commit 498f050262
27 changed files with 163 additions and 61 deletions

View File

@@ -279,9 +279,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
#define LV_USE_ASSERT_MEM 1
/*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#ifndef LV_USE_ASSERT_MEM_INTEGRITY
#define LV_USE_ASSERT_MEM_INTEGRITY 0
#endif
/* Check the strings.
* Search for NULL, very long strings, invalid characters, and unnatural repetitions. (Slow)
@@ -293,7 +291,7 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
#define LV_USE_ASSERT_OBJ 0
/*Check if the styles are properly initialized. (Fast)*/
#define LV_USE_ASSERT_STYLE 1
#define LV_USE_ASSERT_STYLE 0
#endif /*LV_USE_DEBUG*/

10
scripts/infer_run.sh Executable file
View File

@@ -0,0 +1,10 @@
# https://github.com/facebook/infer
#
# Install:
# VERSION=0.17.0; \
# curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \
# | sudo tar -C /opt -xJ && \
# sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer
infer run -- make -j8

View File

@@ -57,7 +57,7 @@ lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp)
void lv_disp_load_scr(lv_obj_t * scr)
{
lv_disp_t * d = lv_obj_get_disp(scr);
if(!d) return; /*Shouldn't happen, just to be sure*/
d->act_scr = scr;
lv_obj_invalidate(scr);

View File

@@ -393,6 +393,7 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
bool act_scr_del = false;
if(obj->parent == NULL) {
disp = lv_obj_get_disp(obj);
if(!disp) return LV_RES_INV; /*Shouldn't happen*/
if(disp->act_scr == obj) act_scr_del = true;
}
@@ -409,8 +410,10 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
#endif
/*Delete the user data*/
#if LV_USE_USER_DATA
#if LV_USE_USER_DATA_FREE
LV_USER_DATA_FREE(obj);
#endif
#endif
/*Recursively delete the children*/

View File

@@ -522,6 +522,7 @@ static void lv_refr_obj_and_children(lv_obj_t * top_p, const lv_area_t * mask_p)
* but in special cases (e.g. if the screen has alpha) it won't.
* In this case use the screen directly */
if(top_p == NULL) top_p = lv_disp_get_scr_act(disp_refr);
if(top_p == NULL) return; /*Shouldn't happen*/
/*Refresh the top object and its children*/
lv_refr_obj(top_p, mask_p);

View File

@@ -446,13 +446,9 @@ static void draw_letter_normal(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph
return; /*Invalid bpp. Can't render the letter*/
}
int32_t col, row;
int32_t box_w = g->box_w;
int32_t box_h = g->box_h;
int32_t width_byte_scr = box_w >> 3; /*Width in bytes (on the screen finally) (e.g. w = 11 -> 2 bytes wide)*/
if(box_w & 0x7) width_byte_scr++;
int32_t width_bit = box_w * bpp; /*Letter width in bits*/
/* Calculate the col/row start/end on the map*/
@@ -596,8 +592,6 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
int32_t box_w = g->box_w;
int32_t box_h = g->box_h;
int32_t width_byte_scr = box_w >> 3; /*Width in bytes (on the screen finally) (e.g. w = 11 -> 2 bytes wide)*/
if(box_w & 0x7) width_byte_scr++;
int32_t width_bit = box_w * bpp; /*Letter width in bits*/

View File

@@ -99,11 +99,11 @@ lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_
bool changed = false;
lv_draw_mask_common_dsc_t * dsc;
lv_draw_mask_res_t res = LV_DRAW_MASK_RES_FULL_COVER;
uint8_t i;
for(i = 0; i < LV_MASK_MAX_NUM; i++) {
if(mask_list[i].param) {
dsc = mask_list[i].param;
lv_draw_mask_res_t res = LV_DRAW_MASK_RES_FULL_COVER;
res = dsc->cb(mask_buf, abs_x, abs_y, len, (void *)mask_list[i].param);
if(res == LV_DRAW_MASK_RES_FULL_TRANSP) return LV_DRAW_MASK_RES_FULL_TRANSP;
else if(res == LV_DRAW_MASK_RES_CHANGED) changed = true;

View File

@@ -287,7 +287,6 @@ static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, lv_draw_re
}
if(dsc->bg_grad_dir == LV_GRAD_DIR_NONE && other_mask_cnt == 0) {
lv_area_t fill_area;
/*Central part*/
fill_area.x1 = coords_bg.x1 + rout;
fill_area.x2 = coords_bg.x2 - rout;

View File

@@ -163,7 +163,7 @@ uint16_t lv_anim_count_running(void)
lv_anim_t * a;
LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a) cnt++;
return cnt++;
return cnt;
}
/**

View File

@@ -66,9 +66,6 @@ lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
uint8_t region, remainder, p, q, t;
if(s == 0) {
r = v;
g = v;
b = v;
return lv_color_make(v, v, v);
}

View File

@@ -37,45 +37,111 @@ typedef enum {
LV_THEME_NONE = 0,
LV_THEME_SCR,
LV_THEME_OBJ,
#if LV_USE_ARC
LV_THEME_ARC,
#endif
#if LV_USE_BAR
LV_THEME_BAR,
#endif
#if LV_USE_BTN
LV_THEME_BTN,
#endif
#if LV_USE_BTNMATRIX
LV_THEME_BTNMATRIX,
#endif
#if LV_USE_CALENDAR
LV_THEME_CALENDAR,
#endif
#if LV_USE_CANVAS
LV_THEME_CANVAS,
#endif
#if LV_USE_CHECKBOX
LV_THEME_CHECKBOX,
#endif
#if LV_USE_CHART
LV_THEME_CHART,
#endif
#if LV_USE_CONT
LV_THEME_CONT,
#endif
#if LV_USE_CPICKER
LV_THEME_CPICKER,
#endif
#if LV_USE_DROPDOWN
LV_THEME_DROPDOWN,
#endif
#if LV_USE_GAUGE
LV_THEME_GAUGE,
#endif
#if LV_USE_IMG
LV_THEME_IMAGE,
#endif
#if LV_USE_IMGBTN
LV_THEME_IMGBTN,
#endif
#if LV_USE_KEYBOARD
LV_THEME_KEYBOARD,
#endif
#if LV_USE_LABEL
LV_THEME_LABEL,
#endif
#if LV_USE_LED
LV_THEME_LED,
#endif
#if LV_USE_LINE
LV_THEME_LINE,
#endif
#if LV_USE_LIST
LV_THEME_LIST,
LV_THEME_LIST_BTN,
#endif
#if LV_USE_LINEMETER
LV_THEME_LINEMETER,
#endif
#if LV_USE_MSGBOX
LV_THEME_MSGBOX,
LV_THEME_MSGBOX_BTNS, /*The button matrix of the buttons are initialized separately*/
#endif
#if LV_USE_OBJMASK
LV_THEME_OBJMASK,
#endif
#if LV_USE_PAGE
LV_THEME_PAGE,
#endif
#if LV_USE_ROLLER
LV_THEME_ROLLER,
#endif
#if LV_USE_SLIDER
LV_THEME_SLIDER,
#endif
#if LV_USE_SPINBOX
LV_THEME_SPINBOX,
LV_THEME_SPINBOX_BTN, /*Button extra for spinbox*/
#endif
#if LV_USE_SPINNER
LV_THEME_SPINNER,
#endif
#if LV_USE_SWITCH
LV_THEME_SWITCH,
#endif
#if LV_USE_TABLE
LV_THEME_TABLE,
#endif
#if LV_USE_TABVIEW
LV_THEME_TABVIEW,
LV_THEME_TABVIEW_PAGE, /*The tab pages are initialized separately*/
#endif
#if LV_USE_TEXTAREA
LV_THEME_TEXTAREA,
LV_THEME_TEXTAREA_ONELINE,
#endif
#if LV_USE_TILEVIEW
LV_THEME_TILEVIEW,
#endif
#if LV_USE_WIN
LV_THEME_WIN,
LV_THEME_WIN_BTN, /*The buttons are initialized separately*/
#endif
} lv_theme_style_t;
typedef struct {

View File

@@ -924,7 +924,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
#if LV_USE_BTNMATRIX
case LV_THEME_BTNMATRIX:
lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BG);
list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BG);
lv_obj_clean_style_list(obj, LV_BTNMATRIX_PART_BTN);
list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BTN);
@@ -978,35 +977,30 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
#if LV_USE_CANVAS
case LV_THEME_CANVAS:
lv_obj_clean_style_list(obj, LV_CANVAS_PART_MAIN);
list = lv_obj_get_style_list(obj, LV_CANVAS_PART_MAIN);
break;
#endif
#if LV_USE_IMG
case LV_THEME_IMAGE:
lv_obj_clean_style_list(obj, LV_IMG_PART_MAIN);
list = lv_obj_get_style_list(obj, LV_IMG_PART_MAIN);
break;
#endif
#if LV_USE_IMGBTN
case LV_THEME_IMGBTN:
lv_obj_clean_style_list(obj, LV_IMG_PART_MAIN);
list = lv_obj_get_style_list(obj, LV_IMG_PART_MAIN);
break;
#endif
#if LV_USE_LABEL
case LV_THEME_LABEL:
lv_obj_clean_style_list(obj, LV_LABEL_PART_MAIN);
list = lv_obj_get_style_list(obj, LV_LABEL_PART_MAIN);
break;
#endif
#if LV_USE_LINE
case LV_THEME_LINE:
lv_obj_clean_style_list(obj, LV_LABEL_PART_MAIN);
list = lv_obj_get_style_list(obj, LV_LABEL_PART_MAIN);
break;
#endif
@@ -1109,7 +1103,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_style_list_add_style(list, &scr);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_BG_SCRL);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_BG_SCRL);
lv_obj_clean_style_list(obj, LV_TABVIEW_PART_TAB_BG);
list = lv_obj_get_style_list(obj, LV_TABVIEW_PART_TAB_BG);
@@ -1126,7 +1119,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
case LV_THEME_TABVIEW_PAGE:
lv_obj_clean_style_list(obj, LV_PAGE_PART_BG);
list = lv_obj_get_style_list(obj, LV_PAGE_PART_BG);
lv_obj_clean_style_list(obj, LV_PAGE_PART_SCRL);
list = lv_obj_get_style_list(obj, LV_PAGE_PART_SCRL);
@@ -1179,7 +1171,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_style_list_add_style(list, &list_bg);
lv_obj_clean_style_list(obj, LV_LIST_PART_SCRL);
list = lv_obj_get_style_list(obj, LV_LIST_PART_SCRL);
lv_obj_clean_style_list(obj, LV_LIST_PART_SCRLBAR);
list = lv_obj_get_style_list(obj, LV_LIST_PART_SCRLBAR);
@@ -1231,7 +1222,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
#if LV_USE_TABLE
case LV_THEME_TABLE:
lv_obj_clean_style_list(obj, LV_TABLE_PART_BG);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_BG);
lv_obj_clean_style_list(obj, LV_TABLE_PART_CELL1);
list = lv_obj_get_style_list(obj, LV_TABLE_PART_CELL1);

View File

@@ -652,7 +652,7 @@ void lv_canvas_fill_bg(lv_obj_t * canvas, lv_color_t color, lv_opa_t opa)
lv_img_dsc_t * dsc = lv_canvas_get_img(canvas);
uint32_t x = dsc->header.w * dsc->header.h;
uint32_t x;
uint32_t y;
for(y = 0; y < dsc->header.h; y++) {
for(x = 0; x < dsc->header.w; x++) {

View File

@@ -551,7 +551,7 @@ bool lv_dropdown_get_show_selected(lv_obj_t * ddlist)
void lv_dropdown_open(lv_obj_t * ddlist, lv_anim_enable_t anim)
{
#if LV_USE_ANIMATION == 0
anim = false;
(void) anim; /*Unused*/
#endif
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
if(ext->page) return;
@@ -565,6 +565,12 @@ void lv_dropdown_open(lv_obj_t * ddlist, lv_anim_enable_t anim)
if(ancestor_page_design == NULL) ancestor_page_design = lv_obj_get_design_cb(ext->page);
lv_dropdown_page_ext_t * page_ext = lv_obj_allocate_ext_attr(ext->page, sizeof(lv_dropdown_page_ext_t));
LV_ASSERT_MEM(page_ext);
if(page_ext == NULL) {
lv_obj_del(ext->page);
ext->page = NULL;
return;
}
page_ext->ddlist = ddlist;
lv_obj_set_design_cb(ext->page, lv_dropdown_page_design);
@@ -612,7 +618,7 @@ void lv_dropdown_open(lv_obj_t * ddlist, lv_anim_enable_t anim)
}
#if LV_USE_ANIMATION
if(ext->dir != LV_DROPDOWN_DIR_UP) {
if(anim == LV_ANIM_ON && ext->dir != LV_DROPDOWN_DIR_UP) {
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, ddlist);
@@ -851,7 +857,6 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * p
return LV_RES_OK;
}
else if(sign == LV_SIGNAL_GET_STATE_DSC) {
lv_dropdown_ext_t * ext = lv_obj_get_ext_attr(ddlist);
lv_get_state_info_t * info = param;
if(info->part == LV_DROPDOWN_PART_LIST ||
info->part == LV_DROPDOWN_PART_SCRLBAR ||
@@ -1130,6 +1135,8 @@ static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint1
lv_coord_t font_h = lv_font_get_line_height(label_dsc.font);
lv_obj_t * label = get_label(ddlist);
if(label == NULL) return;
lv_area_t area_sel;
area_sel.y1 = label->coords.y1;
area_sel.y1 += id * (font_h + label_dsc.line_space);
@@ -1211,6 +1218,7 @@ static void page_press_handler(lv_obj_t * page)
static uint16_t get_id_on_point(lv_obj_t * ddlist, lv_coord_t x, lv_coord_t y)
{
lv_obj_t * label = get_label(ddlist);
if(label == NULL) return 0;
x -= label->coords.x1;
y -= label->coords.y1;
uint16_t letter_i;
@@ -1246,6 +1254,7 @@ static void pos_selected(lv_obj_t * ddlist)
lv_coord_t font_h = lv_font_get_line_height(font);
lv_obj_t * scrl = lv_page_get_scrl(ext->page);
lv_obj_t * label = get_label(ddlist);
if(label == NULL) return;
lv_coord_t h = lv_obj_get_height(ext->page);
lv_style_int_t line_space = lv_obj_get_style_text_line_space(ddlist, LV_DROPDOWN_PART_LIST);

View File

@@ -113,8 +113,8 @@ void lv_led_set_bright(lv_obj_t * led, uint8_t bright)
lv_led_ext_t * ext = lv_obj_get_ext_attr(led);
if(ext->bright == bright) return;
if(bright < LV_LED_BRIGHT_MIN) bright = LV_LED_BRIGHT_MIN;
if(bright > LV_LED_BRIGHT_MAX) bright = LV_LED_BRIGHT_MAX;
if(bright <= LV_LED_BRIGHT_MIN) bright = LV_LED_BRIGHT_MIN;
if(bright >= LV_LED_BRIGHT_MAX) bright = LV_LED_BRIGHT_MAX;
ext->bright = bright;

View File

@@ -115,9 +115,11 @@ lv_objmask_mask_t * lv_objmask_add_mask(lv_obj_t * objmask, void * param)
uint16_t param_size = get_param_size(dsc->type);
lv_objmask_mask_t * m = lv_ll_ins_head(&ext->mask_ll);
LV_ASSERT_MEM(m);
if(m == NULL) return NULL;
m->param = lv_mem_alloc(param_size);
LV_ASSERT_MEM(m->param);
if(m == NULL) return NULL;
if(m->param == NULL) return NULL;
memcpy(m->param, param, param_size);

View File

@@ -154,9 +154,9 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo
/*Count the '\n'-s to determine the number of options*/
ext->option_cnt = 0;
uint16_t i;
for(i = 0; options[i] != '\0'; i++) {
if(options[i] == '\n') ext->option_cnt++;
uint16_t cnt;
for(cnt = 0; options[cnt] != '\0'; cnt++) {
if(options[cnt] == '\n') ext->option_cnt++;
}
ext->option_cnt++; /*Last option has no `\n`*/
@@ -762,8 +762,7 @@ static lv_res_t release_handler(lv_obj_t * roller)
#endif
lv_obj_t * label = get_label(roller);
if(label == NULL) return LV_RES_OK;
if(lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_INDEV_TYPE_BUTTON) {
/*Search the clicked option (For KEYPAD and ENCODER the new value should be already set)*/
@@ -798,13 +797,14 @@ static lv_res_t release_handler(lv_obj_t * roller)
static void refr_width(lv_obj_t * roller)
{
lv_obj_t * label = get_label(roller);
if(label == NULL) return;
lv_coord_t label_w = lv_obj_get_width(label);
lv_style_int_t left = lv_obj_get_style_pad_left(roller, LV_ROLLER_PART_BG);
lv_style_int_t right = lv_obj_get_style_pad_right(roller, LV_ROLLER_PART_BG);
lv_obj_set_width(roller, label_w + left + right);
}
/**
@@ -814,6 +814,7 @@ static void refr_width(lv_obj_t * roller)
static void refr_height(lv_obj_t * roller)
{
lv_obj_t * label = get_label(roller);
if(label == NULL) return;
lv_obj_set_height(lv_page_get_scrl(roller), lv_obj_get_height(label) + lv_obj_get_height(roller));
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);

View File

@@ -162,6 +162,8 @@ void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const
}
ext->cell_data[cell] = lv_mem_realloc(ext->cell_data[cell], strlen(txt) + 2); /*+1: trailing '\0; +1: format byte*/
LV_ASSERT_MEM(ext->cell_data[cell]);
if(ext->cell_data[cell] == NULL) return;
strcpy(ext->cell_data[cell] + 1, txt); /*+1 to skip the format byte*/
ext->cell_data[cell][0] = format.format_byte;
@@ -742,7 +744,6 @@ static lv_design_res_t lv_table_design(lv_obj_t * table, const lv_area_t * clip_
lv_point_t p2;
p1.x = cell_area.x1;
p2.x = cell_area.x2;
uint16_t i;
for(i = 1; ext->cell_data[cell][i] != '\0'; i++) {
if(ext->cell_data[cell][i] == '\n') {
ext->cell_data[cell][i] = '\0';

View File

@@ -375,9 +375,9 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
lv_coord_t indic_size;
lv_coord_t indic_pos = 0; /*silence uninitialized variable warning*/;
lv_style_int_t btns_bg_inner = lv_obj_get_style_pad_inner(tabview, LV_TABVIEW_PART_TAB_BG);
lv_style_int_t btns_bg_left = lv_obj_get_style_pad_left(tabview, LV_TABVIEW_PART_TAB_BG);
lv_style_int_t btns_bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_TAB_BG);
lv_style_int_t btns_bg_inner = 0;
lv_style_int_t btns_bg_left = 0;
lv_style_int_t btns_bg_top = 0;
switch(ext->btns_pos) {
default: /*default case is prevented in lv_tabview_set_btns_pos(), but here for safety*/
@@ -385,11 +385,15 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
break;
case LV_TABVIEW_TAB_POS_TOP:
case LV_TABVIEW_TAB_POS_BOTTOM:
btns_bg_inner = lv_obj_get_style_pad_inner(tabview, LV_TABVIEW_PART_TAB_BG);
btns_bg_left = lv_obj_get_style_pad_left(tabview, LV_TABVIEW_PART_TAB_BG);
indic_size = lv_obj_get_width(ext->indic);
indic_pos = indic_size * id + btns_bg_inner * id + btns_bg_left;
break;
case LV_TABVIEW_TAB_POS_LEFT:
case LV_TABVIEW_TAB_POS_RIGHT:
btns_bg_inner = lv_obj_get_style_pad_inner(tabview, LV_TABVIEW_PART_TAB_BG);
btns_bg_top = lv_obj_get_style_pad_top(tabview, LV_TABVIEW_PART_TAB_BG);
indic_size = lv_obj_get_height(ext->indic);
indic_pos = btns_bg_top + id * (indic_size + btns_bg_inner);
break;
@@ -804,8 +808,6 @@ static void tabview_realign(lv_obj_t * tabview)
lv_tabview_set_tab_act(tabview, ext->tab_cur, LV_ANIM_OFF);
}
static void refr_indic_size(lv_obj_t * tabview)
{
lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);

View File

@@ -348,8 +348,8 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt)
/*If the textarea is empty, invalidate it to hide the placeholder*/
if(ext->placeholder_txt) {
const char * txt = lv_label_get_text(ext->label);
if(txt[0] == '\0') lv_obj_invalidate(ta);
const char * txt_act = lv_label_get_text(ext->label);
if(txt_act[0] == '\0') lv_obj_invalidate(ta);
}
/*Insert the text*/
@@ -504,8 +504,8 @@ void lv_textarea_set_text(lv_obj_t * ta, const char * txt)
/*If the textarea is empty, invalidate it to hide the placeholder*/
if(ext->placeholder_txt) {
const char * txt = lv_label_get_text(ext->label);
if(txt[0] == '\0') lv_obj_invalidate(ta);
const char * txt_act = lv_label_get_text(ext->label);
if(txt_act[0] == '\0') lv_obj_invalidate(ta);
}
/*Don't let 'width == 0' because the cursor will not be visible*/

View File

@@ -219,6 +219,9 @@ void lv_win_set_title(lv_obj_t * win, const char * title)
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
ext->title_txt = lv_mem_realloc(ext->title_txt, strlen(title) + 1);
LV_ASSERT_MEM(ext->title_txt);
if(ext->title_txt == NULL) return;
strcpy(ext->title_txt, title);
lv_obj_invalidate(ext->header);
}

View File

@@ -5,7 +5,7 @@ CC ?= gcc
LVGL_DIR ?= ${shell pwd}/../..
LVGL_DIR_NAME ?= lvgl
WARNINGS ?= -Wall -Wextra
WARNINGS ?= -Werror -Wall -Wextra -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wundef -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wno-switch-enum -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=1024 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wswitch-enum -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare
OPTIMIZATION ?= -O3 -g0

View File

@@ -6,7 +6,6 @@ lvgldirname = os.path.abspath('..')
lvgldirname = os.path.basename(lvgldirname)
lvgldirname = '"' + lvgldirname + '"'
warnings = '"-Wall -Werror"'
base_defines = '"-DLV_CONF_PATH=' + lvgldirname +'/tests/lv_test_conf.h -DLV_BUILD_TEST"'
optimization = '"-O3 -g0"'
@@ -24,7 +23,7 @@ def build(name, defines):
d_all += " -D" + d + "=" + str(defines[d])
d_all += '"'
cmd = "make -j8 BIN=test.bin LVGL_DIR_NAME=" + lvgldirname + " DEFINES=" + d_all + " WARNINGS=" + warnings + " OPTIMIZATION=" + optimization
cmd = "make -j8 BIN=test.bin LVGL_DIR_NAME=" + lvgldirname + " DEFINES=" + d_all + " OPTIMIZATION=" + optimization
print("---------------------------")
print("Clean")
@@ -64,6 +63,7 @@ minimal_monochrome = {
"LV_GPU":0,
"LV_USE_FILESYSTEM":0,
"LV_USE_USER_DATA":0,
"LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":0,
"LV_USE_THEME_MATERIAL":1,
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
@@ -74,7 +74,13 @@ minimal_monochrome = {
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_unscii_8\\\"",
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_unscii_8\\\"",
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_unscii_8\\\"",
"LV_LOG_PRINTF":0,
"LV_USE_DEBUG":0,
"LV_USE_ASSERT_NULL":0,
"LV_USE_ASSERT_MEM":0,
"LV_USE_ASSERT_STR":0,
"LV_USE_ASSERT_OBJ":0,
"LV_USE_ASSERT_STYLE":0,
"LV_FONT_ROBOTO_12":0,
"LV_FONT_ROBOTO_16":0,
"LV_FONT_ROBOTO_22":0,
@@ -131,6 +137,7 @@ all_obj_minimal_features = {
"LV_GPU":0,
"LV_USE_FILESYSTEM":0,
"LV_USE_USER_DATA":0,
"LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":0,
"LV_USE_THEME_MATERIAL":1,
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
@@ -142,6 +149,11 @@ all_obj_minimal_features = {
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_roboto_16\\\"",
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_16\\\"",
"LV_USE_DEBUG":0,
"LV_USE_ASSERT_NULL":0,
"LV_USE_ASSERT_MEM":0,
"LV_USE_ASSERT_STR":0,
"LV_USE_ASSERT_OBJ":0,
"LV_USE_ASSERT_STYLE":0,
"LV_FONT_ROBOTO_12":0,
"LV_FONT_ROBOTO_16":1,
"LV_FONT_ROBOTO_22":0,
@@ -199,6 +211,7 @@ all_obj_all_features = {
"LV_GPU":1,
"LV_USE_FILESYSTEM":1,
"LV_USE_USER_DATA":1,
"LV_USE_USER_DATA_FREE":0,
"LV_USE_LOG":1,
"LV_USE_THEME_MATERIAL":1,
"LV_THEME_DEFAULT_INIT": "\\\"lv_theme_material_init\\\"",
@@ -208,7 +221,14 @@ all_obj_all_features = {
"LV_THEME_DEFAULT_FONT_SMALL" : "\\\"&lv_font_roboto_12\\\"",
"LV_THEME_DEFAULT_FONT_NORMAL" : "\\\"&lv_font_roboto_16\\\"",
"LV_THEME_DEFAULT_FONT_SUBTITLE" : "\\\"&lv_font_roboto_22\\\"",
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_28\\\"",
"LV_THEME_DEFAULT_FONT_TITLE" : "\\\"&lv_font_roboto_28\\\"",
"LV_LOG_PRINTF":0,
"LV_USE_DEBUG":0,
"LV_USE_ASSERT_NULL":0,
"LV_USE_ASSERT_MEM":0,
"LV_USE_ASSERT_STR":0,
"LV_USE_ASSERT_OBJ":0,
"LV_USE_ASSERT_STYLE":0,
"LV_FONT_ROBOTO_12":1,
"LV_FONT_ROBOTO_16":1,
"LV_FONT_ROBOTO_22":1,
@@ -266,6 +286,9 @@ advanced_features = {
"LV_GPU":1,
"LV_USE_FILESYSTEM":1,
"LV_USE_USER_DATA":1,
"LV_USE_USER_DATA_FREE":1,
"LV_USER_DATA_FREE_INCLUDE":"\\\"<stdio.h>\\\"",
"LV_USER_DATA_FREE": "\\\"free\\\"",
"LV_IMG_CACHE_DEF_SIZE":32,
"LV_USE_LOG":1,
"LV_USE_THEME_MATERIAL":1,

View File

@@ -47,9 +47,10 @@ typedef struct {
/**********************
* STATIC PROTOTYPES
**********************/
void read_png_file(png_img_t * p, const char* file_name);
void write_png_file(png_img_t * p, const char* file_name);
void png_release(png_img_t * p);
static void read_png_file(png_img_t * p, const char* file_name);
static void write_png_file(png_img_t * p, const char* file_name);
static void png_release(png_img_t * p);
static void process_file(png_img_t * p);
/**********************
* STATIC VARIABLES
@@ -200,7 +201,7 @@ void lv_test_assert_img_eq(const char * fn_ref, const char * s)
* STATIC FUNCTIONS
**********************/
void read_png_file(png_img_t * p, const char* file_name)
static void read_png_file(png_img_t * p, const char* file_name)
{
char header[8]; // 8 is the maximum size that can be checked
@@ -255,7 +256,7 @@ void read_png_file(png_img_t * p, const char* file_name)
}
void write_png_file(png_img_t * p, const char* file_name)
static void write_png_file(png_img_t * p, const char* file_name)
{
/* create file */
FILE *fp = fopen(file_name, "wb");
@@ -306,7 +307,7 @@ void write_png_file(png_img_t * p, const char* file_name)
fclose(fp);
}
void png_release(png_img_t * p)
static void png_release(png_img_t * p)
{
int y;
for (y=0; y<p->height; y++)
@@ -314,7 +315,7 @@ void png_release(png_img_t * p)
free(p->row_pointers);
}
void process_file(png_img_t * p)
static void process_file(png_img_t * p)
{
if (png_get_color_type(p->png_ptr, p->info_ptr) == PNG_COLOR_TYPE_RGB)
lv_test_exit("[process_file] input file is PNG_COLOR_TYPE_RGB but must be PNG_COLOR_TYPE_RGBA "

View File

@@ -9,7 +9,7 @@
#include "../lv_test_assert.h"
#if LV_BUILD_TEST
#include "lv_test_core.h"
#include "lv_test_obj.h"
#include "lv_test_style.h"

View File

@@ -8,6 +8,7 @@
*********************/
#include "../../lvgl.h"
#include "../lv_test_assert.h"
#include "lv_test_obj.h"
#if LV_BUILD_TEST

View File

@@ -8,6 +8,7 @@
*********************/
#include "../../lvgl.h"
#include "../lv_test_assert.h"
#include "lv_test_style.h"
#if LV_BUILD_TEST