Simplify init_subsystem function

This commit is contained in:
twinaphex 2018-10-29 04:04:03 +01:00
parent d938861f1a
commit e31c4f541a

View File

@ -658,7 +658,8 @@ error:
static const struct static const struct
retro_subsystem_info *content_file_init_subsystem( retro_subsystem_info *content_file_init_subsystem(
content_information_ctx_t *content_ctx, const struct retro_subsystem_info *subsystem_data,
size_t subsystem_size,
char **error_string, char **error_string,
bool *ret) bool *ret)
{ {
@ -666,7 +667,7 @@ retro_subsystem_info *content_file_init_subsystem(
char *msg = (char*)malloc(1024 * sizeof(char)); char *msg = (char*)malloc(1024 * sizeof(char));
struct string_list *subsystem = path_get_subsystem_list(); struct string_list *subsystem = path_get_subsystem_list();
const struct retro_subsystem_info *special = libretro_find_subsystem_info( const struct retro_subsystem_info *special = libretro_find_subsystem_info(
content_ctx->subsystem.data, content_ctx->subsystem.size, subsystem_data, subsystem_size,
path_get(RARCH_PATH_SUBSYSTEM)); path_get(RARCH_PATH_SUBSYSTEM));
msg[0] = '\0'; msg[0] = '\0';
@ -794,7 +795,8 @@ static bool content_file_init(
? true : false; ? true : false;
const struct retro_subsystem_info *special = const struct retro_subsystem_info *special =
path_is_empty(RARCH_PATH_SUBSYSTEM) path_is_empty(RARCH_PATH_SUBSYSTEM)
? NULL : content_file_init_subsystem(content_ctx, error_string, &ret); ? NULL : content_file_init_subsystem(content_ctx->subsystem.data,
content_ctx->subsystem.size, error_string, &ret);
if ( !ret || if ( !ret ||
!content_file_init_set_attribs(content, special, content_ctx, error_string)) !content_file_init_set_attribs(content, special, content_ctx, error_string))
return false; return false;