summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2014-07-13 20:21:58 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-29 12:44:36 (GMT)
commit7a92eddbcb2b2e6419062538e346908f0e502586 (patch)
treeb1985ad4a8904211f12cb07742a9d776fa28152f /Utilities/cmliblzma/liblzma/lz/lz_decoder.h
parentb2a07ca49c66665f5b51b592f44ecc4f66c7556b (diff)
downloadCMake-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/lz/lz_decoder.h')
-rw-r--r--Utilities/cmliblzma/liblzma/lz/lz_decoder.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/Utilities/cmliblzma/liblzma/lz/lz_decoder.h b/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
index 7266e80..2d19cac 100644
--- a/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
+++ b/Utilities/cmliblzma/liblzma/lz/lz_decoder.h
@@ -72,14 +72,14 @@ typedef struct {
} lzma_lz_decoder;
-#define LZMA_LZ_DECODER_INIT \
- (lzma_lz_decoder){ \
- .coder = NULL, \
- .code = NULL, \
- .reset = NULL, \
- .set_uncompressed = NULL, \
- .end = NULL, \
- }
+static const lzma_lz_decoder LZMA_LZ_DECODER_INIT =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ };
extern lzma_ret lzma_lz_decoder_init(lzma_next_coder *next,
@@ -151,13 +151,15 @@ dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len)
dict->pos += left;
} else {
+ uint32_t copy_pos;
+ uint32_t copy_size;
+
// The bigger the dictionary, the more rare this
// case occurs. We need to "wrap" the dict, thus
// we might need two memcpy() to copy all the data.
assert(dict->full == dict->size);
- const uint32_t copy_pos
- = dict->pos - distance - 1 + dict->size;
- uint32_t copy_size = dict->size - copy_pos;
+ copy_pos = dict->pos - distance - 1 + dict->size;
+ copy_size = dict->size - copy_pos;
if (copy_size < left) {
memmove(dict->buf + dict->pos, dict->buf + copy_pos,