]> wimlib.net Git - wimlib/commitdiff
A few comment fixes
authorEric Biggers <ebiggers3@gmail.com>
Sun, 8 Jun 2014 02:30:10 +0000 (21:30 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 8 Jun 2014 02:34:03 +0000 (21:34 -0500)
include/wimlib/decompress_common.h
src/compress_common.c
src/decompress_common.c

index ced37f98e5f89100929f937d9324d6be99e97f1a..c25d5e84838324efdc2d0bd77a4760c81859dbe0 100644 (file)
@@ -199,4 +199,4 @@ make_huffman_decode_table(u16 decode_table[], unsigned num_syms,
                          unsigned num_bits, const u8 lens[],
                          unsigned max_codeword_len);
 
                          unsigned num_bits, const u8 lens[],
                          unsigned max_codeword_len);
 
-#endif /* _WIMLIB_DECOMPRESS_H */
+#endif /* _WIMLIB_DECOMPRESS_COMMON_H */
index 959e1deb2d704b359acba3cdb4a8d5b1b04d3522..270b8cfe3b4ffd410a2cc02e0247e3327846f4a0 100644 (file)
@@ -552,8 +552,8 @@ gen_codewords(u32 A[restrict], u8 lens[restrict],
  * approximately (with the algorithm used here) the minimum weighted path
  * length from the root, given this constraint.
  *
  * approximately (with the algorithm used here) the minimum weighted path
  * length from the root, given this constraint.
  *
- * A canonical Huffman code satisfies the properties that a codeword
- * never lexicographically precedes a shorter codeword, and the
+ * A canonical Huffman code satisfies the properties that a longer
+ * codeword never lexicographically precedes a shorter codeword, and the
  * lexicographic ordering of codewords of the same length is the same as
  * the lexicographic ordering of the corresponding symbols.  A canonical
  * Huffman code, or more generally a canonical prefix code, can be
  * lexicographic ordering of codewords of the same length is the same as
  * the lexicographic ordering of the corresponding symbols.  A canonical
  * Huffman code, or more generally a canonical prefix code, can be
index 8ea02196610d01c8670fd9cf842d5d6b0cdcd30f..2c3da1611324a00c4250794145a923688d7a595c 100644 (file)
@@ -349,7 +349,7 @@ make_huffman_decode_table(u16 decode_table[const restrict],
        }
 
        /* If we've filled in the entire table, we are done.  Otherwise,
        }
 
        /* If we've filled in the entire table, we are done.  Otherwise,
-        * there are codes longer than table_bits for which we must
+        * there are codewords longer than table_bits for which we must
         * generate binary trees.  */
 
        decode_table_pos = (u16*)decode_table_ptr - decode_table;
         * generate binary trees.  */
 
        decode_table_pos = (u16*)decode_table_ptr - decode_table;
@@ -358,11 +358,11 @@ make_huffman_decode_table(u16 decode_table[const restrict],
                unsigned next_free_tree_slot;
                unsigned cur_codeword;
 
                unsigned next_free_tree_slot;
                unsigned cur_codeword;
 
-               /* First, zero out the rest of the entries.  This is
-                * necessary so that the entries appear as "unallocated"
-                * in the next part.  Each of these entries will
-                * eventually be filled the representation of the root
-                * node of a binary tree.  */
+               /* First, zero out the remaining entries.  This is
+                * necessary so that these entries appear as
+                * "unallocated" in the next part.  Each of these entries
+                * will eventually be filled with the representation of
+                * the root node of a binary tree.  */
                j = decode_table_pos;
                do {
                        decode_table[j] = 0;
                j = decode_table_pos;
                do {
                        decode_table[j] = 0;
@@ -370,7 +370,8 @@ make_huffman_decode_table(u16 decode_table[const restrict],
 
                /* We allocate child nodes starting at the end of the
                 * direct lookup table.  Note that there should be
 
                /* We allocate child nodes starting at the end of the
                 * direct lookup table.  Note that there should be
-                * 2*num_syms extra entries for this purpose.  */
+                * 2*num_syms extra entries for this purpose, although
+                * fewer than this may actually be needed.  */
                next_free_tree_slot = table_num_entries;
 
                /* Iterate through each codeword with length greater than
                next_free_tree_slot = table_num_entries;
 
                /* Iterate through each codeword with length greater than