summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmliblzma/liblzma/delta/delta_decoder.c')
-rw-r--r--Utilities/cmliblzma/liblzma/delta/delta_decoder.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/Utilities/cmliblzma/liblzma/delta/delta_decoder.c b/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
index 2cf60d5..582e58e 100644
--- a/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
+++ b/Utilities/cmliblzma/liblzma/delta/delta_decoder.c
@@ -17,9 +17,10 @@
static void
decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size)
{
+ size_t i;
const size_t distance = coder->distance;
- for (size_t i = 0; i < size; ++i) {
+ for (i = 0; i < size; ++i) {
buffer[i] += coder->history[(distance + coder->pos) & 0xFF];
coder->history[coder->pos-- & 0xFF] = buffer[i];
}
@@ -32,11 +33,12 @@ delta_decode(lzma_coder *coder, lzma_allocator *allocator,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, lzma_action action)
{
- assert(coder->next.code != NULL);
-
const size_t out_start = *out_pos;
+ lzma_ret ret;
- const lzma_ret ret = coder->next.code(coder->next.coder, allocator,
+ assert(coder->next.code != NULL);
+
+ ret = coder->next.code(coder->next.coder, allocator,
in, in_pos, in_size, out, out_pos, out_size,
action);
@@ -59,11 +61,12 @@ extern lzma_ret
lzma_delta_props_decode(void **options, lzma_allocator *allocator,
const uint8_t *props, size_t props_size)
{
+ lzma_options_delta *opt;
+
if (props_size != 1)
return LZMA_OPTIONS_ERROR;
- lzma_options_delta *opt
- = lzma_alloc(sizeof(lzma_options_delta), allocator);
+ opt = lzma_alloc(sizeof(lzma_options_delta), allocator);
if (opt == NULL)
return LZMA_MEM_ERROR;