Swap XPRESS and LZX constants
authorEric Biggers <ebiggers3@gmail.com>
Thu, 24 Apr 2014 19:08:46 +0000 (14:08 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 24 Apr 2014 19:08:46 +0000 (14:08 -0500)
NEWS
include/wimlib.h
src/lookup_table.c
src/write.c

diff --git a/NEWS b/NEWS
index 82fd8ad..2eef07b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,11 @@ Version 1.6.3-BETA:
        wimcapture and wimapply, respectively, for more information.
 
        The shared library version has been bumped up; however, there are only
-       small incompatibilities:
+       a few incompatibilities:
+
+               - WIMLIB_COMPRESSION_TYPE_XPRESS is now 1 and
+                 WIMLIB_COMPRESSION_TYPE_LZX is now 2 (so it's the same as
+                 WIMGAPI).
 
                - 'struct' wimlib_capture_config has been removed.  The library
                  now takes the path to the configuration file directly.  This
index b47251f..77fe0ff 100644 (file)
@@ -410,11 +410,11 @@ enum wimlib_compression_type {
        /** The WIM does not include any compressed resources. */
        WIMLIB_COMPRESSION_TYPE_NONE = 0,
 
-       /** Compressed resources in the WIM use LZX compression. */
-       WIMLIB_COMPRESSION_TYPE_LZX = 1,
-
        /** Compressed resources in the WIM use XPRESS compression. */
-       WIMLIB_COMPRESSION_TYPE_XPRESS = 2,
+       WIMLIB_COMPRESSION_TYPE_XPRESS = 1,
+
+       /** Compressed resources in the WIM use LZX compression. */
+       WIMLIB_COMPRESSION_TYPE_LZX = 2,
 
        /** Compressed resources in the WIM use LZMS compression.  Note: LZMS
         * compression is only compatible with wimlib v1.6.0 and later and with
index 098a8aa..2cca979 100644 (file)
@@ -774,8 +774,8 @@ read_wim_lookup_table(WIMStruct *wim)
                        /* Compression format numbers must be the same as in
                         * WIMGAPI to be compatible here.  */
                        BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_NONE != 0);
-                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZX != 1);
-                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_XPRESS != 2);
+                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_XPRESS != 1);
+                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZX != 2);
                        BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZMS != 3);
                        cur_rspec->compression_type = le32_to_cpu(hdr.compression_format);
 
index 07b5575..bfa5d2e 100644 (file)
@@ -569,8 +569,8 @@ end_chunk_table(struct write_streams_ctx *ctx, u64 res_actual_size,
                        hdr.chunk_size = cpu_to_le32(ctx->out_chunk_size);
                        hdr.compression_format = cpu_to_le32(ctx->out_ctype);
 
-                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZX != 1);
-                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_XPRESS != 2);
+                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_XPRESS != 1);
+                       BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZX != 2);
                        BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_LZMS != 3);
 
                        ret = full_pwrite(ctx->out_fd, &hdr, sizeof(hdr),