Shorten character arrays that are passed to fill_pathname_base_noext

This commit is contained in:
twinaphex 2021-11-10 00:09:33 +01:00
parent 619398bbe4
commit 318108ac82
12 changed files with 41 additions and 41 deletions

View File

@ -884,7 +884,7 @@ bool audio_driver_dsp_filter_init(const char *device)
struct string_list *plugs = NULL;
#if defined(HAVE_DYLIB) && !defined(HAVE_FILTERS_BUILTIN)
char basedir[PATH_MAX_LENGTH];
char ext_name[PATH_MAX_LENGTH];
char ext_name[NAME_MAX_LENGTH];
basedir[0] = ext_name[0] = '\0';
@ -1318,7 +1318,7 @@ void audio_driver_load_system_sounds(void)
{
char sounds_path[PATH_MAX_LENGTH];
char sounds_fallback_path[PATH_MAX_LENGTH];
char basename_noext[PATH_MAX_LENGTH];
char basename_noext[NAME_MAX_LENGTH];
settings_t *settings = config_get_ptr();
const char *dir_assets = settings->paths.directory_assets;
const bool audio_enable_menu = settings->bools.audio_enable_menu;

View File

@ -1318,7 +1318,7 @@ bool command_event_save_core_config(
const char *rarch_path_config)
{
char msg[128];
char config_name[PATH_MAX_LENGTH];
char config_name[NAME_MAX_LENGTH];
char config_path[PATH_MAX_LENGTH];
char config_dir[PATH_MAX_LENGTH];
bool found_path = false;

View File

@ -151,7 +151,7 @@ typedef struct
char name[256];
char display_name[256];
char config_path[PATH_MAX_LENGTH]; /* Path to the RetroArch config file */
char config_name[PATH_MAX_LENGTH]; /* Base name of the RetroArch config file */
char config_name[NAME_MAX_LENGTH]; /* Base name of the RetroArch config file */
bool autoconfigured;
} input_device_info_t;

View File

@ -1283,7 +1283,7 @@ int generic_action_ok_displaylist_push(const char *path,
break;
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
{
char lpl_basename[PATH_MAX_LENGTH];
char lpl_basename[NAME_MAX_LENGTH];
lpl_basename[0] = '\0';
filebrowser_clear_type();
fill_pathname_join(tmp,

View File

@ -3907,7 +3907,7 @@ static void ozone_init_horizontal_list(ozone_handle_t *ozone,
for (i = 0; i < list_size; i++)
{
char playlist_file_noext[255];
char playlist_file_noext[NAME_MAX_LENGTH];
char *console_name = NULL;
const char *playlist_file = ozone->horizontal_list.list[i].path;
@ -4030,7 +4030,7 @@ static void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
strlen(path), STRLEN_CONST(".lpl")))
{
struct texture_image ti;
char sysname[PATH_MAX_LENGTH];
char sysname[NAME_MAX_LENGTH];
char texturepath[PATH_MAX_LENGTH];
char content_texturepath[PATH_MAX_LENGTH];
char icons_path[PATH_MAX_LENGTH];

View File

@ -375,7 +375,7 @@ typedef struct xmb_handle
uint8_t system_tab_end;
uint8_t tabs[XMB_SYSTEM_TAB_MAX_LENGTH];
char title_name[255];
char title_name[NAME_MAX_LENGTH];
/* Cached texts showing current entry index / current list size */
char entry_index_str[32];
@ -2245,7 +2245,7 @@ static void xmb_context_reset_horizontal_list(
strlen(path), STRLEN_CONST(".lpl")))
{
struct texture_image ti;
char sysname[PATH_MAX_LENGTH];
char sysname[NAME_MAX_LENGTH];
char iconpath[PATH_MAX_LENGTH];
char texturepath[PATH_MAX_LENGTH];
char content_texturepath[PATH_MAX_LENGTH];

View File

@ -1868,7 +1868,7 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
}
else if (!string_is_empty(info->path))
{
char lpl_basename[PATH_MAX_LENGTH];
char lpl_basename[NAME_MAX_LENGTH];
lpl_basename[0] = '\0';
fill_pathname_base_noext(lpl_basename, info->path, sizeof(lpl_basename));
@ -2828,7 +2828,7 @@ static int menu_displaylist_parse_horizontal_list(
if (!string_is_empty(item->path))
{
char path_playlist[PATH_MAX_LENGTH];
char lpl_basename[PATH_MAX_LENGTH];
char lpl_basename[NAME_MAX_LENGTH];
const char *dir_playlist = settings->paths.directory_playlist;
lpl_basename[0] = '\0';

View File

@ -1268,7 +1268,7 @@ bool playlist_push(playlist_t *playlist,
if (string_is_empty(core_name))
{
static char base_path[255] = {0};
static char base_path[NAME_MAX_LENGTH] = {0};
fill_pathname_base_noext(base_path, real_core_path, sizeof(base_path));
core_name = base_path;

View File

@ -561,7 +561,7 @@ static bool content_file_list_set_info(
const char *archive_delim = NULL;
const char *ext = NULL;
char dir[PATH_MAX_LENGTH];
char name[256];
char name[NAME_MAX_LENGTH];
dir[0] = '\0';
name[0] = '\0';

View File

@ -270,7 +270,7 @@ static void task_core_backup_handler(retro_task_t *task)
break;
case CORE_BACKUP_PRE_ITERATE:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
char backup_path[PATH_MAX_LENGTH];
task_title[0] = '\0';
@ -409,7 +409,7 @@ static void task_core_backup_handler(retro_task_t *task)
* history size limit */
if (num_backups > backup_handle->auto_backup_history_size)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -478,7 +478,7 @@ static void task_core_backup_handler(retro_task_t *task)
break;
case CORE_BACKUP_END:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -534,7 +534,7 @@ void *task_push_core_backup(
const char *core_name = NULL;
retro_task_t *task = NULL;
core_backup_handle_t *backup_handle = NULL;
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -739,7 +739,7 @@ static void task_core_restore_handler(retro_task_t *task)
break;
case CORE_RESTORE_PRE_ITERATE:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -874,7 +874,7 @@ static void task_core_restore_handler(retro_task_t *task)
break;
case CORE_RESTORE_END:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -929,7 +929,7 @@ bool task_push_core_restore(const char *backup_path, const char *dir_libretro,
retro_task_t *task = NULL;
core_backup_handle_t *backup_handle = NULL;
char core_path[PATH_MAX_LENGTH];
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
core_path[0] = '\0';
task_title[0] = '\0';

View File

@ -741,7 +741,7 @@ static void task_core_updater_download_handler(retro_task_t *task)
if (download_handle->backup_task)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -807,7 +807,7 @@ static void task_core_updater_download_handler(retro_task_t *task)
case CORE_UPDATER_DOWNLOAD_START_TRANSFER:
{
file_transfer_t *transf = NULL;
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -878,7 +878,7 @@ static void task_core_updater_download_handler(retro_task_t *task)
* callback to trigger */
if (download_handle->http_task_complete)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -938,7 +938,7 @@ static void task_core_updater_download_handler(retro_task_t *task)
break;
case CORE_UPDATER_DOWNLOAD_END:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -995,7 +995,7 @@ void *task_push_core_updater_download(
const char *path_dir_core_assets)
{
task_finder_data_t find_data;
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
char local_download_path[PATH_MAX_LENGTH];
const core_updater_list_entry_t *list_entry = NULL;
retro_task_t *task = NULL;
@ -1251,7 +1251,7 @@ static void task_update_installed_cores_handler(retro_task_t *task)
if (core_installed)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -1341,7 +1341,7 @@ static void task_update_installed_cores_handler(retro_task_t *task)
update_installed_handle->status = UPDATE_INSTALLED_CORES_ITERATE;
else
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -1394,7 +1394,7 @@ static void task_update_installed_cores_handler(retro_task_t *task)
* successfully */
if (update_installed_handle->list_size > 0)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -1660,7 +1660,7 @@ static void task_play_feature_delivery_core_install_handler(retro_task_t *task)
bool install_active;
enum play_feature_delivery_install_status install_status;
unsigned install_progress;
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -1710,7 +1710,7 @@ static void task_play_feature_delivery_core_install_handler(retro_task_t *task)
case PLAY_FEATURE_DELIVERY_INSTALL_END:
{
const char *msg_str = msg_hash_to_str(MSG_CORE_INSTALL_FAILED);
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -1790,7 +1790,7 @@ void *task_push_play_feature_delivery_core_install(
bool mute)
{
task_finder_data_t find_data;
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
const core_updater_list_entry_t *list_entry = NULL;
retro_task_t *task = NULL;
play_feature_delivery_install_handle_t *pfd_install_handle = (play_feature_delivery_install_handle_t*)
@ -1996,7 +1996,7 @@ static void task_play_feature_delivery_switch_cores_handler(retro_task_t *task)
if (core_installed)
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -2063,7 +2063,7 @@ static void task_play_feature_delivery_switch_cores_handler(retro_task_t *task)
PLAY_FEATURE_DELIVERY_SWITCH_CORES_ITERATE;
else
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';

View File

@ -193,7 +193,7 @@ static void task_pl_manager_reset_cores_handler(retro_task_t *task)
if (entry)
{
struct playlist_entry update_entry = {0};
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -208,7 +208,7 @@ static void task_pl_manager_reset_cores_handler(retro_task_t *task)
strlcat(task_title, entry->label, sizeof(task_title));
else if (!string_is_empty(entry->path))
{
char entry_name[PATH_MAX_LENGTH];
char entry_name[NAME_MAX_LENGTH];
entry_name[0] = '\0';
fill_pathname_base_noext(entry_name, entry->path, sizeof(entry_name));
@ -236,7 +236,7 @@ static void task_pl_manager_reset_cores_handler(retro_task_t *task)
break;
case PL_MANAGER_END:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -289,8 +289,8 @@ static bool task_pl_manager_reset_cores_finder(
bool task_push_pl_manager_reset_cores(const playlist_config_t *playlist_config)
{
task_finder_data_t find_data;
char playlist_name[PATH_MAX_LENGTH];
char task_title[PATH_MAX_LENGTH];
char playlist_name[NAME_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
retro_task_t *task = task_init();
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)
calloc(1, sizeof(pl_manager_handle_t));
@ -665,7 +665,7 @@ static void task_pl_manager_clean_playlist_handler(retro_task_t *task)
break;
case PL_MANAGER_END:
{
char task_title[PATH_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
task_title[0] = '\0';
@ -719,8 +719,8 @@ bool task_push_pl_manager_clean_playlist(
const playlist_config_t *playlist_config)
{
task_finder_data_t find_data;
char playlist_name[PATH_MAX_LENGTH];
char task_title[PATH_MAX_LENGTH];
char playlist_name[NAME_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH];
retro_task_t *task = task_init();
pl_manager_handle_t *pl_manager = (pl_manager_handle_t*)
calloc(1, sizeof(pl_manager_handle_t));