summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma/liblzma/lzma/lzma2_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/lzma/lzma2_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/lzma/lzma2_decoder.c')
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c b/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
index ca14c4a..3e42575 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
@@ -224,8 +224,6 @@ static lzma_ret
lzma2_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
const void *opt, lzma_lz_options *lz_options)
{
- const lzma_options_lzma *options = opt;
-
if (lz->coder == NULL) {
lz->coder = lzma_alloc(sizeof(lzma_coder), allocator);
if (lz->coder == NULL)
@@ -237,6 +235,8 @@ lzma2_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
lz->coder->lzma = LZMA_LZ_DECODER_INIT;
}
+ const lzma_options_lzma *options = opt;
+
lz->coder->sequence = SEQ_CONTROL;
lz->coder->need_properties = true;
lz->coder->need_dictionary_reset = options->preset_dict == NULL
@@ -272,8 +272,6 @@ extern lzma_ret
lzma_lzma2_props_decode(void **options, lzma_allocator *allocator,
const uint8_t *props, size_t props_size)
{
- lzma_options_lzma *opt;
-
if (props_size != 1)
return LZMA_OPTIONS_ERROR;
@@ -285,7 +283,8 @@ lzma_lzma2_props_decode(void **options, lzma_allocator *allocator,
if (props[0] > 40)
return LZMA_OPTIONS_ERROR;
- opt = lzma_alloc(sizeof(lzma_options_lzma), allocator);
+ lzma_options_lzma *opt = lzma_alloc(
+ sizeof(lzma_options_lzma), allocator);
if (opt == NULL)
return LZMA_MEM_ERROR;