Deleted Added
full compact
26c26
< struct lzma_coder_s {
---
> typedef struct {
35c35
< };
---
> } lzma_coder;
160c160
< lz_encode(lzma_coder *coder, const lzma_allocator *allocator,
---
> lz_encode(void *coder_ptr, const lzma_allocator *allocator,
165a166,167
> lzma_coder *coder = coder_ptr;
>
484c486
< lz_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
---
> lz_encoder_end(void *coder_ptr, const lzma_allocator *allocator)
485a488,489
> lzma_coder *coder = coder_ptr;
>
503c507
< lz_encoder_update(lzma_coder *coder, const lzma_allocator *allocator,
---
> lz_encoder_update(void *coder_ptr, const lzma_allocator *allocator,
506a511,512
> lzma_coder *coder = coder_ptr;
>
531,533c537,540
< if (next->coder == NULL) {
< next->coder = lzma_alloc(sizeof(lzma_coder), allocator);
< if (next->coder == NULL)
---
> lzma_coder *coder = next->coder;
> if (coder == NULL) {
> coder = lzma_alloc(sizeof(lzma_coder), allocator);
> if (coder == NULL)
535a543
> next->coder = coder;
540,542c548,550
< next->coder->lz.coder = NULL;
< next->coder->lz.code = NULL;
< next->coder->lz.end = NULL;
---
> coder->lz.coder = NULL;
> coder->lz.code = NULL;
> coder->lz.end = NULL;
544,548c552,560
< next->coder->mf.buffer = NULL;
< next->coder->mf.hash = NULL;
< next->coder->mf.son = NULL;
< next->coder->mf.hash_count = 0;
< next->coder->mf.sons_count = 0;
---
> // mf.size is initialized to silence Valgrind
> // when used on optimized binaries (GCC may reorder
> // code in a way that Valgrind gets unhappy).
> coder->mf.buffer = NULL;
> coder->mf.size = 0;
> coder->mf.hash = NULL;
> coder->mf.son = NULL;
> coder->mf.hash_count = 0;
> coder->mf.sons_count = 0;
550c562
< next->coder->next = LZMA_NEXT_CODER_INIT;
---
> coder->next = LZMA_NEXT_CODER_INIT;
555c567
< return_if_error(lz_init(&next->coder->lz, allocator,
---
> return_if_error(lz_init(&coder->lz, allocator,
558c570
< // Setup the size information into next->coder->mf and deallocate
---
> // Setup the size information into coder->mf and deallocate
560c572
< if (lz_encoder_prepare(&next->coder->mf, allocator, &lz_options))
---
> if (lz_encoder_prepare(&coder->mf, allocator, &lz_options))
565c577
< if (lz_encoder_init(&next->coder->mf, allocator, &lz_options))
---
> if (lz_encoder_init(&coder->mf, allocator, &lz_options))
569,570c581
< return lzma_next_filter_init(&next->coder->next, allocator,
< filters + 1);
---
> return lzma_next_filter_init(&coder->next, allocator, filters + 1);