hekate/nyx: use static/const where it should

This commit is contained in:
CTCaer
2024-06-02 07:38:07 +03:00
parent 9d79af231e
commit e46f54d4e6
11 changed files with 133 additions and 117 deletions

View File

@@ -145,7 +145,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32
u32 prevPct = 200;
u32 sdFileSector = 0;
int res = 0;
const char hexa[] = "0123456789abcdef";
static const char hexa[] = "0123456789abcdef";
DWORD *clmt = NULL;
u8 hashEm[SE_SHA_256_SIZE];
@@ -340,8 +340,8 @@ bool partial_sd_full_unmount = false;
static int _dump_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_part, sdmmc_storage_t *storage, emmc_part_t *part)
{
const u32 FAT32_FILESIZE_LIMIT = 0xFFFFFFFF;
const u32 SECTORS_TO_MIB_COEFF = 11;
static const u32 FAT32_FILESIZE_LIMIT = 0xFFFFFFFF;
static const u32 SECTORS_TO_MIB_COEFF = 11;
partial_sd_full_unmount = false;
@@ -942,7 +942,7 @@ out:
static int _restore_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_part, sdmmc_storage_t *storage, emmc_part_t *part, bool allow_multi_part)
{
const u32 SECTORS_TO_MIB_COEFF = 11;
static const u32 SECTORS_TO_MIB_COEFF = 11;
u32 lba_end = part->lba_end;
u32 totalSectors = part->lba_end - part->lba_start + 1;

View File

@@ -545,7 +545,7 @@ static lv_res_t _preset_hue_action(lv_obj_t *btn)
return LV_RES_OK;
}
const u16 theme_colors[17] = {
static const u16 theme_colors[17] = {
4, 13, 23, 33, 43, 54, 66, 89, 124, 167, 187, 200, 208, 231, 261, 291, 341
};
@@ -740,7 +740,7 @@ static lv_res_t _create_mbox_clock_edit(lv_obj_t *btn)
lv_obj_set_style(dark_bg, &mbox_darken);
lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES);
static const char * mbox_btn_map[] = { "\251", "\222Done", "\222Cancel", "\251", "" };
static const char *mbox_btn_map[] = { "\251", "\222Done", "\222Cancel", "\251", "" };
lv_obj_t *mbox = lv_mbox_create(dark_bg, NULL);
lv_mbox_set_recolor_text(mbox, true);
lv_obj_set_width(mbox, LV_HOR_RES / 9 * 6);
@@ -1032,7 +1032,7 @@ disabled_or_cal0_issue:;
lv_obj_set_style(dark_bg, &mbox_darken);
lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES);
static const char * mbox_btn_map[] = { "\251", "\222OK", "\251", "" };
static const char *mbox_btn_map[] = { "\251", "\222OK", "\251", "" };
lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL);
lv_mbox_set_recolor_text(mbox, true);
lv_obj_set_width(mbox, LV_HOR_RES / 9 * 5);

View File

@@ -267,7 +267,7 @@ out:
static void _create_gpt_partition(gpt_t *gpt, u8 *gpt_idx, u32 *curr_part_lba, u32 size_lba, char *name, int name_size)
{
const u8 linux_part_guid[] = { 0xAF, 0x3D, 0xC6, 0x0F, 0x83, 0x84, 0x72, 0x47, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 };
static const u8 linux_part_guid[] = { 0xAF, 0x3D, 0xC6, 0x0F, 0x83, 0x84, 0x72, 0x47, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 };
u8 random_number[16];
// Create GPT partition.
@@ -1844,7 +1844,7 @@ static lv_res_t _action_slider_emu(lv_obj_t *slider)
#define EMUMMC_32GB_FULL 29856
#define EMUMMC_64GB_FULL (59664 + 1) // 1MB extra for backup GPT.
const u32 rsvd_mb = 4 + 4 + 16 + 8; // BOOT0 + BOOT1 + 16MB offset + 8MB alignment.
static const u32 rsvd_mb = 4 + 4 + 16 + 8; // BOOT0 + BOOT1 + 16MB offset + 8MB alignment.
u32 size;
char lbl_text[64];
bool prev_emu_double = part_info.emu_double;

View File

@@ -1,3 +1,19 @@
/*
* Copyright (c) 2018-2024 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LOGOS_GUI_H_
#define _LOGOS_GUI_H_
@@ -374,7 +390,7 @@ const u8 touch_cursor_map[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
lv_img_dsc_t touch_cursor = {
const lv_img_dsc_t touch_cursor = {
.header.always_zero = 0,
.header.w = 33,
.header.h = 33,
@@ -385,7 +401,7 @@ lv_img_dsc_t touch_cursor = {
#ifdef HEKATE_LOGO
lv_img_dsc_t hekate_logo = {
const lv_img_dsc_t hekate_logo = {
.header.always_zero = 0,
.header.w = 193,
.header.h = 76,
@@ -394,7 +410,7 @@ lv_img_dsc_t hekate_logo = {
.data = (const uint8_t *)(NYX_RES_ADDR + 0x1D900),
};
lv_img_dsc_t ctcaer_logo = {
const lv_img_dsc_t ctcaer_logo = {
.header.always_zero = 0,
.header.w = 147,
.header.h = 76,
@@ -405,4 +421,4 @@ lv_img_dsc_t ctcaer_logo = {
#endif
#endif
#endif