lzx_record_match(): Remove dead assignments to formatted_offset
[wimlib] / src / lzx-compress.c
index 81a6256eb7e8a88c67e6a6e091bd9f4131c34efe..01d3caaaa757de0d6dd47f8c5d471eed7053f48e 100644 (file)
@@ -77,9 +77,9 @@ struct lzx_codes {
 };
 
 struct lzx_freq_tables {
-       u32 main_freq_table[LZX_MAINTREE_NUM_SYMBOLS];
-       u32 len_freq_table[LZX_LENTREE_NUM_SYMBOLS];
-       u32 aligned_freq_table[LZX_ALIGNEDTREE_NUM_SYMBOLS];
+       freq_t main_freq_table[LZX_MAINTREE_NUM_SYMBOLS];
+       freq_t len_freq_table[LZX_LENTREE_NUM_SYMBOLS];
+       freq_t aligned_freq_table[LZX_ALIGNEDTREE_NUM_SYMBOLS];
 };
 
 /* Returns the LZX position slot that corresponds to a given formatted offset.
@@ -122,7 +122,7 @@ static inline unsigned lzx_get_position_slot(unsigned formatted_offset)
 
 static u32 lzx_record_literal(u8 literal, void *__main_freq_tab)
 {
-       u32 *main_freq_tab = __main_freq_tab;
+       freq_t *main_freq_tab = __main_freq_tab;
        main_freq_tab[literal]++;
        return literal;
 }
@@ -136,7 +136,6 @@ static u32 lzx_record_match(unsigned match_offset, unsigned match_len,
 {
        struct lzx_freq_tables *freq_tabs = __freq_tabs;
        struct lru_queue *queue = __queue;
-       unsigned formatted_offset;
        unsigned position_slot;
        unsigned position_footer = 0;
        u32 match;
@@ -150,23 +149,20 @@ static u32 lzx_record_match(unsigned match_offset, unsigned match_len,
 
        /* If possible, encode this offset as a repeated offset. */
        if (match_offset == queue->R0) {
-               formatted_offset = 0;
-               position_slot    = 0;
+               position_slot = 0;
        } else if (match_offset == queue->R1) {
                swap(queue->R0, queue->R1);
-               formatted_offset = 1;
-               position_slot    = 1;
+               position_slot = 1;
        } else if (match_offset == queue->R2) {
                swap(queue->R0, queue->R2);
-               formatted_offset = 2;
-               position_slot    = 2;
+               position_slot = 2;
        } else {
                /* Not a repeated offset. */
 
                /* offsets of 0, 1, and 2 are reserved for the repeated offset
                 * codes, so non-repeated offsets must be encoded as 3+.  The
                 * minimum offset is 1, so encode the offsets offset by 2. */
-               formatted_offset = match_offset + LZX_MIN_MATCH;
+               unsigned formatted_offset = match_offset + LZX_MIN_MATCH;
 
                queue->R2 = queue->R1;
                queue->R1 = queue->R0;
@@ -406,7 +402,7 @@ static int lzx_write_compressed_tree(struct output_bitstream *out,
 {
        /* Frequencies of the length symbols, including the RLE symbols (NOT the
         * actual lengths themselves). */
-       unsigned pretree_freqs[LZX_PRETREE_NUM_SYMBOLS];
+       freq_t pretree_freqs[LZX_PRETREE_NUM_SYMBOLS];
        u8 pretree_lens[LZX_PRETREE_NUM_SYMBOLS];
        u16 pretree_codewords[LZX_PRETREE_NUM_SYMBOLS];
        u8 output_syms[num_symbols * 2];