More downsizing of variables

This commit is contained in:
libretroadmin 2024-09-09 16:18:32 +02:00
parent 27ffd4f00b
commit 7f87a46744
10 changed files with 20 additions and 20 deletions

View File

@ -409,7 +409,7 @@ bool disk_control_set_index(
bool error = false;
unsigned num_images = 0;
unsigned msg_duration = 0;
char msg[NAME_MAX_LENGTH];
char msg[128];
msg[0] = '\0';
@ -845,7 +845,7 @@ bool disk_control_verify_initial_index(
if (disk_control->initial_num_images > 1)
{
unsigned msg_duration = 0;
char msg[PATH_MAX_LENGTH];
char msg[128];
msg[0] = '\0';

View File

@ -94,8 +94,8 @@ static void gfx_widget_volume_frame(void* data, void *user_data)
if (state->alpha > 0.0f)
{
char msg[NAME_MAX_LENGTH];
char percentage_msg[NAME_MAX_LENGTH];
char msg[128];
char percentage_msg[128];
video_frame_info_t *video_info = (video_frame_info_t*)data;
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)user_data;
gfx_widget_font_data_t *font_regular = &p_dispwidget->gfx_widget_fonts.regular;

View File

@ -411,7 +411,7 @@ size_t config_file_add_reference(config_file_t *conf, char *path)
{
size_t len;
/* It is expected that the conf has it's path already set */
char short_path[PATH_MAX_LENGTH];
char short_path[NAME_MAX_LENGTH];
if (!conf->references)
conf->references = path_linked_list_new();
len = fill_pathname_abbreviated_or_relative(short_path, conf->path, path, sizeof(short_path));

View File

@ -61,14 +61,14 @@ struct content_m3u_file
* - Returns false in the event of an error */
static bool m3u_file_load(m3u_file_t *m3u_file)
{
size_t i;
char entry_label[NAME_MAX_LENGTH];
char entry_path[PATH_MAX_LENGTH];
const char *file_ext = NULL;
int64_t file_len = 0;
uint8_t *file_buf = NULL;
struct string_list *lines = NULL;
bool success = false;
size_t i;
char entry_path[PATH_MAX_LENGTH];
char entry_label[PATH_MAX_LENGTH];
entry_path[0] = '\0';
entry_label[0] = '\0';
@ -85,8 +85,8 @@ static bool m3u_file_load(m3u_file_t *m3u_file)
/* > File must have the correct extension */
file_ext = path_get_extension(m3u_file->path);
if (string_is_empty(file_ext) ||
!string_is_equal_noncase(file_ext, M3U_FILE_EXT))
if ( string_is_empty(file_ext)
|| !string_is_equal_noncase(file_ext, M3U_FILE_EXT))
goto end;
/* > If file does not exist, no action

View File

@ -50,8 +50,8 @@ typedef struct logiqx_dat logiqx_dat_t;
* if required) */
typedef struct
{
char name[PATH_MAX_LENGTH];
char description[PATH_MAX_LENGTH];
char name[NAME_MAX_LENGTH];
char description[NAME_MAX_LENGTH];
char year[8];
char manufacturer[128];
bool is_bios;
@ -66,7 +66,7 @@ typedef struct
* Also provides access to file size (DAT files can
* be very large, so it is useful to have this information
* on hand - i.e. so we can check that the system has
* enough free memory to load the file). */
* enough free memory to load the file). */
bool logiqx_dat_path_is_valid(const char *path, uint64_t *file_size);
/* File initialisation/de-initialisation */

View File

@ -6446,8 +6446,8 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
{
math_matrix_4x4 mymat;
unsigned i;
char title_msg[128];
char msg[1024];
char title_msg[NAME_MAX_LENGTH];
char title_truncated[NAME_MAX_LENGTH];
gfx_thumbnail_shadow_t thumbnail_shadow;
size_t selection = 0;

View File

@ -528,7 +528,7 @@ static int menu_displaylist_parse_core_info(
{
char tmp[PATH_MAX_LENGTH];
#if IOS
char shortened_path[PATH_MAX_LENGTH] = {0};
char shortened_path[NAME_MAX_LENGTH] = {0};
#endif
unsigned i, count = 0;
core_info_t *core_info = NULL;

View File

@ -2569,8 +2569,8 @@ static int setting_action_ok_bind_all_save_autoconfig(
if (!string_is_empty(name) &&
config_save_autoconf_profile(name, index_offset))
{
char buf[PATH_MAX_LENGTH];
char msg[PATH_MAX_LENGTH];
char msg[256];
char buf[128];
config_get_autoconf_profile_filename(name, index_offset, buf, sizeof(buf));
snprintf(msg, sizeof(msg),msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY_NAMED),buf);
runloop_msg_queue_push(

View File

@ -267,7 +267,7 @@ steam_core_dlc_t* steam_get_core_dlc_by_name(
void steam_install_core_dlc(steam_core_dlc_t *core_dlc)
{
char msg[PATH_MAX_LENGTH] = { 0 };
char msg[128] = { 0 };
bool downloading = false;
bool installed = false;
uint64_t bytes_downloaded = 0;
@ -309,7 +309,7 @@ error:
void steam_uninstall_core_dlc(steam_core_dlc_t *core_dlc)
{
char msg[PATH_MAX_LENGTH] = { 0 };
char msg[128] = { 0 };
MistResult result = mist_steam_apps_uninstall_dlc(core_dlc->app_id);

View File

@ -537,7 +537,7 @@ static void task_save_handler(retro_task_t *task)
if (task_get_cancelled(task) || written != remaining)
{
char msg[PATH_MAX_LENGTH];
char msg[128];
if (state->flags & SAVE_TASK_FLAG_UNDO_SAVE)
{