mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
(archive_file.c) Cleanups/style nits
This commit is contained in:
parent
1ddd0ab1d3
commit
6935ce902e
@ -213,6 +213,7 @@ static int file_archive_get_file_list_cb(
|
||||
|
||||
if (!string_list_find_elem_prefix(ext_list, ".", file_ext))
|
||||
{
|
||||
/* keep iterating */
|
||||
ret = -1;
|
||||
goto error;
|
||||
}
|
||||
@ -402,7 +403,8 @@ int file_archive_parse_file_iterate(
|
||||
if (userdata)
|
||||
{
|
||||
userdata->context = state->stream;
|
||||
strlcpy(userdata->archive_path, file, sizeof(userdata->archive_path));
|
||||
strlcpy(userdata->archive_path, file,
|
||||
sizeof(userdata->archive_path));
|
||||
}
|
||||
state->type = ARCHIVE_TRANSFER_ITERATE;
|
||||
}
|
||||
@ -414,8 +416,10 @@ int file_archive_parse_file_iterate(
|
||||
{
|
||||
const struct file_archive_file_backend *backend =
|
||||
file_archive_get_file_backend(file);
|
||||
int ret = backend->archive_parse_file_iterate_step(state,
|
||||
int ret =
|
||||
backend->archive_parse_file_iterate_step(state,
|
||||
valid_exts, userdata, file_cb);
|
||||
|
||||
if (ret != 1)
|
||||
state->type = ARCHIVE_TRANSFER_DEINIT;
|
||||
if (ret == -1)
|
||||
@ -433,6 +437,7 @@ int file_archive_parse_file_iterate(
|
||||
file_archive_free(state->handle);
|
||||
state->handle = NULL;
|
||||
}
|
||||
|
||||
if (state->stream && state->backend)
|
||||
{
|
||||
if (state->backend->stream_free)
|
||||
@ -449,7 +454,7 @@ int file_archive_parse_file_iterate(
|
||||
break;
|
||||
}
|
||||
|
||||
if (state->type == ARCHIVE_TRANSFER_DEINIT ||
|
||||
if ( state->type == ARCHIVE_TRANSFER_DEINIT ||
|
||||
state->type == ARCHIVE_TRANSFER_DEINIT_ERROR)
|
||||
return -1;
|
||||
|
||||
@ -624,11 +629,15 @@ bool file_archive_perform_mode(const char *path, const char *valid_exts,
|
||||
handle.backend = file_archive_get_file_backend(userdata->archive_path);
|
||||
handle.stream = userdata->context;
|
||||
|
||||
if (!handle.backend || !handle.backend->stream_decompress_data_to_file_init(&handle,
|
||||
if (!handle.backend)
|
||||
goto error;
|
||||
|
||||
if (!handle.backend->stream_decompress_data_to_file_init(&handle,
|
||||
cdata, csize, size))
|
||||
goto error;
|
||||
|
||||
do{
|
||||
do
|
||||
{
|
||||
ret = handle.backend->stream_decompress_data_to_file_iterate(
|
||||
handle.stream);
|
||||
}while(ret == 0);
|
||||
@ -661,12 +670,10 @@ static struct string_list *file_archive_filename_split(const char *path)
|
||||
{
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *list = string_list_new();
|
||||
const char *delim = NULL;
|
||||
const char *delim = path_get_archive_delim(path);
|
||||
|
||||
memset(&attr, 0, sizeof(attr));
|
||||
|
||||
delim = path_get_archive_delim(path);
|
||||
|
||||
if (delim)
|
||||
{
|
||||
/* add archive path to list first */
|
||||
@ -786,8 +793,9 @@ const struct file_archive_file_backend* file_archive_get_file_backend(const char
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (string_is_equal_noncase(file_ext, "zip") ||
|
||||
string_is_equal_noncase(file_ext, "apk"))
|
||||
if ( string_is_equal_noncase(file_ext, "zip")
|
||||
|| string_is_equal_noncase(file_ext, "apk")
|
||||
)
|
||||
return &zlib_backend;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user