aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-09-11 09:25:09 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-09-11 09:25:09 +0300
commit18a4233a53d9b82abac7db7d7804684c5fea9c2c (patch)
tree4b316054c2b0ad72284cca4ce41edb3402b45598 /src
parentAdd OS/2-specific code to physmem.h. (diff)
downloadxz-18a4233a53d9b82abac7db7d7804684c5fea9c2c.tar.xz
Fix a couple of warnings.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/common/stream_decoder.c2
-rw-r--r--src/liblzma/lz/lz_encoder.c5
-rw-r--r--src/liblzma/lzma/lzma_encoder.c2
-rw-r--r--src/liblzma/lzma/lzma_encoder_optimum_normal.c8
4 files changed, 7 insertions, 10 deletions
diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c
index dcc047d9..680fc53e 100644
--- a/src/liblzma/common/stream_decoder.c
+++ b/src/liblzma/common/stream_decoder.c
@@ -358,7 +358,7 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator,
return LZMA_PROG_ERROR;
}
- return LZMA_OK;
+ // Never reached
}
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c
index 5437546d..5fd03e84 100644
--- a/src/liblzma/lz/lz_encoder.c
+++ b/src/liblzma/lz/lz_encoder.c
@@ -84,23 +84,20 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
// (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;
diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c
index bda194cd..e9836978 100644
--- a/src/liblzma/lzma/lzma_encoder.c
+++ b/src/liblzma/lzma/lzma_encoder.c
@@ -486,7 +486,7 @@ lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
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;
diff --git a/src/liblzma/lzma/lzma_encoder_optimum_normal.c b/src/liblzma/lzma/lzma_encoder_optimum_normal.c
index cb9a1b9d..4e3754b0 100644
--- a/src/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/src/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -455,7 +455,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
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;
@@ -579,7 +579,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
--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;
@@ -657,7 +657,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
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;
@@ -753,7 +753,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
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;