]> wimlib.net Git - wimlib/commitdiff
Rename 'pos_t' to 'mf_pos_t'
authorEric Biggers <ebiggers3@gmail.com>
Sat, 19 Sep 2015 18:56:10 +0000 (13:56 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 27 Sep 2015 14:41:27 +0000 (09:41 -0500)
include/wimlib/bt_matchfinder.h
include/wimlib/hc_matchfinder.h
src/lzx_compress.c
src/xpress_compress.c

index 70e4f143d65eddbf55a90615d066424da4fd5c31..8a69bca4acfed21bdbde39013e53711e7d4f0ff7 100644 (file)
@@ -78,17 +78,17 @@ struct TEMPLATED(bt_matchfinder) {
 
        /* The hash table for finding length 2 matches, if enabled  */
 #ifdef BT_MATCHFINDER_HASH2_ORDER
-       pos_t hash2_tab[1UL << BT_MATCHFINDER_HASH2_ORDER];
+       mf_pos_t hash2_tab[1UL << BT_MATCHFINDER_HASH2_ORDER];
 #endif
 
        /* The hash table which contains the roots of the binary trees for
         * finding length 3 matches  */
-       pos_t hash3_tab[1UL << BT_MATCHFINDER_HASH3_ORDER];
+       mf_pos_t hash3_tab[1UL << BT_MATCHFINDER_HASH3_ORDER];
 
        /* The child node references for the binary trees.  The left and right
         * children of the node for the sequence with position 'pos' are
         * 'child_tab[pos * 2]' and 'child_tab[pos * 2 + 1]', respectively.  */
-       pos_t child_tab[];
+       mf_pos_t child_tab[];
 };
 
 /* Return the number of bytes that must be allocated for a 'bt_matchfinder' that
@@ -97,7 +97,7 @@ static inline size_t
 TEMPLATED(bt_matchfinder_size)(size_t max_bufsize)
 {
        return sizeof(struct TEMPLATED(bt_matchfinder)) +
-               (2 * max_bufsize * sizeof(pos_t));
+               (2 * max_bufsize * sizeof(mf_pos_t));
 }
 
 /* Prepare the matchfinder for a new input buffer.  */
@@ -107,13 +107,13 @@ TEMPLATED(bt_matchfinder_init)(struct TEMPLATED(bt_matchfinder) *mf)
        memset(mf, 0, sizeof(*mf));
 }
 
-static inline pos_t *
+static inline mf_pos_t *
 TEMPLATED(bt_left_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node)
 {
        return &mf->child_tab[(node << 1) + 0];
 }
 
-static inline pos_t *
+static inline mf_pos_t *
 TEMPLATED(bt_right_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node)
 {
        return &mf->child_tab[(node << 1) + 1];
@@ -142,7 +142,7 @@ TEMPLATED(bt_matchfinder_advance_one_byte)(struct TEMPLATED(bt_matchfinder) * co
        u32 hash3;
        u32 cur_node;
        const u8 *matchptr;
-       pos_t *pending_lt_ptr, *pending_gt_ptr;
+       mf_pos_t *pending_lt_ptr, *pending_gt_ptr;
        u32 best_lt_len, best_gt_len;
        u32 len;
        u32 best_len = 2;
index 6c7020e5979a58b59cf56a1e6ebd5c3a3f7d54b9..e1da62b5ca1a388566419f98030705971e9e31d3 100644 (file)
  *
  *                             Notes on usage
  *
- * Before including this header, you must define 'pos_t' to an integer type that
- * can represent all possible positions.  This can be a 16-bit or 32-bit
+ * Before including this header, you must define 'mf_pos_t' to an integer type
+ * that can represent all possible positions.  This can be a 16-bit or 32-bit
  * unsigned integer.  When possible, the former should be used due to the
  * reduced cache pressure.  This header can be included multiple times in a
- * single .c file with different 'pos_t' definitions; however, you must define a
- * different MF_SUFFIX each time to generate different names for the matchfinder
- * structure and functions.
+ * single .c file with different 'mf_pos_t' definitions; however, you must
+ * define a different MF_SUFFIX each time to generate different names for the
+ * matchfinder structure and functions.
  *
  * The number of bytes that must be allocated for a given 'struct
  * hc_matchfinder' must be gotten by calling hc_matchfinder_size().
 struct TEMPLATED(hc_matchfinder) {
 
        /* The hash table for finding length 3 matches  */
-       pos_t hash3_tab[1UL << HC_MATCHFINDER_HASH3_ORDER];
+       mf_pos_t hash3_tab[1UL << HC_MATCHFINDER_HASH3_ORDER];
 
        /* The hash table which contains the first nodes of the linked lists for
         * finding length 4+ matches  */
-       pos_t hash4_tab[1UL << HC_MATCHFINDER_HASH4_ORDER];
+       mf_pos_t hash4_tab[1UL << HC_MATCHFINDER_HASH4_ORDER];
 
        /* The "next node" references for the linked lists.  The "next node" of
         * the node for the sequence with position 'pos' is 'next_tab[pos]'.  */
-       pos_t next_tab[];
+       mf_pos_t next_tab[];
 };
 
 /* Return the number of bytes that must be allocated for a 'hc_matchfinder' that
@@ -135,7 +135,7 @@ static inline size_t
 TEMPLATED(hc_matchfinder_size)(size_t max_bufsize)
 {
        return sizeof(struct TEMPLATED(hc_matchfinder)) +
-               (max_bufsize * sizeof(pos_t));
+               (max_bufsize * sizeof(mf_pos_t));
 }
 
 /* Prepare the matchfinder for a new input buffer.  */
@@ -188,7 +188,7 @@ TEMPLATED(hc_matchfinder_longest_match)(struct TEMPLATED(hc_matchfinder) * const
        const u8 *in_next = in_begin + cur_pos;
        u32 depth_remaining = max_search_depth;
        const u8 *best_matchptr = best_matchptr; /* uninitialized */
-       pos_t cur_node3, cur_node4;
+       mf_pos_t cur_node3, cur_node4;
        u32 hash3, hash4;
        u32 next_seq3, next_seq4;
        u32 seq4;
index de8430145f4e7a2867ad60c59b5d17a6b5a4436e..98142962db6d21c866c01367de675a527e28057d 100644 (file)
 #include "wimlib/util.h"
 
 /* Matchfinders with 16-bit positions  */
-#define pos_t  u16
-#define MF_SUFFIX _16
+#define mf_pos_t       u16
+#define MF_SUFFIX      _16
 #include "wimlib/bt_matchfinder.h"
 #include "wimlib/hc_matchfinder.h"
 
 /* Matchfinders with 32-bit positions  */
-#undef pos_t
+#undef mf_pos_t
 #undef MF_SUFFIX
-#define pos_t  u32
-#define MF_SUFFIX _32
+#define mf_pos_t       u32
+#define MF_SUFFIX      _32
 #include "wimlib/bt_matchfinder.h"
 #include "wimlib/hc_matchfinder.h"
 
index 734bfc02b747be4934abd02309ba723a1f4209b1..b57d0ea62355157dbf72a16c2f8c75bd503e2ab4 100644 (file)
@@ -48,7 +48,7 @@
 /*
  * Matchfinder definitions.  For XPRESS, only a 16-bit matchfinder is needed.
  */
-#define pos_t u16
+#define mf_pos_t       u16
 #define MF_SUFFIX
 
 /*