mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
(core_info.c) Cleanups
This commit is contained in:
parent
fb5c58d65f
commit
c501ee6057
48
core_info.c
48
core_info.c
@ -221,7 +221,7 @@ static core_info_list_t *core_info_list_new(void)
|
|||||||
if (!core_info)
|
if (!core_info)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
core_info_list->list = core_info;
|
core_info_list->list = core_info;
|
||||||
core_info_list->count = contents->size;
|
core_info_list->count = contents->size;
|
||||||
|
|
||||||
for (i = 0; i < contents->size; i++)
|
for (i = 0; i < contents->size; i++)
|
||||||
@ -692,10 +692,8 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
|||||||
bool core_info_unsupported_content_path(const char *path)
|
bool core_info_unsupported_content_path(const char *path)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
const char *delim;
|
|
||||||
const char *archive_path = NULL;
|
const char *archive_path = NULL;
|
||||||
|
const char *delim = path_get_archive_delim(path);
|
||||||
delim = path_get_archive_delim(path);
|
|
||||||
|
|
||||||
if (delim)
|
if (delim)
|
||||||
archive_path = delim - 1;
|
archive_path = delim - 1;
|
||||||
@ -720,9 +718,8 @@ bool core_info_unsupported_content_path(const char *path)
|
|||||||
for (i = 0; i < core_info_curr_list->count; i++)
|
for (i = 0; i < core_info_curr_list->count; i++)
|
||||||
{
|
{
|
||||||
const core_info_t *info = &core_info_curr_list->list[i];
|
const core_info_t *info = &core_info_curr_list->list[i];
|
||||||
bool path_in_ext_list = string_list_find_elem(info->supported_extensions_list, path_get_extension(path));
|
|
||||||
|
|
||||||
if (path_in_ext_list)
|
if (string_list_find_elem(info->supported_extensions_list, path_get_extension(path)))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,8 +729,8 @@ bool core_info_unsupported_content_path(const char *path)
|
|||||||
bool core_info_database_supports_content_path(const char *database_path, const char *path)
|
bool core_info_database_supports_content_path(const char *database_path, const char *path)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
char *database;
|
char *database = NULL;
|
||||||
const char *delim;
|
const char *delim = NULL;
|
||||||
const char *archive_path = NULL;
|
const char *archive_path = NULL;
|
||||||
|
|
||||||
if (!core_info_curr_list)
|
if (!core_info_curr_list)
|
||||||
@ -756,31 +753,30 @@ bool core_info_database_supports_content_path(const char *database_path, const c
|
|||||||
{
|
{
|
||||||
const core_info_t *info = &core_info_curr_list->list[i];
|
const core_info_t *info = &core_info_curr_list->list[i];
|
||||||
|
|
||||||
if (string_list_find_elem(info->databases_list, database))
|
if (!string_list_find_elem(info->databases_list, database))
|
||||||
{
|
continue;
|
||||||
if (string_list_find_elem(info->supported_extensions_list, "zip") ||
|
|
||||||
string_list_find_elem(info->supported_extensions_list, "7z"))
|
if ( !string_list_find_elem(info->supported_extensions_list, "zip")
|
||||||
{
|
&& !string_list_find_elem(info->supported_extensions_list, "7z"))
|
||||||
free(database);
|
continue;
|
||||||
return false;
|
|
||||||
}
|
free(database);
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < core_info_curr_list->count; i++)
|
for (i = 0; i < core_info_curr_list->count; i++)
|
||||||
{
|
{
|
||||||
const core_info_t *info = &core_info_curr_list->list[i];
|
const core_info_t *info = &core_info_curr_list->list[i];
|
||||||
bool path_in_ext_list = string_list_find_elem(info->supported_extensions_list, path_get_extension(path));
|
|
||||||
|
|
||||||
if (path_in_ext_list)
|
if (!string_list_find_elem(info->supported_extensions_list, path_get_extension(path)))
|
||||||
{
|
continue;
|
||||||
if (string_list_find_elem(info->databases_list, database))
|
|
||||||
{
|
if (!string_list_find_elem(info->databases_list, database))
|
||||||
free(database);
|
continue;
|
||||||
return true;
|
|
||||||
}
|
free(database);
|
||||||
}
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(database);
|
free(database);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user