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:
@@ -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;
|
int32_t animv = spectrum_i - spectrum_lane_ofs_start;
|
||||||
if(animv > amax) animv = amax;
|
if(animv > amax) animv = amax;
|
||||||
for(i = 0; i < BAR_CNT; i++) {
|
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;
|
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,
|
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));
|
((v - BAR_COLOR2_STOP) * 255) / (BAR_COLOR3_STOP - BAR_COLOR2_STOP));
|
||||||
else draw_dsc.bg_color = lv_color_mix(BAR_COLOR2, BAR_COLOR1,
|
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)
|
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());
|
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_LEFT) _lv_demo_music_album_next(true);
|
||||||
if(dir == LV_DIR_RIGHT) _lv_demo_music_album_next(false);
|
if(dir == LV_DIR_RIGHT) _lv_demo_music_album_next(false);
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ lv_color32_t lv_canvas_get_px(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
lv_memzero(&ret, sizeof(lv_color32_t));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
uint16_t act_opt = roller->sel_opt_id - current_page * real_option_cnt;
|
||||||
int32_t sel_opt_signed = sel_opt;
|
int32_t sel_opt_signed = sel_opt;
|
||||||
/*Huge jump? Probably from last to first or first to last option.*/
|
/*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;
|
if(act_opt > sel_opt) sel_opt_signed += real_option_cnt;
|
||||||
else sel_opt_signed -= real_option_cnt;
|
else sel_opt_signed -= real_option_cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user