diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2014-07-13 20:21:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-29 12:44:36 (GMT) |
commit | 7a92eddbcb2b2e6419062538e346908f0e502586 (patch) | |
tree | b1985ad4a8904211f12cb07742a9d776fa28152f /Utilities/cmliblzma/liblzma/common/alone_encoder.c | |
parent | b2a07ca49c66665f5b51b592f44ecc4f66c7556b (diff) | |
download | CMake-7a92eddbcb2b2e6419062538e346908f0e502586.zip CMake-7a92eddbcb2b2e6419062538e346908f0e502586.tar.gz CMake-7a92eddbcb2b2e6419062538e346908f0e502586.tar.bz2 |
liblzma: Port from C99 to C89/90
Remove use of designated initializers and declarations of variables
after statements. Leave "//" comments as-is for now.
Diffstat (limited to 'Utilities/cmliblzma/liblzma/common/alone_encoder.c')
-rw-r--r-- | Utilities/cmliblzma/liblzma/common/alone_encoder.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Utilities/cmliblzma/liblzma/common/alone_encoder.c b/Utilities/cmliblzma/liblzma/common/alone_encoder.c index eb1697e..62df126 100644 --- a/Utilities/cmliblzma/liblzma/common/alone_encoder.c +++ b/Utilities/cmliblzma/liblzma/common/alone_encoder.c @@ -78,6 +78,14 @@ static lzma_ret alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, const lzma_options_lzma *options) { + uint32_t d; + + // Initialize the LZMA encoder. + const lzma_filter_info filters[2] = { + { 0, &lzma_lzma_encoder_init, (void *)(options) }, + { 0, NULL, NULL } + }; + lzma_next_coder_init(&alone_encoder_init, next, allocator); if (next->coder == NULL) { @@ -107,7 +115,7 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, // one is the next unless it is UINT32_MAX. While the header would // allow any 32-bit integer, we do this to keep the decoder of liblzma // accepting the resulting files. - uint32_t d = options->dict_size - 1; + d = options->dict_size - 1; d |= d >> 2; d |= d >> 3; d |= d >> 4; @@ -121,16 +129,6 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, // - Uncompressed size (always unknown and using EOPM) memset(next->coder->header + 1 + 4, 0xFF, 8); - // Initialize the LZMA encoder. - const lzma_filter_info filters[2] = { - { - .init = &lzma_lzma_encoder_init, - .options = (void *)(options), - }, { - .init = NULL, - } - }; - return lzma_next_filter_init(&next->coder->next, allocator, filters); } @@ -148,7 +146,7 @@ lzma_alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, extern LZMA_API(lzma_ret) lzma_alone_encoder(lzma_stream *strm, const lzma_options_lzma *options) { - lzma_next_strm_init(alone_encoder_init, strm, options); + lzma_next_strm_init1(alone_encoder_init, strm, options); strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_FINISH] = true; |