]> wimlib.net Git - wimlib/blobdiff - src/decompress_common.c
lzx_common: add constant for maximum number of extra offset bits
[wimlib] / src / decompress_common.c
index c2f76955c17043f2b39dcab98d9fdb7a59e36f7b..973f467cc6e0c7ffe3a8bb557988f29e2f8bf8f7 100644 (file)
@@ -3,11 +3,21 @@
  *
  * Code for decompression shared among multiple compression formats.
  *
- * Author:  Eric Biggers
- * Year:    2012 - 2014
+ * The following copying information applies to this specific source code file:
  *
- * The author dedicates this file to the public domain.
- * You can do whatever you want with this file.
+ * Written in 2012-2015 by Eric Biggers <ebiggers3@gmail.com>
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright
+ * and related and neighboring rights to this software to the public domain
+ * worldwide via the Creative Commons Zero 1.0 Universal Public Domain
+ * Dedication (the "CC0").
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the CC0 for more details.
+ *
+ * You should have received a copy of the CC0 along with this software; if not
+ * see <http://creativecommons.org/publicdomain/zero/1.0/>.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -147,7 +157,7 @@ make_huffman_decode_table(u16 decode_table[const],
        unsigned decode_table_pos;
 
 #ifdef USE_WORD_FILL
-       const unsigned entries_per_word = WORDSIZE / sizeof(decode_table[0]);
+       const unsigned entries_per_word = WORDBYTES / sizeof(decode_table[0]);
 #endif
 
 #ifdef USE_SSE2_FILL
@@ -281,11 +291,11 @@ make_huffman_decode_table(u16 decode_table[const],
                        aliased_word_t *p;
                        unsigned n;
 
-                       BUILD_BUG_ON(WORDSIZE != 4 && WORDSIZE != 8);
+                       STATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64);
 
                        v = MAKE_DIRECT_ENTRY(sorted_syms[sym_idx], codeword_len);
                        v |= v << 16;
-                       v |= v << (WORDSIZE == 8 ? 32 : 0);
+                       v |= v << (WORDBITS == 64 ? 32 : 0);
 
                        p = (aliased_word_t *)decode_table_ptr;
                        n = stores_per_loop;
@@ -377,7 +387,7 @@ make_huffman_decode_table(u16 decode_table[const],
                                 * of as simply the root of the tree.  The
                                 * representation of these internal nodes is
                                 * simply the index of the left child combined
-                                * with the special bits 0xC000 to distingush
+                                * with the special bits 0xC000 to distinguish
                                 * the entry from direct mapping and leaf node
                                 * entries.  */
                                do {