task_content.c - small cleanups, initialize variables being passed
This commit is contained in:
parent
e24ca9da66
commit
4b77ad663a
|
@ -660,24 +660,20 @@ static bool content_file_list_set_info(
|
|||
* (see patch_content function) if soft patching has not been
|
||||
* blocked by the user.
|
||||
*
|
||||
* Returns: true if successful, false on error.
|
||||
* Returns: non-0 if successful, 0 on error.
|
||||
**/
|
||||
static bool content_file_load_into_memory(
|
||||
static size_t content_file_load_into_memory(
|
||||
content_information_ctx_t *content_ctx,
|
||||
content_state_t *p_content,
|
||||
const char *content_path,
|
||||
bool content_compressed,
|
||||
size_t idx,
|
||||
enum rarch_content_type first_content_type,
|
||||
uint8_t **data,
|
||||
size_t *data_size)
|
||||
uint8_t **data)
|
||||
{
|
||||
uint8_t *content_data = NULL;
|
||||
int64_t content_size = 0;
|
||||
|
||||
*data = NULL;
|
||||
*data_size = 0;
|
||||
|
||||
RARCH_LOG("[Content] %s: \"%s\".\n",
|
||||
msg_hash_to_str(MSG_LOADING_CONTENT_FILE), content_path);
|
||||
|
||||
|
@ -687,16 +683,16 @@ static bool content_file_load_into_memory(
|
|||
{
|
||||
if (!file_archive_compressed_read(content_path,
|
||||
(void**)&content_data, NULL, &content_size))
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!filestream_read_file(content_path,
|
||||
(void**)&content_data, &content_size))
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
if (content_size < 0)
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
/* First content file is significant: attempt to do
|
||||
* soft patching, CRC checking, etc. */
|
||||
|
@ -752,9 +748,8 @@ static bool content_file_load_into_memory(
|
|||
}
|
||||
|
||||
*data = content_data;
|
||||
*data_size = (size_t)content_size;
|
||||
|
||||
return true;
|
||||
return (size_t)content_size;
|
||||
}
|
||||
|
||||
#ifdef HAVE_COMPRESSION
|
||||
|
@ -818,9 +813,6 @@ static void content_file_get_path(
|
|||
bool path_is_inside_archive;
|
||||
const char *content_path = content->elems[idx].data;
|
||||
|
||||
*path = NULL;
|
||||
*path_is_compressed = false;
|
||||
|
||||
if (string_is_empty(content_path))
|
||||
return;
|
||||
|
||||
|
@ -912,7 +904,7 @@ static void content_file_apply_overrides(
|
|||
content->elems[idx].attr.i |= BLCK_NEED_FULLPATH;
|
||||
if (required)
|
||||
content->elems[idx].attr.i |= BLCK_REQUIRED;
|
||||
if ((persistent || override->persistent_data))
|
||||
if (persistent || override->persistent_data)
|
||||
content->elems[idx].attr.i |= BLCK_PERSISTENT;
|
||||
}
|
||||
}
|
||||
|
@ -983,10 +975,12 @@ static bool content_file_load(
|
|||
/* Doesn't need fullpath? */
|
||||
if (!((content->elems[i].attr.i & BLCK_NEED_FULLPATH) != 0))
|
||||
{
|
||||
if (!content_file_load_into_memory(
|
||||
content_data = NULL;
|
||||
content_size = 0;
|
||||
if ((content_size = content_file_load_into_memory(
|
||||
content_ctx, p_content, content_path,
|
||||
content_compressed, i, first_content_type,
|
||||
&content_data, &content_size))
|
||||
&content_data)) == 0)
|
||||
{
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
snprintf(msg, sizeof(msg), "%s \"%s\"\n",
|
||||
|
@ -2648,17 +2642,17 @@ static bool task_load_content_internal_wrap(
|
|||
bool load_from_companion_ui)
|
||||
{
|
||||
/* Load content */
|
||||
if (!task_load_content_internal(content_info, true, false,
|
||||
if (task_load_content_internal(content_info, true, false,
|
||||
load_from_companion_ui))
|
||||
goto error;
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
/* Push Quick Menu onto menu stack */
|
||||
if (type != CORE_TYPE_DUMMY)
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
error:
|
||||
#ifdef HAVE_MENU
|
||||
retroarch_menu_running();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue