From ac28a1356474cb0d08f55839b2a4653518ee7c4d Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 15 Nov 2019 09:17:42 +0100 Subject: [PATCH] fix warnings --- src/lv_misc/lv_printf.c | 13 ++----------- src/lv_objx/lv_cpicker.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/lv_misc/lv_printf.c b/src/lv_misc/lv_printf.c index 11a39a8ad..e05f35beb 100644 --- a/src/lv_misc/lv_printf.c +++ b/src/lv_misc/lv_printf.c @@ -139,16 +139,6 @@ static inline void _out_null(char character, void* buffer, size_t idx, size_t ma } -// internal output function wrapper -static inline void _out_fct(char character, void* buffer, size_t idx, size_t maxlen) -{ - (void)idx; (void)maxlen; - if (character) { - // buffer is the output fct pointer - ((out_fct_wrap_type*)buffer)->fct(character, ((out_fct_wrap_type*)buffer)->arg); - } -} - // internal secure strlen // \return The length of the string (excluding the terminating 0) limited by 'maxsize' @@ -186,7 +176,8 @@ static size_t _out_rev(out_fct_type out, char* buffer, size_t idx, size_t maxlen // pad spaces up to given width if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) { - for (size_t i = len; i < width; i++) { + size_t i; + for (i = len; i < width; i++) { out(' ', buffer, idx++, maxlen); } } diff --git a/src/lv_objx/lv_cpicker.c b/src/lv_objx/lv_cpicker.c index 383607171..1bc6a6ad1 100644 --- a/src/lv_objx/lv_cpicker.c +++ b/src/lv_objx/lv_cpicker.c @@ -275,8 +275,11 @@ bool lv_cpicker_set_hsv(lv_obj_t * cpicker, lv_color_hsv_t hsv) */ bool lv_cpicker_set_color(lv_obj_t * cpicker, lv_color_t color) { + lv_color32_t c32; + c32 = lv_color_to32(color); + return lv_cpicker_set_hsv(cpicker, - lv_color_rgb_to_hsv(LV_COLOR_GET_R(color), LV_COLOR_GET_G(color), LV_COLOR_GET_B(color))); + lv_color_rgb_to_hsv(c32.ch.red, c32.ch.green, c32.ch.blue)); } /** @@ -619,7 +622,8 @@ static void draw_disc_grad(lv_obj_t * cpicker, const lv_area_t * mask, lv_opa_t lv_point_t triangle_points[3]; lv_style_t style; lv_style_copy(&style, &lv_style_plain); - for(uint16_t i = start_angle; i <= end_angle; i+= LV_CPICKER_DEF_QF) { + uint16_t i; + for(i = start_angle; i <= end_angle; i+= LV_CPICKER_DEF_QF) { style.body.main_color = angle_to_mode_color(cpicker, i); style.body.grad_color = style.body.main_color; @@ -704,7 +708,8 @@ static void draw_rect_grad(lv_obj_t * cpicker, const lv_area_t * mask, lv_opa_t style.body.shadow.width = 0; style.body.opa = LV_OPA_COVER; - for(uint16_t i = 0; i < 360; i += i_step) { + uint16_t i; + for(i = 0; i < 360; i += i_step) { style.body.main_color = angle_to_mode_color(cpicker, i); style.body.grad_color = style.body.main_color;