fix warnings

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-19 16:16:11 +01:00
parent 406da6856c
commit fe20d47b6e
11 changed files with 76 additions and 26 deletions

View File

@@ -10,12 +10,6 @@
#include <stdint.h>
/* Add ESP-IDF related includes */
#if defined (ESP_PLATFORM)
# include "sdkconfig.h"
# include "esp_attr.h"
#endif
/* Handle special Kconfig options */
#include "lv_conf_kconfig.h"
@@ -259,6 +253,14 @@
# endif
#endif
/* Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver. */
#ifndef LV_DISP_ROT_MAX_BUF
# ifdef CONFIG_LV_DISP_ROT_MAX_BUF
# define LV_DISP_ROT_MAX_BUF CONFIG_LV_DISP_ROT_MAX_BUF
# else
# define LV_DISP_ROT_MAX_BUF (10*1024)
# endif
#endif
/*-------------
* GPU
*-----------*/

View File

@@ -204,16 +204,16 @@ enum {
LV_OBJ_FLAG_ADV_HITTEST = (1 << 15), /**< Allow performing more accurate hit (click) test. E.g. consider rounded corners. */
LV_OBJ_FLAG_LAYOUTABLE = (1 << 16), /**< Make the object position-able by the layouts */
LV_OBJ_FLAG_LAYOUT_1 = (1 << 24), /** Custom flag, free to use by layouts*/
LV_OBJ_FLAG_LAYOUT_2 = (1 << 25), /** Custom flag, free to use by layouts*/
LV_OBJ_FLAG_LAYOUT_1 = (1 << 23), /** Custom flag, free to use by layouts*/
LV_OBJ_FLAG_LAYOUT_2 = (1 << 24), /** Custom flag, free to use by layouts*/
LV_OBJ_FLAG_WIDGET_1 = (1 << 26), /** Custom flag, free to use by widget*/
LV_OBJ_FLAG_WIDGET_2 = (1 << 27), /** Custom flag, free to use by widget*/
LV_OBJ_FLAG_WIDGET_1 = (1 << 25), /** Custom flag, free to use by widget*/
LV_OBJ_FLAG_WIDGET_2 = (1 << 26), /** Custom flag, free to use by widget*/
LV_OBJ_FLAG_USER_1 = (1 << 28), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_2 = (1 << 29), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_3 = (1 << 30), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_4 = (1 << 31), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_1 = (1 << 27), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_2 = (1 << 28), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_3 = (1 << 29), /** Custom flag, free to use by user*/
LV_OBJ_FLAG_USER_4 = (1 << 30), /** Custom flag, free to use by user*/
};
typedef uint32_t lv_obj_flag_t;

View File

@@ -871,8 +871,8 @@ static void trans_anim_cb(trans_t * tr, lv_anim_value_t v)
else value_final.ptr = tr->end_value.ptr;
break;
case LV_STYLE_COLOR_FILTER_CB:
if(tr->start_value.func == NULL) value_final.ptr = tr->end_value.func;
else if(tr->end_value.func == NULL) value_final.ptr = tr->start_value.func;
if(tr->start_value.func == NULL) value_final.func = tr->end_value.func;
else if(tr->end_value.func == NULL) value_final.func = tr->start_value.func;
else if(v < 128) value_final.ptr = tr->start_value.ptr;
else value_final.ptr = tr->end_value.ptr;
break;
@@ -897,7 +897,7 @@ static void trans_anim_cb(trans_t * tr, lv_anim_value_t v)
lv_style_value_t old_value;
bool refr = true;
if(lv_style_get_prop(list->styles[i].style, tr->prop, &old_value)) {
if(value_final.ptr == old_value.ptr && value_final.func == old_value.ptr && value_final.color.full == old_value.color.full && value_final.num == old_value.num) {
if(value_final.ptr == old_value.ptr && value_final.func == old_value.func && value_final.color.full == old_value.color.full && value_final.num == old_value.num) {
refr = false;
}
}

View File

@@ -520,3 +520,26 @@ static inline void lv_obj_set_style_content_line_space(struct _lv_obj_t * obj, u
static inline void lv_obj_set_style_content_decor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_text_decor_t value) {
lv_style_value_t v = {.num = value}; lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_CONTENT_DECOR, v); }
static inline void lv_obj_set_pad_all(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
lv_obj_set_style_pad_left(obj, part, state, value);
lv_obj_set_style_pad_right(obj, part, state, value);
lv_obj_set_style_pad_top(obj, part, state, value);
lv_obj_set_style_pad_bottom(obj, part, state, value);
}
static inline void lv_obj_set_pad_hor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
lv_obj_set_style_pad_left(obj, part, state, value);
lv_obj_set_style_pad_right(obj, part, state, value);
}
static inline void lv_obj_set_pad_ver(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
lv_obj_set_style_pad_top(obj, part, state, value);
lv_obj_set_style_pad_bottom(obj, part, state, value);
}
static inline void lv_obj_set_pad_gap(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
lv_obj_set_style_pad_row(obj, part, state, value);
lv_obj_set_style_pad_column(obj, part, state, value);
}

View File

@@ -288,7 +288,7 @@ lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * s
uint32_t rn;
f = lv_fs_open(src, LV_FS_MODE_RD);
if(f) {
lv_fs_res_t res = lv_fs_read(f, header, sizeof(lv_img_header_t), &rn);
res = lv_fs_read(f, header, sizeof(lv_img_header_t), &rn);
lv_fs_close(f);
if(res != LV_FS_RES_OK || rn != sizeof(lv_img_header_t)) {
LV_LOG_WARN("Image get info get read file header");
@@ -339,7 +339,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
LV_ASSERT_MALLOC(dsc->user_data);
if(dsc->user_data == NULL) {
LV_LOG_ERROR("img_decoder_built_in_open: out of memory");
lv_fs_close(&f);
lv_fs_close(f);
return LV_RES_INV;
}
lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t));
@@ -403,7 +403,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
lv_color32_t cur_color;
uint32_t i;
for(i = 0; i < palette_size; i++) {
lv_fs_read(&user_data->f, &cur_color, sizeof(lv_color32_t), NULL);
lv_fs_read(user_data->f, &cur_color, sizeof(lv_color32_t), NULL);
user_data->palette[i] = lv_color_make(cur_color.ch.red, cur_color.ch.green, cur_color.ch.blue);
user_data->opa[i] = cur_color.ch.alpha;
}
@@ -521,7 +521,7 @@ static lv_res_t lv_img_decoder_built_in_line_true_color(lv_img_decoder_dsc_t * d
}
uint32_t btr = len * (px_size >> 3);
uint32_t br = 0;
res = lv_fs_read(&user_data->f, buf, btr, &br);
res = lv_fs_read(user_data->f, buf, btr, &br);
if(res != LV_FS_RES_OK || btr != br) {
LV_LOG_WARN("Built-in image decoder read failed");
return LV_RES_INV;

View File

@@ -29,7 +29,6 @@ CSRCS += lv_font_montserrat_48.c
CSRCS += lv_font_simsun_16_cjk.c
CSRCS += lv_font_unscii_8.c
CSRCS += lv_font_unscii_16.c
CSRCS += lv_font_dejavu_16_persian_hebrew.c
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font

View File

@@ -82,7 +82,7 @@ typedef struct _disp_drv_t {
uint32_t sw_rotate : 1; /**< 1: use software rotation (slower) */
uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display. */
uint32_t rotated : 1; /**< 1: turn the display by 90 degree. @warning Does not update coordinates for you!*/
uint32_t rotated : 3; /**< 1: turn the display by 90 degree. @warning Does not update coordinates for you!*/
#if LV_COLOR_SCREEN_TRANSP
/**Handle if the screen doesn't have a solid (opa == LV_OPA_COVER) background.

View File

@@ -259,3 +259,25 @@ static inline void lv_style_set_content_line_space(lv_style_t * style, lv_coord_
static inline void lv_style_set_content_decor(lv_style_t * style, lv_text_decor_t value) {
lv_style_value_t v = {.num = value}; lv_style_set_prop(style, LV_STYLE_CONTENT_DECOR, v); }
static inline void lv_style_set_pad_all(lv_style_t * style, lv_coord_t value) {
lv_style_set_pad_left(style, value);
lv_style_set_pad_right(style, value);
lv_style_set_pad_top(style, value);
lv_style_set_pad_bottom(style, value);
}
static inline void lv_style_set_pad_hor(lv_style_t * style, lv_coord_t value) {
lv_style_set_pad_left(style, value);
lv_style_set_pad_right(style, value);
}
static inline void lv_style_set_pad_ver(lv_style_t * style, lv_coord_t value) {
lv_style_set_pad_top(style, value);
lv_style_set_pad_bottom(style, value);
}
static inline void lv_style_set_pad_gap(lv_style_t * style, lv_coord_t value) {
lv_style_set_pad_row(style, value);
lv_style_set_pad_column(style, value);
}

View File

@@ -162,7 +162,7 @@ uint16_t lv_img_get_angle(lv_obj_t * obj);
* @param img pointer to an image object
* @param pivot store the rotation center here
*/
void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot);;
void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot);
/**
* Get the zoom factor of the image.

View File

@@ -8,8 +8,10 @@ LVGL_DIR_NAME ?= lvgl
WARNINGS = -Werror -Wall -Wextra \
-Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wpointer-arith -Wuninitialized \
-Wunreachable-code -Wreturn-type -Wmultichar -Wformat-security -Wdouble-promotion -Wclobbered -Wdeprecated \
-Wempty-body -Wshift-negative-value -Wstack-usage=2048 -pedantic-errors \
-Wtype-limits -Wsizeof-pointer-memaccess -Wpedantic -Wmissing-prototypes -Wno-discarded-qualifiers
-Wempty-body -Wshift-negative-value -Wstack-usage=2048 \
-Wtype-limits -Wsizeof-pointer-memaccess -Wmissing-prototypes -Wno-discarded-qualifiers
#WARNINGS += -Wpedantic -pedantic-errors
#-Wno-unused-value -Wno-unused-parameter
OPTIMIZATION ?= -O3 -g0

View File

@@ -1,3 +1,5 @@
typedef int _keep_pedantic_happy;
///**
// * @file lv_test_style.c
// *