]> wimlib.net Git - wimlib/blobdiff - src/decompress.c
Refactor headers
[wimlib] / src / decompress.c
index c5e739110783e5f3921c83e3e14a6f19af649a82..c8be31973313167629606b7b567770946f864326 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 /*
- * Copyright (C) 2012 Eric Biggers
+ * Copyright (C) 2012, 2013 Eric Biggers
  *
  * This file is part of wimlib, a library for working with WIM files.
  *
  * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
-#include "decompress.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "wimlib/decompress.h"
+#include "wimlib/util.h"
+
 #include <string.h>
 
 /*
  * indices into the decoding table, and symbol entries are distinguished from
  * pointers by the fact that values less than @num_syms must be symbol values.
  */
-int make_huffman_decode_table(u16 decode_table[],  unsigned num_syms,
-                             unsigned table_bits, const u8 lens[],
-                             unsigned max_codeword_len)
+int
+make_huffman_decode_table(u16 decode_table[],  unsigned num_syms,
+                         unsigned table_bits, const u8 lens[],
+                         unsigned max_codeword_len)
 {
        unsigned len_counts[max_codeword_len + 1];
        u16 sorted_syms[num_syms];
@@ -245,7 +252,6 @@ int make_huffman_decode_table(u16 decode_table[],  unsigned num_syms,
                unsigned sym = sorted_syms[i];
                unsigned codeword_len = lens[sym];
                unsigned extra_bits = codeword_len - table_bits;
-               unsigned extra_mask;
 
                cur_codeword <<= (codeword_len - prev_codeword_len);
                prev_codeword_len = codeword_len;
@@ -295,12 +301,13 @@ int make_huffman_decode_table(u16 decode_table[],  unsigned num_syms,
 
 /* Reads a Huffman-encoded symbol from the bistream when the number of remaining
  * bits is less than the maximum codeword length. */
-int read_huffsym_near_end_of_input(struct input_bitstream *istream,
-                                  const u16 decode_table[],
-                                  const u8 lens[],
-                                  unsigned num_syms,
-                                  unsigned table_bits,
-                                  unsigned *n)
+int
+read_huffsym_near_end_of_input(struct input_bitstream *istream,
+                              const u16 decode_table[],
+                              const u8 lens[],
+                              unsigned num_syms,
+                              unsigned table_bits,
+                              unsigned *n)
 {
        unsigned bitsleft = istream->bitsleft;
        unsigned key_size;