diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2012-07-17 18:19:59 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2012-07-17 18:19:59 +0300 |
commit | 3778db1be53e61ff285c573af5ee468803008456 (patch) | |
tree | 1ee980d695880a3c9195fbb7caaae6dbc97d3b5e /src/liblzma/lz/lz_decoder.c | |
parent | Tests: Remove tests/test_block.c that had gotten committed accidentally. (diff) | |
download | xz-3778db1be53e61ff285c573af5ee468803008456.tar.xz |
liblzma: Make the use of lzma_allocator const-correct.
There is a tiny risk of causing breakage: If an application
assigns lzma_stream.allocator to a non-const pointer, such
code won't compile anymore. I don't know why anyone would do
such a thing though, so in practice this shouldn't cause trouble.
Thanks to Jan Kratochvil for the patch.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/lz/lz_decoder.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liblzma/lz/lz_decoder.c b/src/liblzma/lz/lz_decoder.c index d74085cf..2328a8e7 100644 --- a/src/liblzma/lz/lz_decoder.c +++ b/src/liblzma/lz/lz_decoder.c @@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder, static lzma_ret lz_decode(lzma_coder *coder, - lzma_allocator *allocator lzma_attribute((__unused__)), + const lzma_allocator *allocator lzma_attribute((__unused__)), const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size, @@ -184,7 +184,7 @@ lz_decode(lzma_coder *coder, static void -lz_decoder_end(lzma_coder *coder, lzma_allocator *allocator) +lz_decoder_end(lzma_coder *coder, const lzma_allocator *allocator) { lzma_next_end(&coder->next, allocator); lzma_free(coder->dict.buf, allocator); @@ -200,10 +200,10 @@ lz_decoder_end(lzma_coder *coder, lzma_allocator *allocator) extern lzma_ret -lzma_lz_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, +lzma_lz_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters, lzma_ret (*lz_init)(lzma_lz_decoder *lz, - lzma_allocator *allocator, const void *options, + const lzma_allocator *allocator, const void *options, lzma_lz_options *lz_options)) { // Allocate the base structure if it isn't already allocated. |