From: Eric Biggers Date: Thu, 24 Apr 2014 19:08:46 +0000 (-0500) Subject: Swap XPRESS and LZX constants X-Git-Tag: v1.7.0~272 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=56dcd8f3979d785b3b3caefbb7a20013877993d0 Swap XPRESS and LZX constants --- diff --git a/NEWS b/NEWS index 82fd8adc..2eef07bd 100644 --- 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 diff --git a/include/wimlib.h b/include/wimlib.h index b47251f8..77fe0ff9 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -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 diff --git a/src/lookup_table.c b/src/lookup_table.c index 098a8aaf..2cca979c 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -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); diff --git a/src/write.c b/src/write.c index 07b55750..bfa5d2ed 100644 --- a/src/write.c +++ b/src/write.c @@ -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),