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

debug: minor fixes

This commit is contained in:
Gabor Kiss-Vamosi 2019-09-25 08:58:12 +02:00
parent 5660181b81
commit e9b6fcd58d
2 changed files with 37 additions and 11 deletions

View File

@ -47,7 +47,7 @@ bool lv_debug_check_obj_type(const lv_obj_t * obj, const char * obj_type)
if(obj_type[0] == '\0') return true;
lv_obj_type_t types;
lv_obj_get_type(obj, &types);
lv_obj_get_type((lv_obj_t *)obj, &types);
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM; i++) {

View File

@ -79,26 +79,52 @@ void lv_debug_log_error(const char * msg, uint64_t value);
* ASSERTS
*-----------------*/
#ifndef LV_ASSERT_NULL
#define LV_ASSERT_NULL(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "NULL pointer", p);
/*clang-format off*/
#if LV_USE_ASSERT_NULL
# ifndef LV_ASSERT_NULL
# define LV_ASSERT_NULL(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "NULL pointer", p);
# endif
#else
# define LV_ASSERT_NULL(p) true
#endif
#ifndef LV_ASSERT_MEM
#define LV_ASSERT_MEM(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "Out of memory", p);
#if LV_USE_ASSERT_MEM
# ifndef LV_ASSERT_MEM
# define LV_ASSERT_MEM(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_NULL(p), "Out of memory", p);
# endif
#else
# define LV_ASSERT_MEM(p) true
#endif
#ifndef LV_ASSERT_STR
#define LV_ASSERT_STR(p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STR(p), "Strange or invalid string", p);
#if LV_USE_ASSERT_STR
# ifndef LV_ASSERT_STR
# define LV_ASSERT_STR(str) LV_DEBUG_ASSERT(LV_DEBUG_IS_STR(str), "Strange or invalid string", p);
# endif
#else
# define LV_ASSERT_STR(p) true
#endif
#ifndef LV_ASSERT_OBJ
#define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p);
#if LV_USE_ASSERT_OBJ
# ifndef LV_ASSERT_OBJ
# define LV_ASSERT_OBJ(obj_p, obj_type) LV_DEBUG_ASSERT(LV_DEBUG_IS_OBJ(obj_p, obj_type), "Invalid object", obj_p);
# endif
#else
# define LV_ASSERT_OBJ(obj_p, obj_type) true
#endif
#ifndef LV_ASSERT_STYLE
#define LV_ASSERT_STYLE(style_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE(style_p, obj_type), "Invalid style", style_p);
#if LV_USE_ASSERT_STYLE
# ifndef LV_ASSERT_STYLE
# define LV_ASSERT_STYLE(style_p) LV_DEBUG_ASSERT(LV_DEBUG_IS_STYLE(style_p, obj_type), "Invalid style", style_p);
# endif
#else
# define LV_ASSERT_STYLE(style) true
#endif
/*clang-format on*/
#ifdef __cplusplus
} /* extern "C" */
#endif