]> wimlib.net Git - wimlib/blobdiff - src/lzx-decompress.c
make_huffman_decode_table(): Add SSE2 entry filling (with aliasing handled correctly)
[wimlib] / src / lzx-decompress.c
index 456602675a718478dea825693fdd89588efb293b..93ab84137be886c773757bdb86e86c22b2abcad4 100644 (file)
  * succeed.
  */
 
-#include "util.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include "wimlib.h"
-#include "lzx.h"
-#include "decompress.h"
+#include "wimlib/decompress.h"
+#include "wimlib/lzx.h"
+#include "wimlib/util.h"
+
 #include <string.h>
 
 /* Huffman decoding tables and maps from symbols to code lengths. */
 struct lzx_tables {
 
        u16 maintree_decode_table[(1 << LZX_MAINTREE_TABLEBITS) +
-                                       (LZX_MAINTREE_NUM_SYMBOLS * 2)];
+                                       (LZX_MAINTREE_NUM_SYMBOLS * 2)]
+                                       _aligned_attribute(DECODE_TABLE_ALIGNMENT);
        u8 maintree_lens[LZX_MAINTREE_NUM_SYMBOLS];
 
 
        u16 lentree_decode_table[(1 << LZX_LENTREE_TABLEBITS) +
-                                       (LZX_LENTREE_NUM_SYMBOLS * 2)];
+                                       (LZX_LENTREE_NUM_SYMBOLS * 2)]
+                                       _aligned_attribute(DECODE_TABLE_ALIGNMENT);
        u8 lentree_lens[LZX_LENTREE_NUM_SYMBOLS];
 
 
        u16 alignedtree_decode_table[(1 << LZX_ALIGNEDTREE_TABLEBITS) +
-                                       (LZX_ALIGNEDTREE_NUM_SYMBOLS * 2)];
+                                       (LZX_ALIGNEDTREE_NUM_SYMBOLS * 2)]
+                                       _aligned_attribute(DECODE_TABLE_ALIGNMENT);
        u8 alignedtree_lens[LZX_ALIGNEDTREE_NUM_SYMBOLS];
-};
+} _aligned_attribute(DECODE_TABLE_ALIGNMENT);
 
 
 /*
@@ -684,10 +692,10 @@ lzx_decode_match(unsigned main_element, int block_type,
 
 static void
 undo_call_insn_translation(u32 *call_insn_target, int input_pos,
-                          int32_t file_size)
+                          s32 file_size)
 {
-       int32_t abs_offset;
-       int32_t rel_offset;
+       s32 abs_offset;
+       s32 rel_offset;
 
        abs_offset = le32_to_cpu(*call_insn_target);
        if (abs_offset >= -input_pos && abs_offset < file_size) {