aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_decoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2007-12-09 17:06:45 +0200
committerLasse Collin <lasse.collin@tukaani.org>2007-12-09 17:06:45 +0200
commit07ac881779a8477f2c1ab112b91a129e24aa743c (patch)
treefe7f62c63b22b5942c4556ff56125cd0330129e2 /src/liblzma/common/stream_decoder.c
parentAdded a bunch of .lzma test files. (diff)
downloadxz-07ac881779a8477f2c1ab112b91a129e24aa743c.tar.xz
Take advantage of return_if_error() macro in more places.
Cleaned Subblock filter's initialization code too.
Diffstat (limited to 'src/liblzma/common/stream_decoder.c')
-rw-r--r--src/liblzma/common/stream_decoder.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c
index d8000c3d..75228888 100644
--- a/src/liblzma/common/stream_decoder.c
+++ b/src/liblzma/common/stream_decoder.c
@@ -141,14 +141,11 @@ metadata_init(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
data_init(lzma_coder *coder, lzma_allocator *allocator)
{
- lzma_ret ret = lzma_info_iter_next(&coder->iter, allocator);
- if (ret != LZMA_OK)
- return ret;
+ return_if_error(lzma_info_iter_next(&coder->iter, allocator));
- ret = lzma_info_iter_set(&coder->iter, LZMA_VLI_VALUE_UNKNOWN,
- coder->block_options.uncompressed_size);
- if (ret != LZMA_OK)
- return ret;
+ return_if_error(lzma_info_iter_set(
+ &coder->iter, LZMA_VLI_VALUE_UNKNOWN,
+ coder->block_options.uncompressed_size));
coder->block_options.total_size = coder->iter.total_size;
coder->block_options.uncompressed_size = coder->iter.uncompressed_size;
@@ -207,11 +204,9 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator,
coder->block_options.check = coder->header_flags.check;
coder->block_options.has_crc32 = coder->header_flags.has_crc32;
- const lzma_ret ret = lzma_block_header_decoder_init(
+ return_if_error(lzma_block_header_decoder_init(
&coder->block_header_decoder, allocator,
- &coder->block_options);
- if (ret != LZMA_OK)
- return ret;
+ &coder->block_options));
coder->sequence = SEQ_BLOCK_HEADER_CODE;
}