Revert "(content.c) Cleanups"

This reverts commit aa5e19c505e7b3f3d8585e6291fbcf0b56810348.
This commit is contained in:
twinaphex 2015-03-18 05:06:01 +01:00
parent aa5e19c505
commit 82c1ebf8d5

View File

@ -181,11 +181,13 @@ bool save_state(const char *path)
bool load_state(const char *path)
{
unsigned i;
ssize_t size;
unsigned num_blocks = 0;
bool ret = true;
void *buf = NULL;
struct sram_block *blocks = NULL;
bool ret = read_file(path, &buf, &size);
ssize_t size;
ret = read_file(path, &buf, &size);
RARCH_LOG("Loading state: \"%s\".\n", path);
@ -420,16 +422,20 @@ static bool load_content(const struct retro_subsystem_info *special,
{
unsigned i;
bool ret = true;
struct string_list* additional_path_allocs = string_list_new();
struct retro_game_info *info = (struct retro_game_info*)
calloc(content->size, sizeof(*info));
if (!info)
{
string_list_free(additional_path_allocs);
return false;
}
for (i = 0; i < content->size; i++)
{
const char *path = content->elems[i].data;
int attr = content->elems[i].attr.i;
const char *path = content->elems[i].data;
int attr = content->elems[i].attr.i;
bool need_fullpath = attr & 2;
bool require_content = attr & 4;
@ -453,17 +459,11 @@ static bool load_content(const struct retro_subsystem_info *special,
}
else
{
bool retval = false;
struct string_list* additional_path_allocs = string_list_new();
RARCH_LOG("Content loading skipped. Implementation will"
" load it on its own.\n");
retval = load_content_need_fullpath(&info[i], i,
additional_path_allocs, need_fullpath, path);
string_list_free(additional_path_allocs);
if (!retval)
if (!load_content_need_fullpath(&info[i], i,
additional_path_allocs, need_fullpath, path))
goto end;
}
}
@ -480,6 +480,7 @@ end:
for (i = 0; i < content->size; i++)
free((void*)info[i].data);
string_list_free(additional_path_allocs);
if (info)
free(info);
return ret;
@ -587,10 +588,7 @@ bool init_content_file(void)
valid_ext = special ? special->roms[i].valid_extensions :
g_extern.system.info.valid_extensions;
if (!ext)
continue;
if (!strcasecmp(ext, "zip"))
if (ext && !strcasecmp(ext, "zip"))
{
char temporary_content[PATH_MAX_LENGTH];