chore: replace (void)xxx with LV_UNUSED(xxx) (#2779)

and remove the redundant inclusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-11-09 06:48:02 -06:00
committed by GitHub
parent 61b0de3bdc
commit 58d9645a5c
4 changed files with 12 additions and 13 deletions

View File

@@ -252,8 +252,8 @@ void lv_label_set_text_sel_end(lv_obj_t * obj, uint32_t index)
label->sel_end = index;
lv_obj_invalidate(obj);
#else
(void)obj; /*Unused*/
(void)index; /*Unused*/
LV_UNUSED(obj); /*Unused*/
LV_UNUSED(index); /*Unused*/
#endif
}
@@ -613,7 +613,7 @@ uint32_t lv_label_get_text_selection_start(const lv_obj_t * obj)
return label->sel_start;
#else
(void)obj; /*Unused*/
LV_UNUSED(obj); /*Unused*/
return LV_LABEL_TEXT_SELECTION_OFF;
#endif
}
@@ -626,7 +626,7 @@ uint32_t lv_label_get_text_selection_end(const lv_obj_t * obj)
lv_label_t * label = (lv_label_t *)obj;
return label->sel_end;
#else
(void)obj; /*Unused*/
LV_UNUSED(obj); /*Unused*/
return LV_LABEL_TEXT_SELECTION_OFF;
#endif
}

View File

@@ -537,8 +537,8 @@ void lv_textarea_set_text_selection(lv_obj_t * obj, bool en)
if(!en) lv_textarea_clear_selection(obj);
#else
(void)obj; /*Unused*/
(void)en; /*Unused*/
LV_UNUSED(obj); /*Unused*/
LV_UNUSED(en); /*Unused*/
#endif
}
@@ -671,7 +671,7 @@ bool lv_textarea_text_is_selected(const lv_obj_t * obj)
return false;
}
#else
(void)obj; /*Unused*/
LV_UNUSED(obj); /*Unused*/
return false;
#endif
}
@@ -684,7 +684,7 @@ bool lv_textarea_get_text_selection(lv_obj_t * obj)
lv_textarea_t * ta = (lv_textarea_t *)obj;
return ta->text_sel_en;
#else
(void)obj; /*Unused*/
LV_UNUSED(obj); /*Unused*/
return false;
#endif
}