fix(style):add const qualifier for lv_style_get_prop() (#2933)

This commit is contained in:
guoweilkd
2021-12-21 22:09:17 +08:00
committed by GitHub
parent 5bb3686ea8
commit 0831b6ba76
2 changed files with 4 additions and 3 deletions

View File

@@ -208,7 +208,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
style->has_group |= 1 << group; style->has_group |= 1 << group;
} }
lv_res_t lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) lv_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)
{ {
return lv_style_get_prop_inlined(style, prop, value); return lv_style_get_prop_inlined(style, prop, value);
} }

View File

@@ -339,7 +339,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
* LV_RES_OK: the property was fond, and `value` is set accordingly * LV_RES_OK: the property was fond, and `value` is set accordingly
* @note For performance reasons there are no sanity check on `style` * @note For performance reasons there are no sanity check on `style`
*/ */
lv_res_t lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value); lv_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value);
/** /**
@@ -352,7 +352,8 @@ lv_res_t lv_style_get_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_va
* @note For performance reasons there are no sanity check on `style` * @note For performance reasons there are no sanity check on `style`
* @note This function is the same as ::lv_style_get_prop but inlined. Use it only on performance critical places * @note This function is the same as ::lv_style_get_prop but inlined. Use it only on performance critical places
*/ */
static inline lv_res_t lv_style_get_prop_inlined(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) static inline lv_res_t lv_style_get_prop_inlined(const lv_style_t * style, lv_style_prop_t prop,
lv_style_value_t * value)
{ {
if(style->is_const) { if(style->is_const) {
const lv_style_const_prop_t * const_prop; const lv_style_const_prop_t * const_prop;