1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

Changed non-debug macro expansion (#1808)

This commit is contained in:
xennex22 2020-09-22 06:53:36 -07:00 committed by GitHub
parent ddf33b2fd9
commit eb056315c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 33 additions and 75 deletions

View File

@ -1251,7 +1251,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
/* Support bidirectional texts. /* Support bidirectional texts.
* Allows mixing Left-to-Right and Right-to-Left texts. * Allows mixing Left-to-Right and Right-to-Left texts.
* The direction will be processed according to the Unicode Bidirectioanl Algorithm: * The direction will be processed according to the Unicode Bidirectional Algorithm:
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#ifndef LV_USE_BIDI #ifndef LV_USE_BIDI
# ifdef CONFIG_LV_USE_BIDI # ifdef CONFIG_LV_USE_BIDI

View File

@ -120,7 +120,6 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
return disp->sys_layer; return disp->sys_layer;
} }
/** /**
* Assign a screen to a display. * Assign a screen to a display.
* @param disp pointer to a display where to assign the screen * @param disp pointer to a display where to assign the screen

View File

@ -184,7 +184,6 @@ static inline void lv_scr_load(lv_obj_t * scr)
lv_disp_load_scr(scr); lv_disp_load_scr(scr);
} }
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/

View File

@ -360,7 +360,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
#if LV_USE_GROUP #if LV_USE_GROUP
new_obj->group_p = NULL; new_obj->group_p = NULL;
#endif #endif
/*Set attributes*/ /*Set attributes*/

View File

@ -1527,11 +1527,11 @@ bool lv_debug_check_obj_valid(const lv_obj_t * obj);
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/ # if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_ASSERT_NULL(obj_p) # define LV_ASSERT_OBJ(obj_p, obj_type) LV_ASSERT_NULL(obj_p)
# else # else
# define LV_ASSERT_OBJ(obj_p, obj_type) true # define LV_ASSERT_OBJ(obj_p, obj_type)
# endif # endif
# endif # endif
#else #else
# define LV_ASSERT_OBJ(obj, obj_type) true # define LV_ASSERT_OBJ(obj, obj_type)
#endif #endif

View File

@ -618,13 +618,13 @@ bool lv_debug_check_style_list(const lv_style_list_t * list);
# define LV_ASSERT_STYLE_LIST(list_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE_LIST(list_p), "Invalid style list", list_p); # define LV_ASSERT_STYLE_LIST(list_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE_LIST(list_p), "Invalid style list", list_p);
# endif # endif
# else # else
# define LV_ASSERT_STYLE(style_p) true # define LV_ASSERT_STYLE(style_p)
# define LV_ASSERT_STYLE_LIST(list_p) true # define LV_ASSERT_STYLE_LIST(list_p)
# endif # endif
#else #else
# define LV_ASSERT_STYLE(p) true # define LV_ASSERT_STYLE(p)
# define LV_ASSERT_STYLE_LIST(p) true # define LV_ASSERT_STYLE_LIST(p)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,7 +1,3 @@
/** /**
* @file lv_mask.c * @file lv_mask.c
* *

View File

@ -81,7 +81,7 @@ void lv_debug_log_error(const char * msg, uint64_t value);
# define LV_ASSERT_NULL(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "NULL pointer", p); # define LV_ASSERT_NULL(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "NULL pointer", p);
# endif # endif
#else #else
# define LV_ASSERT_NULL(p) true # define LV_ASSERT_NULL(p)
#endif #endif
#if LV_USE_ASSERT_MEM #if LV_USE_ASSERT_MEM
@ -89,7 +89,7 @@ void lv_debug_log_error(const char * msg, uint64_t value);
# define LV_ASSERT_MEM(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "Out of memory", p); # define LV_ASSERT_MEM(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "Out of memory", p);
# endif # endif
#else #else
# define LV_ASSERT_MEM(p) true # define LV_ASSERT_MEM(p)
#endif #endif
#if LV_USE_ASSERT_MEM_INTEGRITY #if LV_USE_ASSERT_MEM_INTEGRITY
@ -97,7 +97,7 @@ void lv_debug_log_error(const char * msg, uint64_t value);
# define LV_ASSERT_MEM_INTEGRITY() LV_DEBUG_ASSERT(LV_DEBUG_CHECK_MEM_INTEGRITY(), "Memory integrity error", 0); # define LV_ASSERT_MEM_INTEGRITY() LV_DEBUG_ASSERT(LV_DEBUG_CHECK_MEM_INTEGRITY(), "Memory integrity error", 0);
# endif # endif
#else #else
# define LV_ASSERT_MEM_INTEGRITY() true # define LV_ASSERT_MEM_INTEGRITY()
#endif #endif
#if LV_USE_ASSERT_STR #if LV_USE_ASSERT_STR
@ -108,7 +108,7 @@ void lv_debug_log_error(const char * msg, uint64_t value);
# if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/ # if LV_USE_ASSERT_NULL /*Use at least LV_ASSERT_NULL if enabled*/
# define LV_ASSERT_STR(str) LV_ASSERT_NULL(str) # define LV_ASSERT_STR(str) LV_ASSERT_NULL(str)
# else # else
# define LV_ASSERT_STR(str) true # define LV_ASSERT_STR(str)
# endif # endif
#endif #endif
@ -117,11 +117,11 @@ void lv_debug_log_error(const char * msg, uint64_t value);
#define LV_DEBUG_ASSERT(expr, msg, value) do{}while(0) #define LV_DEBUG_ASSERT(expr, msg, value) do{}while(0)
#define LV_ASSERT_NULL(p) true #define LV_ASSERT_NULL(p)
#define LV_ASSERT_MEM(p) true #define LV_ASSERT_MEM(p)
#define LV_ASSERT_MEM_INTEGRITY() true #define LV_ASSERT_MEM_INTEGRITY()
#define LV_ASSERT_STR(p) true #define LV_ASSERT_STR(p)
#define LV_ASSERT_OBJ(obj, obj_type) true #define LV_ASSERT_OBJ(obj, obj_type)
#endif /* LV_USE_DEBUG */ #endif /* LV_USE_DEBUG */
/*clang-format on*/ /*clang-format on*/

View File

@ -79,75 +79,42 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char *
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_TRACE #if LV_LOG_LEVEL <= LV_LOG_LEVEL_TRACE
#define LV_LOG_TRACE(...) _lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, __VA_ARGS__); #define LV_LOG_TRACE(...) _lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, __VA_ARGS__);
#else #else
#define LV_LOG_TRACE(...) \ #define LV_LOG_TRACE(...)
{ \
; \
}
#endif #endif
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO #if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO
#define LV_LOG_INFO(...) _lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__); #define LV_LOG_INFO(...) _lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__);
#else #else
#define LV_LOG_INFO(...) \ #define LV_LOG_INFO(...)
{ \
; \
}
#endif #endif
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_WARN #if LV_LOG_LEVEL <= LV_LOG_LEVEL_WARN
#define LV_LOG_WARN(...) _lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, __func__, __VA_ARGS__); #define LV_LOG_WARN(...) _lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, __func__, __VA_ARGS__);
#else #else
#define LV_LOG_WARN(...) \ #define LV_LOG_WARN(...)
{ \
; \
}
#endif #endif
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_ERROR #if LV_LOG_LEVEL <= LV_LOG_LEVEL_ERROR
#define LV_LOG_ERROR(...) _lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__); #define LV_LOG_ERROR(...) _lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__);
#else #else
#define LV_LOG_ERROR(...) \ #define LV_LOG_ERROR(...)
{ \
; \
}
#endif #endif
#if LV_LOG_LEVEL <= LV_LOG_LEVEL_USER #if LV_LOG_LEVEL <= LV_LOG_LEVEL_USER
#define LV_LOG_USER(...) _lv_log_add(LV_LOG_LEVEL_USER, __FILE__, __LINE__, __func__, __VA_ARGS__); #define LV_LOG_USER(...) _lv_log_add(LV_LOG_LEVEL_USER, __FILE__, __LINE__, __func__, __VA_ARGS__);
#else #else
#define LV_LOG_USER(...) \ #define LV_LOG_USER(...)
{ \
; \
}
#endif #endif
#else /*LV_USE_LOG*/ #else /*LV_USE_LOG*/
/*Do nothing if `LV_USE_LOG 0`*/ /*Do nothing if `LV_USE_LOG 0`*/
#define _lv_log_add(level, file, line, ...) \ #define _lv_log_add(level, file, line, ...)
{ \ #define LV_LOG_TRACE(...)
; \ #define LV_LOG_INFO(...)
} #define LV_LOG_WARN(...)
#define LV_LOG_TRACE(...) \ #define LV_LOG_ERROR(...)
{ \ #define LV_LOG_USER(...)
; \
}
#define LV_LOG_INFO(...) \
{ \
; \
}
#define LV_LOG_WARN(...) \
{ \
; \
}
#define LV_LOG_ERROR(...) \
{ \
; \
}
#define LV_LOG_USER(...) \
{ \
; \
}
#endif /*LV_USE_LOG*/ #endif /*LV_USE_LOG*/
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -42,8 +42,6 @@ extern "C" {
#define LV_BEZIER_VAL_MAX 1024 /**< Max time in Bezier functions (not [0..1] to use integers) */ #define LV_BEZIER_VAL_MAX 1024 /**< Max time in Bezier functions (not [0..1] to use integers) */
#define LV_BEZIER_VAL_SHIFT 10 /**< log2(LV_BEZIER_VAL_MAX): used to normalize up scaled values*/ #define LV_BEZIER_VAL_SHIFT 10 /**< log2(LV_BEZIER_VAL_MAX): used to normalize up scaled values*/
/********************** /**********************
* TYPEDEFS * TYPEDEFS
**********************/ **********************/

View File

@ -189,7 +189,9 @@ lv_obj_t * lv_keyboard_create(lv_obj_t * par, const lv_obj_t * copy)
void lv_keyboard_set_textarea(lv_obj_t * kb, lv_obj_t * ta) void lv_keyboard_set_textarea(lv_obj_t * kb, lv_obj_t * ta)
{ {
LV_ASSERT_OBJ(kb, LV_OBJX_NAME); LV_ASSERT_OBJ(kb, LV_OBJX_NAME);
if(ta) LV_ASSERT_OBJ(ta, "lv_textarea"); if(ta) {
LV_ASSERT_OBJ(ta, "lv_textarea");
}
lv_keyboard_ext_t * ext = lv_obj_get_ext_attr(kb); lv_keyboard_ext_t * ext = lv_obj_get_ext_attr(kb);

View File

@ -276,7 +276,9 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index)
void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn) void lv_list_focus_btn(lv_obj_t * list, lv_obj_t * btn)
{ {
LV_ASSERT_OBJ(list, LV_OBJX_NAME); LV_ASSERT_OBJ(list, LV_OBJX_NAME);
if(btn) LV_ASSERT_OBJ(btn, "lv_btn"); if(btn) {
LV_ASSERT_OBJ(btn, "lv_btn");
}
lv_list_ext_t * ext = lv_obj_get_ext_attr(list); lv_list_ext_t * ext = lv_obj_get_ext_attr(list);

View File

@ -132,7 +132,6 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
lv_obj_set_signal_cb(page, lv_page_signal); lv_obj_set_signal_cb(page, lv_page_signal);
lv_obj_set_design_cb(page, lv_page_design); lv_obj_set_design_cb(page, lv_page_design);
lv_page_set_scrollbar_mode(page, ext->scrlbar.mode); lv_page_set_scrollbar_mode(page, ext->scrlbar.mode);
lv_theme_apply(page, LV_THEME_PAGE); lv_theme_apply(page, LV_THEME_PAGE);

View File

@ -1,4 +1,3 @@
/** /**
* @file lv_roller.c * @file lv_roller.c
* *

View File

@ -974,7 +974,6 @@ static lv_style_list_t * lv_table_get_style(lv_obj_t * table, uint8_t part)
static void refr_size(lv_obj_t * table) static void refr_size(lv_obj_t * table)
{ {
lv_coord_t h = 0; lv_coord_t h = 0;
lv_coord_t w = 0; lv_coord_t w = 0;

View File

@ -260,7 +260,6 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
return; return;
} }
/*If a new line was added it shouldn't show edge flash effect*/ /*If a new line was added it shouldn't show edge flash effect*/
bool edge_flash_en = lv_textarea_get_edge_flash(ta); bool edge_flash_en = lv_textarea_get_edge_flash(ta);
lv_textarea_set_edge_flash(ta, false); lv_textarea_set_edge_flash(ta, false);