summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma/liblzma/common/alone_decoder.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-06 13:56:41 (GMT)
committerBrad King <brad.king@kitware.com>2018-08-06 14:22:56 (GMT)
commit6166adfdd40954767f3c4e40da502285ed16a9b1 (patch)
treede3266371a950f40937f4f5a248c44244215755d /Utilities/cmliblzma/liblzma/common/alone_decoder.c
parent0a3912112d11514ba1652423e21a767507ce75fb (diff)
downloadCMake-6166adfdd40954767f3c4e40da502285ed16a9b1.zip
CMake-6166adfdd40954767f3c4e40da502285ed16a9b1.tar.gz
CMake-6166adfdd40954767f3c4e40da502285ed16a9b1.tar.bz2
liblzma: Revert "Port from C99 to C89/90"
Revert commit v3.1.0-rc1~255^2~5 (liblzma: Port from C99 to C89/90, 2014-07-13). We now compile as C99 or above except on MSVC where we will use another approach.
Diffstat (limited to 'Utilities/cmliblzma/liblzma/common/alone_decoder.c')
-rw-r--r--Utilities/cmliblzma/liblzma/common/alone_decoder.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/Utilities/cmliblzma/liblzma/common/alone_decoder.c b/Utilities/cmliblzma/liblzma/common/alone_decoder.c
index a20cf49..c25112e 100644
--- a/Utilities/cmliblzma/liblzma/common/alone_decoder.c
+++ b/Utilities/cmliblzma/liblzma/common/alone_decoder.c
@@ -126,17 +126,19 @@ alone_decode(lzma_coder *coder,
// Fall through
case SEQ_CODER_INIT: {
- lzma_ret ret;
+ if (coder->memusage > coder->memlimit)
+ return LZMA_MEMLIMIT_ERROR;
lzma_filter_info filters[2] = {
- { 0, &lzma_lzma_decoder_init, &coder->options },
- { 0, NULL, NULL }
+ {
+ .init = &lzma_lzma_decoder_init,
+ .options = &coder->options,
+ }, {
+ .init = NULL,
+ }
};
- if (coder->memusage > coder->memlimit)
- return LZMA_MEMLIMIT_ERROR;
-
- ret = lzma_next_filter_init(&coder->next,
+ const lzma_ret ret = lzma_next_filter_init(&coder->next,
allocator, filters);
if (ret != LZMA_OK)
return ret;
@@ -227,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
extern LZMA_API(lzma_ret)
lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit)
{
- lzma_next_strm_init2(lzma_alone_decoder_init, strm, memlimit, false);
+ lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false);
strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_FINISH] = true;