mirror of
https://github.com/CTCaer/hekate.git
synced 2024-11-22 18:06:40 +00:00
nyx: fix s_printf bugs pointed by format checker
This commit is contained in:
parent
b6384d5da5
commit
b9cdf5d697
4 changed files with 11 additions and 11 deletions
|
@ -386,7 +386,7 @@ static int _dump_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_part,
|
||||||
}
|
}
|
||||||
|
|
||||||
s_printf(gui->txt_buf, "#96FF00 SD Card free space:# %d MiB\n#96FF00 Total backup size:# %d MiB\n\n",
|
s_printf(gui->txt_buf, "#96FF00 SD Card free space:# %d MiB\n#96FF00 Total backup size:# %d MiB\n\n",
|
||||||
sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF,
|
(u32)(sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF),
|
||||||
totalSectors >> SECTORS_TO_MIB_COEFF);
|
totalSectors >> SECTORS_TO_MIB_COEFF);
|
||||||
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
@ -753,7 +753,7 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
|
||||||
char *txt_buf = (char *)malloc(SZ_16K);
|
char *txt_buf = (char *)malloc(SZ_16K);
|
||||||
gui->txt_buf = txt_buf;
|
gui->txt_buf = txt_buf;
|
||||||
|
|
||||||
s_printf(txt_buf, "");
|
txt_buf[0] = 0;
|
||||||
lv_label_set_text(gui->label_log, txt_buf);
|
lv_label_set_text(gui->label_log, txt_buf);
|
||||||
|
|
||||||
lv_label_set_text(gui->label_info, "Checking for available free space...");
|
lv_label_set_text(gui->label_info, "Checking for available free space...");
|
||||||
|
@ -1024,7 +1024,7 @@ static int _restore_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_pa
|
||||||
|
|
||||||
if (check_4MB_aligned && (((u64)fno.fsize) % SZ_4M))
|
if (check_4MB_aligned && (((u64)fno.fsize) % SZ_4M))
|
||||||
{
|
{
|
||||||
s_printf(gui->txt_buf, "#FFDD00 The split file must be a#\n#FFDD00 multiple of 4 MiB.#\n#FFDD00 Aborting...#", res, outFilename);
|
s_printf(gui->txt_buf, "#FFDD00 The split file must be a#\n#FFDD00 multiple of 4 MiB.#\n#FFDD00 Aborting...#");
|
||||||
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
|
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
|
||||||
|
@ -1126,7 +1126,7 @@ multipart_not_allowed:
|
||||||
if (!(btn_wait() & BTN_POWER))
|
if (!(btn_wait() & BTN_POWER))
|
||||||
{
|
{
|
||||||
lv_obj_del(warn_mbox_bg);
|
lv_obj_del(warn_mbox_bg);
|
||||||
s_printf(gui->txt_buf, "\n#FF0000 Size of the SD Card backup does not match#\n#FF0000 eMMC's selected part size.#\n", res);
|
s_printf(gui->txt_buf, "\n#FF0000 Size of the SD Card backup does not match#\n#FF0000 eMMC's selected part size.#\n");
|
||||||
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
|
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
|
||||||
|
@ -1358,7 +1358,7 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
|
||||||
char *txt_buf = (char *)malloc(SZ_16K);
|
char *txt_buf = (char *)malloc(SZ_16K);
|
||||||
gui->txt_buf = txt_buf;
|
gui->txt_buf = txt_buf;
|
||||||
|
|
||||||
s_printf(txt_buf, "");
|
txt_buf[0] = 0;
|
||||||
lv_label_set_text(gui->label_log, txt_buf);
|
lv_label_set_text(gui->label_log, txt_buf);
|
||||||
|
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
|
|
@ -149,7 +149,7 @@ static int _dump_emummc_file_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_sto
|
||||||
u32 sdPathLen = strlen(sd_path);
|
u32 sdPathLen = strlen(sd_path);
|
||||||
|
|
||||||
s_printf(gui->txt_buf, "#96FF00 SD Card free space:# %d MiB\n#96FF00 Total backup size:# %d MiB\n\n",
|
s_printf(gui->txt_buf, "#96FF00 SD Card free space:# %d MiB\n#96FF00 Total backup size:# %d MiB\n\n",
|
||||||
sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF,
|
(u32)(sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF),
|
||||||
totalSectors >> SECTORS_TO_MIB_COEFF);
|
totalSectors >> SECTORS_TO_MIB_COEFF);
|
||||||
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
@ -358,7 +358,7 @@ void dump_emummc_file(emmc_tool_gui_t *gui)
|
||||||
gui->base_path = (char *)malloc(OUT_FILENAME_SZ);
|
gui->base_path = (char *)malloc(OUT_FILENAME_SZ);
|
||||||
gui->txt_buf = txt_buf;
|
gui->txt_buf = txt_buf;
|
||||||
|
|
||||||
s_printf(txt_buf, "");
|
txt_buf[0] = 0;
|
||||||
lv_label_set_text(gui->label_log, txt_buf);
|
lv_label_set_text(gui->label_log, txt_buf);
|
||||||
|
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
@ -841,7 +841,7 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start, u32 r
|
||||||
gui->base_path = (char *)malloc(OUT_FILENAME_SZ);
|
gui->base_path = (char *)malloc(OUT_FILENAME_SZ);
|
||||||
gui->txt_buf = txt_buf;
|
gui->txt_buf = txt_buf;
|
||||||
|
|
||||||
s_printf(txt_buf, "");
|
txt_buf[0] = 0;
|
||||||
lv_label_set_text(gui->label_log, txt_buf);
|
lv_label_set_text(gui->label_log, txt_buf);
|
||||||
|
|
||||||
manual_system_maintenance(true);
|
manual_system_maintenance(true);
|
||||||
|
|
|
@ -2176,7 +2176,7 @@ static void _nyx_set_default_styles(lv_theme_t * th)
|
||||||
|
|
||||||
lv_color_t tmp_color = lv_color_hsv_to_rgb(n_cfg.themecolor, 100, 100);
|
lv_color_t tmp_color = lv_color_hsv_to_rgb(n_cfg.themecolor, 100, 100);
|
||||||
text_color = malloc(32);
|
text_color = malloc(32);
|
||||||
s_printf(text_color, "#%06X", tmp_color.full & 0xFFFFFF);
|
s_printf(text_color, "#%06X", (u32)(tmp_color.full & 0xFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_task_t *task_bpmp_clock;
|
lv_task_t *task_bpmp_clock;
|
||||||
|
|
|
@ -2070,7 +2070,7 @@ static lv_res_t _create_window_sdcard_info_status(lv_obj_t *btn)
|
||||||
sd_fs.fs_type == FS_EXFAT ? ("exFAT "SYMBOL_SHRK) : ("FAT32"),
|
sd_fs.fs_type == FS_EXFAT ? ("exFAT "SYMBOL_SHRK) : ("FAT32"),
|
||||||
(sd_fs.csize > 1) ? (sd_fs.csize >> 1) : 512,
|
(sd_fs.csize > 1) ? (sd_fs.csize >> 1) : 512,
|
||||||
(sd_fs.csize > 1) ? "KiB" : "B",
|
(sd_fs.csize > 1) ? "KiB" : "B",
|
||||||
sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF);
|
(u32)(sd_fs.free_clst * sd_fs.csize >> SECTORS_TO_MIB_COEFF));
|
||||||
|
|
||||||
lv_label_set_text(lb_val3, txt_buf);
|
lv_label_set_text(lb_val3, txt_buf);
|
||||||
|
|
||||||
|
@ -2159,7 +2159,7 @@ static lv_res_t _create_window_battery_status(lv_obj_t *btn)
|
||||||
|
|
||||||
max17050_get_property(MAX17050_RepSOC, &cap_pct);
|
max17050_get_property(MAX17050_RepSOC, &cap_pct);
|
||||||
max17050_get_property(MAX17050_RepCap, &value);
|
max17050_get_property(MAX17050_RepCap, &value);
|
||||||
s_printf(txt_buf, "\n%d mAh [%d %]\n", value, cap_pct >> 8);
|
s_printf(txt_buf, "\n%d mAh [%d %%]\n", value, cap_pct >> 8);
|
||||||
|
|
||||||
max17050_get_property(MAX17050_FullCAP, &value);
|
max17050_get_property(MAX17050_FullCAP, &value);
|
||||||
s_printf(txt_buf + strlen(txt_buf), "%d mAh\n", value);
|
s_printf(txt_buf + strlen(txt_buf), "%d mAh\n", value);
|
||||||
|
|
Loading…
Reference in a new issue