fix: fix compiling warning on Mac (#4379)

Signed-off-by: XiaoweiYan <yanxiaowei@xiaomi.com>
Co-authored-by: XiaoweiYan <yanxiaowei@xiaomi.com>
This commit is contained in:
bjsylvia
2023-07-16 02:08:25 +08:00
committed by GitHub
parent b466045f13
commit 657dfe9615
3 changed files with 5 additions and 3 deletions

View File

@@ -828,7 +828,7 @@ static void spectrum_draw_event_cb(lv_event_t * e)
}
}
uint32_t amax = 20;
const int32_t amax = 20;
int32_t animv = spectrum_i - spectrum_lane_ofs_start;
if(animv > amax) animv = amax;
for(i = 0; i < BAR_CNT; i++) {
@@ -845,7 +845,7 @@ static void spectrum_draw_event_cb(lv_event_t * e)
}
if(v < BAR_COLOR1_STOP) draw_dsc.bg_color = BAR_COLOR1;
else if(v > BAR_COLOR3_STOP) draw_dsc.bg_color = BAR_COLOR3;
else if(v > (uint32_t)BAR_COLOR3_STOP) draw_dsc.bg_color = BAR_COLOR3;
else if(v > BAR_COLOR2_STOP) draw_dsc.bg_color = lv_color_mix(BAR_COLOR3, BAR_COLOR2,
((v - BAR_COLOR2_STOP) * 255) / (BAR_COLOR3_STOP - BAR_COLOR2_STOP));
else draw_dsc.bg_color = lv_color_mix(BAR_COLOR2, BAR_COLOR1,
@@ -953,6 +953,7 @@ static lv_obj_t * album_img_create(lv_obj_t * parent)
static void album_gesture_event_cb(lv_event_t * e)
{
LV_UNUSED(e);
lv_dir_t dir = lv_indev_get_gesture_dir(lv_indev_get_act());
if(dir == LV_DIR_LEFT) _lv_demo_music_album_next(true);
if(dir == LV_DIR_RIGHT) _lv_demo_music_album_next(false);

View File

@@ -187,6 +187,7 @@ lv_color32_t lv_canvas_get_px(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
break;
}
default:
lv_memzero(&ret, sizeof(lv_color32_t));
break;
}

View File

@@ -179,7 +179,7 @@ void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t a
uint16_t act_opt = roller->sel_opt_id - current_page * real_option_cnt;
int32_t sel_opt_signed = sel_opt;
/*Huge jump? Probably from last to first or first to last option.*/
if(LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) {
if((uint16_t)LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) {
if(act_opt > sel_opt) sel_opt_signed += real_option_cnt;
else sel_opt_signed -= real_option_cnt;
}