return LZMA_PROG_ERROR;
}
- return LZMA_OK;
+ // Never reached
}
// (which I find cleanest), but we need size_t here when filling
// the history window.
size_t write_pos = coder->mf.write_pos;
- size_t in_used;
lzma_ret ret;
if (coder->next.code == NULL) {
// Not using a filter, simply memcpy() as much as possible.
- in_used = lzma_bufcpy(in, in_pos, in_size, coder->mf.buffer,
+ lzma_bufcpy(in, in_pos, in_size, coder->mf.buffer,
&write_pos, coder->mf.size);
ret = action != LZMA_RUN && *in_pos == in_size
? LZMA_STREAM_END : LZMA_OK;
} else {
- const size_t in_start = *in_pos;
ret = coder->next.code(coder->next.coder, allocator,
in, in_pos, in_size,
coder->mf.buffer, &write_pos,
coder->mf.size, action);
- in_used = *in_pos - in_start;
}
coder->mf.write_pos = write_pos;
rc_reset(&coder->rc);
// State
- coder->state = 0;
+ coder->state = STATE_LIT_LIT;
for (size_t i = 0; i < REP_DISTANCES; ++i)
coder->reps[i] = 0;
uint32_t matches_count = coder->matches_count;
uint32_t new_len = coder->longest_match_length;
uint32_t pos_prev = coder->opts[cur].pos_prev;
- uint32_t state;
+ lzma_lzma_state state;
if (coder->opts[cur].prev_1_is_literal) {
--pos_prev;
--len_test;
if (len_test >= 2) {
- uint32_t state_2 = state;
+ lzma_lzma_state state_2 = state;
update_literal(state_2);
const uint32_t pos_state_next = (position + 1) & coder->pos_mask;
len_test_2 -= len_test + 1;
if (len_test_2 >= 2) {
- uint32_t state_2 = state;
+ lzma_lzma_state state_2 = state;
update_long_rep(state_2);
uint32_t pos_state_next = (position + len_test) & coder->pos_mask;
len_test_2 -= len_test + 1;
if (len_test_2 >= 2) {
- uint32_t state_2 = state;
+ lzma_lzma_state state_2 = state;
update_match(state_2);
uint32_t pos_state_next
= (position + len_test) & coder->pos_mask;
#define memcrap(buf, size) memset(buf, 0xFD, size)
-#define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%u: %s\n", \
+#define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%d: %s\n", \
__FILE__, __LINE__, #test), abort(), 0))
#define succeed(test) expect(!(test))