mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(task_content.c) Cleanups - remove error_string where not used
This commit is contained in:
parent
cda235d124
commit
3b2b4ea49d
@ -490,8 +490,8 @@ static bool content_file_list_set_info(
|
|||||||
struct retro_game_info *game_info = NULL;
|
struct retro_game_info *game_info = NULL;
|
||||||
struct retro_game_info_ext *game_info_ext = NULL;
|
struct retro_game_info_ext *game_info_ext = NULL;
|
||||||
|
|
||||||
if (!file_list ||
|
if ( !file_list
|
||||||
(idx >= file_list->size))
|
|| (idx >= file_list->size))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!(file_info = &file_list->entries[idx]))
|
if (!(file_info = &file_list->entries[idx]))
|
||||||
@ -540,10 +540,10 @@ static bool content_file_list_set_info(
|
|||||||
* extended path info to cores */
|
* extended path info to cores */
|
||||||
if (!string_is_empty(path))
|
if (!string_is_empty(path))
|
||||||
{
|
{
|
||||||
|
char dir [PATH_MAX_LENGTH];
|
||||||
|
char name[NAME_MAX_LENGTH];
|
||||||
const char *archive_delim = NULL;
|
const char *archive_delim = NULL;
|
||||||
const char *ext = NULL;
|
const char *ext = NULL;
|
||||||
char dir[PATH_MAX_LENGTH];
|
|
||||||
char name[NAME_MAX_LENGTH];
|
|
||||||
|
|
||||||
dir[0] = '\0';
|
dir[0] = '\0';
|
||||||
name[0] = '\0';
|
name[0] = '\0';
|
||||||
@ -567,13 +567,14 @@ static bool content_file_list_set_info(
|
|||||||
if ((archive_delim = path_get_archive_delim(path)))
|
if ((archive_delim = path_get_archive_delim(path)))
|
||||||
{
|
{
|
||||||
char archive_path[PATH_MAX_LENGTH];
|
char archive_path[PATH_MAX_LENGTH];
|
||||||
size_t len;
|
size_t len = 0;
|
||||||
|
|
||||||
archive_path[0] = '\0';
|
archive_path[0] = '\0';
|
||||||
|
|
||||||
/* Extract path of parent archive */
|
/* Extract path of parent archive */
|
||||||
len = (size_t)(1 + archive_delim - path);
|
if ((len = (size_t)(1 + archive_delim - path))
|
||||||
len = (len < PATH_MAX_LENGTH) ? len : PATH_MAX_LENGTH;
|
>= PATH_MAX_LENGTH)
|
||||||
|
len = PATH_MAX_LENGTH;
|
||||||
|
|
||||||
strlcpy(archive_path, path, len * sizeof(char));
|
strlcpy(archive_path, path, len * sizeof(char));
|
||||||
if (!string_is_empty(archive_path))
|
if (!string_is_empty(archive_path))
|
||||||
@ -1818,8 +1819,8 @@ static bool command_event_cmd_exec(
|
|||||||
content_state_t *p_content,
|
content_state_t *p_content,
|
||||||
const char *data,
|
const char *data,
|
||||||
content_information_ctx_t *content_ctx,
|
content_information_ctx_t *content_ctx,
|
||||||
bool launched_from_cli,
|
bool launched_from_cli
|
||||||
char **error_string)
|
)
|
||||||
{
|
{
|
||||||
if (path_get(RARCH_PATH_CONTENT) != data)
|
if (path_get(RARCH_PATH_CONTENT) != data)
|
||||||
{
|
{
|
||||||
@ -1909,7 +1910,6 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
|||||||
content_information_ctx_t content_ctx;
|
content_information_ctx_t content_ctx;
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||||
@ -1967,17 +1967,6 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
|||||||
if ((ret = content_load(content_info, p_content)))
|
if ((ret = content_load(content_info, p_content)))
|
||||||
task_push_to_history_list(p_content, false, false, false);
|
task_push_to_history_list(p_content, false, false, false);
|
||||||
|
|
||||||
/* Handle load content failure */
|
|
||||||
if (!ret)
|
|
||||||
{
|
|
||||||
if (error_string)
|
|
||||||
{
|
|
||||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
RARCH_ERR("[Content]: %s\n", error_string);
|
|
||||||
free(error_string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content_ctx.name_ips)
|
if (content_ctx.name_ips)
|
||||||
free(content_ctx.name_ips);
|
free(content_ctx.name_ips);
|
||||||
if (content_ctx.name_bps)
|
if (content_ctx.name_bps)
|
||||||
@ -2097,7 +2086,7 @@ bool task_push_load_content_from_playlist_from_menu(
|
|||||||
* > On targets that do not support dynamic core loading,
|
* > On targets that do not support dynamic core loading,
|
||||||
* command_event_cmd_exec() will fork a new instance */
|
* command_event_cmd_exec() will fork a new instance */
|
||||||
if (!(ret = command_event_cmd_exec(p_content,
|
if (!(ret = command_event_cmd_exec(p_content,
|
||||||
fullpath, &content_ctx, false, &error_string)))
|
fullpath, &content_ctx, false)))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
#ifdef HAVE_COCOATOUCH
|
#ifdef HAVE_COCOATOUCH
|
||||||
@ -2147,7 +2136,6 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
|||||||
|
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
const char *path_dir_system = settings->paths.directory_system;
|
const char *path_dir_system = settings->paths.directory_system;
|
||||||
@ -2210,13 +2198,6 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
|||||||
if (!(ret = content_load(content_info, p_content)) ||
|
if (!(ret = content_load(content_info, p_content)) ||
|
||||||
!(ret = (runloop_st->current_core_type != CORE_TYPE_DUMMY)))
|
!(ret = (runloop_st->current_core_type != CORE_TYPE_DUMMY)))
|
||||||
{
|
{
|
||||||
if (error_string)
|
|
||||||
{
|
|
||||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
RARCH_ERR("[Content]: %s\n", error_string);
|
|
||||||
free(error_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
retroarch_menu_running();
|
retroarch_menu_running();
|
||||||
#endif
|
#endif
|
||||||
@ -2279,7 +2260,6 @@ bool task_push_load_contentless_core_from_menu(
|
|||||||
content_information_ctx_t content_ctx = {0};
|
content_information_ctx_t content_ctx = {0};
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
|
||||||
#if defined(HAVE_DYNAMIC)
|
#if defined(HAVE_DYNAMIC)
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
#endif
|
#endif
|
||||||
@ -2322,15 +2302,6 @@ bool task_push_load_contentless_core_from_menu(
|
|||||||
if (!(ret = content_load(&content_info, p_content)) ||
|
if (!(ret = content_load(&content_info, p_content)) ||
|
||||||
!(ret = (runloop_st->current_core_type != CORE_TYPE_DUMMY)))
|
!(ret = (runloop_st->current_core_type != CORE_TYPE_DUMMY)))
|
||||||
{
|
{
|
||||||
if (error_string)
|
|
||||||
{
|
|
||||||
runloop_msg_queue_push(error_string, 2, 90,
|
|
||||||
true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
|
|
||||||
MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
RARCH_ERR("[Content]: %s\n", error_string);
|
|
||||||
free(error_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
retroarch_menu_running();
|
retroarch_menu_running();
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -2346,7 +2317,7 @@ bool task_push_load_contentless_core_from_menu(
|
|||||||
* future devs who may wish to implement this... */
|
* future devs who may wish to implement this... */
|
||||||
command_event_cmd_exec(p_content,
|
command_event_cmd_exec(p_content,
|
||||||
path_get(RARCH_PATH_CONTENT), &content_ctx,
|
path_get(RARCH_PATH_CONTENT), &content_ctx,
|
||||||
false, &error_string);
|
false);
|
||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2380,7 +2351,6 @@ bool task_push_load_content_with_new_core_from_menu(
|
|||||||
|
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char *error_string = NULL;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
||||||
@ -2449,13 +2419,6 @@ bool task_push_load_content_with_new_core_from_menu(
|
|||||||
/* Loads content into currently selected core. */
|
/* Loads content into currently selected core. */
|
||||||
if (!(ret = content_load(content_info, p_content)))
|
if (!(ret = content_load(content_info, p_content)))
|
||||||
{
|
{
|
||||||
if (error_string)
|
|
||||||
{
|
|
||||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
RARCH_ERR("[Content]: %s\n", error_string);
|
|
||||||
free(error_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
retroarch_menu_running();
|
retroarch_menu_running();
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -2464,7 +2427,7 @@ bool task_push_load_content_with_new_core_from_menu(
|
|||||||
#else
|
#else
|
||||||
command_event_cmd_exec(p_content,
|
command_event_cmd_exec(p_content,
|
||||||
path_get(RARCH_PATH_CONTENT), &content_ctx,
|
path_get(RARCH_PATH_CONTENT), &content_ctx,
|
||||||
false, &error_string);
|
false);
|
||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2498,7 +2461,6 @@ static bool task_load_content_internal(
|
|||||||
|
|
||||||
content_state_t *p_content = content_state_get_ptr();
|
content_state_t *p_content = content_state_get_ptr();
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
char *error_string = NULL;
|
|
||||||
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
runloop_state_t *runloop_st = runloop_state_get_ptr();
|
||||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -2591,19 +2553,7 @@ end:
|
|||||||
if (content_ctx.valid_extensions)
|
if (content_ctx.valid_extensions)
|
||||||
free(content_ctx.valid_extensions);
|
free(content_ctx.valid_extensions);
|
||||||
|
|
||||||
if (!ret)
|
return ret;
|
||||||
{
|
|
||||||
if (error_string)
|
|
||||||
{
|
|
||||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
|
||||||
RARCH_ERR("[Content]: %s\n", error_string);
|
|
||||||
free(error_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool task_push_load_content_with_new_core_from_companion_ui(
|
bool task_push_load_content_with_new_core_from_companion_ui(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user