]> wimlib.net Git - wimlib/blobdiff - src/lzx-comp.c
do_add_image(): Set boot_idx directly
[wimlib] / src / lzx-comp.c
index bf120f58730e5de7798d8fdbbb4b710f5ece439a..328627de3f842f0dc0471294fa8cfcb42101931a 100644 (file)
@@ -581,7 +581,7 @@ static void do_call_insn_preprocessing(u8 uncompressed_data[],
                        i++;
                        continue;
                }
-               rel_offset = to_le32(*(int32_t*)(uncompressed_data + i + 1));
+               rel_offset = le32_to_cpu(*(int32_t*)(uncompressed_data + i + 1));
 
                if (rel_offset >= -i && rel_offset < file_size) {
                        if (rel_offset < file_size - i) {
@@ -591,7 +591,7 @@ static void do_call_insn_preprocessing(u8 uncompressed_data[],
                                /* "compensating translation" */
                                abs_offset = rel_offset - file_size;
                        }
-                       *(int32_t*)(uncompressed_data + i + 1) = to_le32(abs_offset);
+                       *(int32_t*)(uncompressed_data + i + 1) = cpu_to_le32(abs_offset);
                }
                i += 5;
        }
@@ -599,7 +599,11 @@ static void do_call_insn_preprocessing(u8 uncompressed_data[],
 
 
 static const struct lz_params lzx_lz_params = {
+
+        /* LZX_MIN_MATCH == 2, but 2-character matches are rarely useful; the
+         * minimum match for compression is set to 3 instead. */
        .min_match      = 3,
+
        .max_match      = LZX_MAX_MATCH,
        .good_match     = LZX_MAX_MATCH,
        .nice_match     = LZX_MAX_MATCH,