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

fix warnings

This commit is contained in:
Gabor Kiss-Vamosi 2019-11-15 09:17:42 +01:00
parent 28cc431d95
commit ac28a13564
2 changed files with 10 additions and 14 deletions

View File

@ -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);
}
}

View File

@ -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;