mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-25 09:15:43 +08:00
chore: fix warnings
This commit is contained in:
+1
-1
@@ -153,7 +153,7 @@ void lv_init(void)
|
||||
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE);
|
||||
#endif
|
||||
/*Test if the IDE has UTF-8 encoding*/
|
||||
char * txt = "Á";
|
||||
const char * txt = "Á";
|
||||
|
||||
uint8_t * txt_u8 = (uint8_t *)txt;
|
||||
if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) {
|
||||
|
||||
@@ -122,7 +122,7 @@ static void lv_checkbox_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
|
||||
|
||||
lv_checkbox_t * cb = (lv_checkbox_t *)obj;
|
||||
|
||||
cb->txt = "Check box";
|
||||
cb->txt = (char *)"Check box";
|
||||
cb->static_txt = 1;
|
||||
lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE);
|
||||
|
||||
@@ -85,7 +85,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name)
|
||||
lv_memcpy(new_map, old_map, sizeof(const char *) * (tab_id - 1));
|
||||
new_map[tab_id - 1] = lv_malloc(strlen(name) + 1);
|
||||
strcpy((char *)new_map[tab_id - 1], name);
|
||||
new_map[tab_id] = "";
|
||||
new_map[tab_id] = (char *)"";
|
||||
}
|
||||
/*left or right dir*/
|
||||
else {
|
||||
@@ -94,12 +94,12 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name)
|
||||
if(tabview->tab_cnt == 0) {
|
||||
new_map[0] = lv_malloc(strlen(name) + 1);
|
||||
strcpy((char *)new_map[0], name);
|
||||
new_map[1] = "";
|
||||
new_map[1] = (char *)"";
|
||||
}
|
||||
else {
|
||||
new_map[tab_id * 2 - 3] = "\n";
|
||||
new_map[tab_id * 2 - 3] = (char *)"\n";
|
||||
new_map[tab_id * 2 - 2] = lv_malloc(strlen(name) + 1);
|
||||
new_map[tab_id * 2 - 1] = "";
|
||||
new_map[tab_id * 2 - 1] = (char *)"";
|
||||
strcpy((char *)new_map[(tab_id * 2) - 2], name);
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob
|
||||
|
||||
lv_btnmatrix_set_one_checked(btnm, true);
|
||||
tabview->map = lv_malloc(sizeof(const char *));
|
||||
tabview->map[0] = "";
|
||||
tabview->map[0] = (char *)"";
|
||||
lv_btnmatrix_set_map(btnm, (const char **)tabview->map);
|
||||
lv_obj_add_event_cb(btnm, btns_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_obj_add_flag(btnm, LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
|
||||
Reference in New Issue
Block a user