Skip to content

Commit

Permalink
chore: fix compile time warnings (#5872)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Glueck <martin.glueck@glaser-co.at>
  • Loading branch information
glueckm and Martin Glueck committed Mar 15, 2024
1 parent 550c31b commit 082e24c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/core/lv_obj_scroll.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,25 @@ void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align)

lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->scrollbar_mode;
if(obj->spec_attr) return (lv_scrollbar_mode_t) obj->spec_attr->scrollbar_mode;
else return LV_SCROLLBAR_MODE_AUTO;
}

lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->scroll_dir;
if(obj->spec_attr) return (lv_dir_t) obj->spec_attr->scroll_dir;
else return LV_DIR_ALL;
}

lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->scroll_snap_x;
if(obj->spec_attr) return (lv_scroll_snap_t) obj->spec_attr->scroll_snap_x;
else return LV_SCROLL_SNAP_NONE;
}

lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->scroll_snap_y;
if(obj->spec_attr) return (lv_scroll_snap_t) obj->spec_attr->scroll_snap_y;
else return LV_SCROLL_SNAP_NONE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/lv_obj_style.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_style_selector_t se
const lv_part_t part = lv_obj_style_get_selector_part(selector);
const lv_state_t state = lv_obj_style_get_selector_state(selector);
const lv_state_t state_inv = ~state;
const bool skip_trans = obj->skip_trans;
const bool skip_trans = (const bool) obj->skip_trans;
int32_t weight = -1;
lv_style_res_t found;
uint32_t i;
Expand Down
2 changes: 1 addition & 1 deletion src/draw/sw/lv_draw_sw_box_shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ static void LV_ATTRIBUTE_FAST_MEM shadow_draw_corner_buf(const lv_area_t * coord
int32_t x;
lv_opa_t * res_buf = (lv_opa_t *)sh_buf;
for(x = 0; x < size * size; x++) {
res_buf[x] = sh_buf[x];
res_buf[x] = (lv_opa_t) sh_buf[x];
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/draw/sw/lv_draw_sw_transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_are
alpha_buf = NULL;
}

bool aa = draw_dsc->antialias;
bool aa = (bool) draw_dsc->antialias;
bool is_rotated = draw_dsc->rotation;

int32_t xs_ups = 0, ys_ups = 0, ys_ups_start = 0, ys_step_256_original = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/font/lv_binfont_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds

switch(cmap_table[i].format_type) {
case LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL: {
uint8_t ids_size = sizeof(uint8_t) * cmap_table[i].data_entries_count;
uint8_t ids_size = (uint8_t)(sizeof(uint8_t) * cmap_table[i].data_entries_count);
uint8_t * glyph_id_ofs_list = lv_malloc(ids_size);

cmap->glyph_id_ofs_list = glyph_id_ofs_list;
Expand Down Expand Up @@ -482,8 +482,8 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
font->get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt;
font->get_glyph_bitmap = lv_font_get_bitmap_fmt_txt;
font->subpx = font_header.subpixels_mode;
font->underline_position = font_header.underline_position;
font->underline_thickness = font_header.underline_thickness;
font->underline_position = (int8_t) font_header.underline_position;
font->underline_thickness = (int8_t) font_header.underline_thickness;

font_dsc->bpp = font_header.bits_per_pixel;
font_dsc->kern_scale = font_header.kerning_scale;
Expand Down
2 changes: 1 addition & 1 deletion src/font/lv_font_fmt_txt.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)

if(p) {
lv_uintptr_t ofs = p - fdsc->cmaps[i].unicode_list;
glyph_id = fdsc->cmaps[i].glyph_id_start + ofs;
glyph_id = fdsc->cmaps[i].glyph_id_start + (uint32_t) ofs;
}
}
else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/barcode/code128.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ size_t code128_encode_raw(const char * s, char * out, size_t maxlength)
// Compute the checksum
int sum = codes[0];
for(i = 1; i < num_codes; i++)
sum += codes[i] * i;
sum += (int)(codes[i] * i);
out += code128_append_code(sum % 103, out);

// Finalize the code.
Expand Down
2 changes: 1 addition & 1 deletion src/libs/barcode/lv_barcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data)
return LV_RESULT_INVALID;
}

int32_t barcode_w = code128_encode_gs1(data, out_buf, len);
int32_t barcode_w = (int32_t) code128_encode_gs1(data, out_buf, len);
LV_LOG_INFO("barcode width = %d", (int)barcode_w);

LV_ASSERT(barcode->scale > 0);
Expand Down

0 comments on commit 082e24c

Please sign in to comment.