(libretro-common) Cleanup/style nits for archive_file_{7z/zlib}

This commit is contained in:
twinaphex 2016-12-19 00:12:06 +01:00
parent e639f12e35
commit 89820220b7
2 changed files with 14 additions and 12 deletions

View File

@ -58,17 +58,15 @@ static void* sevenzip_stream_new(void)
struct sevenzip_context_t *sevenzip_context =
(struct sevenzip_context_t*)calloc(1, sizeof(struct sevenzip_context_t));
memset(sevenzip_context, 0, sizeof(struct sevenzip_context_t));
/* These are the allocation routines - currently using
* the non-standard 7zip choices. */
sevenzip_context->allocImp.Alloc = SzAlloc;
sevenzip_context->allocImp.Free = SzFree;
sevenzip_context->allocTempImp.Alloc = SzAllocTemp;
sevenzip_context->allocTempImp.Free = SzFreeTemp;
sevenzip_context->block_index = 0xFFFFFFFF;
sevenzip_context->output = NULL;
sevenzip_context->handle = NULL;
sevenzip_context->block_index = 0xFFFFFFFF;
sevenzip_context->output = NULL;
sevenzip_context->handle = NULL;
return sevenzip_context;
}
@ -83,7 +81,7 @@ static void sevenzip_stream_free(void *data)
if (sevenzip_context->output)
{
IAlloc_Free(&sevenzip_context->allocImp, sevenzip_context->output);
sevenzip_context->output = NULL;
sevenzip_context->output = NULL;
sevenzip_context->handle->data = NULL;
}
@ -262,7 +260,7 @@ static int sevenzip_stream_decompress_data_to_file_iterate(void *data)
struct sevenzip_context_t *sevenzip_context =
(struct sevenzip_context_t*)data;
SRes res = SZ_ERROR_FAIL;
SRes res = SZ_ERROR_FAIL;
size_t output_size = 0;
size_t offset = 0;
size_t outSizeProcessed = 0;

View File

@ -57,7 +57,9 @@ static bool zlib_stream_decompress_data_to_file_init(
if (!handle)
return false;
if (!(handle->stream = zlib_inflate_backend.stream_new()))
handle->stream = zlib_inflate_backend.stream_new();
if (!handle->stream)
goto error;
if (zlib_inflate_backend.define)
@ -123,10 +125,12 @@ static bool zip_file_decompressed_handle(
handle, cdata, csize, size))
return false;
do{
do
{
ret = handle->backend->stream_decompress_data_to_file_iterate(
handle->stream);
}while(ret == 0);
#if 0
handle->real_checksum = handle->backend->stream_crc_calculate(0,
handle->data, size);
@ -231,11 +235,11 @@ static int zip_file_read(
const char *optional_outfile)
{
file_archive_transfer_t zlib;
bool returnerr = true;
int ret = 0;
struct archive_extract_userdata userdata = {{0}};
bool returnerr = true;
int ret = 0;
zlib.type = ARCHIVE_TRANSFER_INIT;
zlib.type = ARCHIVE_TRANSFER_INIT;
userdata.decomp_state.needle = NULL;
userdata.decomp_state.opt_file = NULL;