From 1f2987a66b70f8edd729cfec84b9be9cd6bdbb8c Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 5 Dec 2019 06:44:11 +0100 Subject: [PATCH] fix minor warnings --- src/lv_misc/lv_txt.c | 4 ++-- src/lv_objx/lv_imgbtn.c | 8 ++++---- src/lv_objx/lv_lmeter.h | 2 +- src/lv_objx/lv_spinbox.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index cee156434..7eb934a9f 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -418,11 +418,11 @@ void lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) { size_t old_len = strlen(txt_buf); size_t ins_len = strlen(ins_txt); - uint32_t new_len = ins_len + old_len; + size_t new_len = ins_len + old_len; pos = lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/ /*Copy the second part into the end to make place to text to insert*/ - uint32_t i; + size_t i; for(i = new_len; i >= pos + ins_len; i--) { txt_buf[i] = txt_buf[i - ins_len]; } diff --git a/src/lv_objx/lv_imgbtn.c b/src/lv_objx/lv_imgbtn.c index 23e15eb61..522df301c 100644 --- a/src/lv_objx/lv_imgbtn.c +++ b/src/lv_objx/lv_imgbtn.c @@ -89,11 +89,11 @@ lv_obj_t * lv_imgbtn_create(lv_obj_t * par, const lv_obj_t * copy) else { lv_imgbtn_ext_t * copy_ext = lv_obj_get_ext_attr(copy); #if LV_IMGBTN_TILED == 0 - memcpy(ext->img_src, (void*)copy_ext->img_src, sizeof(ext->img_src)); + memcpy((void*)ext->img_src, copy_ext->img_src, sizeof(ext->img_src)); #else - memcpy(ext->img_src_left, (void*)copy_ext->img_src_left, sizeof(ext->img_src_left)); - memcpy(ext->img_src_mid, (void*)copy_ext->img_src_mid, sizeof(ext->img_src_mid)); - memcpy(ext->img_src_right, (void*)copy_ext->img_src_right, sizeof(ext->img_src_right)); + memcpy((void*)ext->img_src_left, copy_ext->img_src_left, sizeof(ext->img_src_left)); + memcpy((void*)ext->img_src_mid, copy_ext->img_src_mid, sizeof(ext->img_src_mid)); + memcpy((void*)ext->img_src_right, copy_ext->img_src_right, sizeof(ext->img_src_right)); #endif /*Refresh the style with new signal function*/ lv_obj_refresh_style(new_imgbtn); diff --git a/src/lv_objx/lv_lmeter.h b/src/lv_objx/lv_lmeter.h index b90b6ba40..6deac8ce8 100644 --- a/src/lv_objx/lv_lmeter.h +++ b/src/lv_objx/lv_lmeter.h @@ -138,7 +138,7 @@ int16_t lv_lmeter_get_max_value(const lv_obj_t * lmeter); * @param lmeter pointer to a line meter object * @return number of the scale units */ -uint8_t lv_lmeter_get_line_count(const lv_obj_t * lmeter); +uint16_t lv_lmeter_get_line_count(const lv_obj_t * lmeter); /** * Get the scale angle of a line meter diff --git a/src/lv_objx/lv_spinbox.c b/src/lv_objx/lv_spinbox.c index 2f2aa4983..42c229c21 100644 --- a/src/lv_objx/lv_spinbox.c +++ b/src/lv_objx/lv_spinbox.c @@ -97,7 +97,7 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy) lv_spinbox_ext_t * copy_ext = lv_obj_get_ext_attr(copy); lv_spinbox_set_value(new_spinbox, copy_ext->value); - lv_spinbox_set_digit_format(new_spinbox, copy_ext->digit_count, copy_ext->dec_point_pos); + lv_spinbox_set_digit_format(new_spinbox, (uint8_t)copy_ext->digit_count, (uint8_t)copy_ext->dec_point_pos); lv_spinbox_set_range(new_spinbox, copy_ext->range_min, copy_ext->range_max); lv_spinbox_set_step(new_spinbox, copy_ext->step);