diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2016-11-21 20:24:50 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2016-12-28 19:59:32 +0200 |
commit | e013a337d3de77cce24360dffe956ea2339489b6 (patch) | |
tree | 3a0311088554a21f4cb19d98700e0f7b076a612a /src/liblzma/delta/delta_decoder.c | |
parent | Document --enable-sandbox configure option in INSTALL. (diff) | |
download | xz-e013a337d3de77cce24360dffe956ea2339489b6.tar.xz |
liblzma: Avoid multiple definitions of lzma_coder structures.
Only one definition was visible in a translation unit.
It avoided a few casts and temp variables but seems that
this hack doesn't work with link-time optimizations in compilers
as it's not C99/C11 compliant.
Fixes:
http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html
Diffstat (limited to 'src/liblzma/delta/delta_decoder.c')
-rw-r--r-- | src/liblzma/delta/delta_decoder.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liblzma/delta/delta_decoder.c b/src/liblzma/delta/delta_decoder.c index 726d0239..6859afa5 100644 --- a/src/liblzma/delta/delta_decoder.c +++ b/src/liblzma/delta/delta_decoder.c @@ -15,7 +15,7 @@ static void -decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size) +decode_buffer(lzma_delta_coder *coder, uint8_t *buffer, size_t size) { const size_t distance = coder->distance; @@ -27,11 +27,13 @@ decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size) static lzma_ret -delta_decode(lzma_coder *coder, const lzma_allocator *allocator, +delta_decode(void *coder_ptr, const lzma_allocator *allocator, 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, lzma_action action) { + lzma_delta_coder *coder = coder_ptr; + assert(coder->next.code != NULL); const size_t out_start = *out_pos; |