]> wimlib.net Git - wimlib/commitdiff
cleanups
authorEric Biggers <ebiggers3@gmail.com>
Mon, 21 Jul 2014 02:47:09 +0000 (21:47 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 21 Jul 2014 02:47:09 +0000 (21:47 -0500)
NEWS
include/wimlib.h
include/wimlib/lz_mf.h
src/compress.c
src/lz_lcp_interval_tree.c
src/lzms-compress.c
src/lzx-compress.c

diff --git a/NEWS b/NEWS
index 921e1662fd72d16c462d8a9b682912915ef75a2a..1eef285908205e45bedaf50260667cc09105e293 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ Version 1.7.1-BETA:
        Made more improvements to the compression algorithms.
 
        The default compression mode for wimcapture is now LZX compression in
        Made more improvements to the compression algorithms.
 
        The default compression mode for wimcapture is now LZX compression in
-       its default mode, which is the the same as '--compress=maximum'.
+       its default mode, which is the same as '--compress=maximum'.
 
        You can now specify an optional integer compression level to the
        '--compress' or '--solid-compress' options; e.g.  '--compress=lzx:75'.
 
        You can now specify an optional integer compression level to the
        '--compress' or '--solid-compress' options; e.g.  '--compress=lzx:75'.
index 17e5957401a236446f85db7cefcea06a51e5a985..4ac826a5da4b9c2db97454fde3f886cf84259ae3 100644 (file)
@@ -3678,6 +3678,8 @@ wimlib_resolve_image(WIMStruct *wim,
                     const wimlib_tchar *image_name_or_num);
 
 /**
                     const wimlib_tchar *image_name_or_num);
 
 /**
+ * @ingroup G_general
+ *
  * Sets the file to which the library will print error and warning messages.
  *
  * This version of the function takes a C library <c>FILE *</c> opened for
  * Sets the file to which the library will print error and warning messages.
  *
  * This version of the function takes a C library <c>FILE *</c> opened for
@@ -3695,6 +3697,8 @@ extern int
 wimlib_set_error_file(FILE *fp);
 
 /**
 wimlib_set_error_file(FILE *fp);
 
 /**
+ * @ingroup G_general
+ *
  * Sets the path to the file to which the library will print error and warning
  * messages.  The library will open this file for appending.
  *
  * Sets the path to the file to which the library will print error and warning
  * messages.  The library will open this file for appending.
  *
@@ -4291,9 +4295,10 @@ struct wimlib_decompressor;
  * wimlib_create_compressor().
  *
  * @param ctype
  * wimlib_create_compressor().
  *
  * @param ctype
- *     Compression type for which to set the default compression level.  Or, if
- *     this is the special value -1, the default compression levels for all
- *     known compression types will be set.
+ *     Compression type for which to set the default compression level, as one
+ *     of the ::wimlib_compression_type constants.  Or, if this is the special
+ *     value -1, the default compression levels for all known compression types
+ *     will be set.
  * @param compression_level
  *     The default compression level to set.  If 0, the "default default" level
  *     is restored.  Otherwise, a higher value indicates higher compression.
  * @param compression_level
  *     The default compression level to set.  If 0, the "default default" level
  *     is restored.  Otherwise, a higher value indicates higher compression.
@@ -4306,8 +4311,7 @@ struct wimlib_decompressor;
  *     @p ctype was neither a supported compression type nor -1.
  */
 extern int
  *     @p ctype was neither a supported compression type nor -1.
  */
 extern int
-wimlib_set_default_compression_level(enum wimlib_compression_type ctype,
-                                    unsigned int compression_level);
+wimlib_set_default_compression_level(int ctype, unsigned int compression_level);
 
 /**
  * Returns the approximate number of bytes needed to allocate a compressor with
 
 /**
  * Returns the approximate number of bytes needed to allocate a compressor with
index c94fce7a5e7c7b1bd23a2e2f66bc96f6758b9db2..221418d6806270ca6c58063ed4238c0bd631ea4b 100644 (file)
@@ -83,6 +83,7 @@ struct lz_mf;
 
 /* Representation of a Lempel-Ziv match.  */
 struct lz_match {
 
 /* Representation of a Lempel-Ziv match.  */
 struct lz_match {
+
        /* The number of bytes matched.  */
        u32 len;
 
        /* The number of bytes matched.  */
        u32 len;
 
index bea8ea5a2c79c500437e5419b32e517e83fef539..75f92f13441029ae80a1400d502208659471797d 100644 (file)
@@ -65,10 +65,9 @@ compressor_ctype_valid(int ctype)
 }
 
 WIMLIBAPI int
 }
 
 WIMLIBAPI int
-wimlib_set_default_compression_level(enum wimlib_compression_type ctype,
-                                    unsigned int compression_level)
+wimlib_set_default_compression_level(int ctype, unsigned int compression_level)
 {
 {
-       if ((int)ctype == -1) {
+       if (ctype == -1) {
                for (int i = 0; i < ARRAY_LEN(default_compression_levels); i++)
                        default_compression_levels[i] = compression_level;
        } else {
                for (int i = 0; i < ARRAY_LEN(default_compression_levels); i++)
                        default_compression_levels[i] = compression_level;
        } else {
index a6c72d598e861f3848500ac3e779905bd8927482..7c0135a2701995fc61a616c491c1bca29560659d 100644 (file)
@@ -426,7 +426,7 @@ lz_lcpit_get_matches(struct lz_mf *_mf, struct lz_match matches[])
                interval = next_interval;
        }
 
                interval = next_interval;
        }
 
-       /* We're already visited the current lcp-interval.  */
+       /* We've already visited the current lcp-interval.  */
 
        /* Extract the LCP of this lcp-interval.  */
        lcp = intervals[interval] & LZ_LCPIT_LCP_MASK;
 
        /* Extract the LCP of this lcp-interval.  */
        lcp = intervals[interval] & LZ_LCPIT_LCP_MASK;
index f417fa526d93de2ee17cd36467fdab70735960f7..871c12c7aac817e6ea1cecd29e7e7ea733b7ace9 100644 (file)
@@ -873,10 +873,10 @@ lzms_match_chooser_reverse_list(struct lzms_compressor *ctx, unsigned cur_pos)
                };
 }
 
                };
 }
 
-/* This is similar to lzx_choose_near_optimal_match() in lzx-compress.c.
+/* This is similar to lzx_choose_near_optimal_item() in lzx-compress.c.
  * Read that one if you want to understand it.  */
 static struct lz_match
  * Read that one if you want to understand it.  */
 static struct lz_match
-lzms_get_near_optimal_match(struct lzms_compressor *ctx)
+lzms_get_near_optimal_item(struct lzms_compressor *ctx)
 {
        u32 num_matches;
        struct lz_match *matches;
 {
        u32 num_matches;
        struct lz_match *matches;
@@ -1133,7 +1133,7 @@ lzms_get_near_optimal_match(struct lzms_compressor *ctx)
 static void
 lzms_encode(struct lzms_compressor *ctx)
 {
 static void
 lzms_encode(struct lzms_compressor *ctx)
 {
-       struct lz_match match;
+       struct lz_match item;
 
        /* Load window into the match-finder.  */
        lz_mf_load_window(ctx->mf, ctx->window, ctx->window_size);
 
        /* Load window into the match-finder.  */
        lz_mf_load_window(ctx->mf, ctx->window, ctx->window_size);
@@ -1143,11 +1143,11 @@ lzms_encode(struct lzms_compressor *ctx)
        ctx->optimum_end_idx = 0;
 
        while (ctx->cur_window_pos != ctx->window_size) {
        ctx->optimum_end_idx = 0;
 
        while (ctx->cur_window_pos != ctx->window_size) {
-               match = lzms_get_near_optimal_match(ctx);
-               if (match.len <= 1)
+               item = lzms_get_near_optimal_item(ctx);
+               if (item.len <= 1)
                        lzms_encode_literal(ctx, ctx->window[ctx->cur_window_pos]);
                else
                        lzms_encode_literal(ctx, ctx->window[ctx->cur_window_pos]);
                else
-                       lzms_encode_lz_match(ctx, match.len, match.offset);
+                       lzms_encode_lz_match(ctx, item.len, item.offset);
        }
 }
 
        }
 }
 
index 7510457488b5025be14faf52ce6c8210e1410e49..db0e7c10f0714b2272626a77abdd71bd97fb7b2c 100644 (file)
  * that position at previous positions in the window.  With LZX, the minimum
  * match length is 2 and the maximum match length is 257.  The only restriction
  * on offsets is that LZX does not allow the last 2 bytes of the window to match
  * that position at previous positions in the window.  With LZX, the minimum
  * match length is 2 and the maximum match length is 257.  The only restriction
  * on offsets is that LZX does not allow the last 2 bytes of the window to match
- * the the beginning of the window.
+ * the beginning of the window.
  *
  * There are a number of algorithms that can be used for this, including hash
  * chains, binary trees, and suffix arrays.  Binary trees generally work well
  *
  * There are a number of algorithms that can be used for this, including hash
  * chains, binary trees, and suffix arrays.  Binary trees generally work well