aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hashtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/hashtab.h')
-rw-r--r--src/nvim/hashtab.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/nvim/hashtab.h b/src/nvim/hashtab.h
index 7740a3e431..0a50fb2ef8 100644
--- a/src/nvim/hashtab.h
+++ b/src/nvim/hashtab.h
@@ -15,9 +15,9 @@ typedef size_t hash_T;
/// The address of "hash_removed" is used as a magic number
/// for hi_key to indicate a removed item.
-#define HI_KEY_REMOVED ((char_u *)&hash_removed)
+#define HI_KEY_REMOVED (&hash_removed)
#define HASHITEM_EMPTY(hi) ((hi)->hi_key == NULL \
- || (hi)->hi_key == (char_u *)&hash_removed)
+ || (hi)->hi_key == &hash_removed)
/// Hashtable item.
///
@@ -45,7 +45,7 @@ typedef struct hashitem_S {
/// NULL : Item was never used.
/// HI_KEY_REMOVED : Item was removed.
/// (Any other pointer value) : Item is currently being used.
- char_u *hi_key;
+ char *hi_key;
} hashitem_T;
/// Initial size for a hashtable.
@@ -61,14 +61,15 @@ typedef struct hashitem_S {
///
/// The hashtable grows to accommodate more entries when needed.
typedef struct hashtable_S {
- hash_T ht_mask; /// mask used for hash value
- /// (nr of items in array is "ht_mask" + 1)
- size_t ht_used; /// number of items used
- size_t ht_filled; /// number of items used or removed
- int ht_locked; /// counter for hash_lock()
- hashitem_T *ht_array; /// points to the array, allocated when it's
- /// not "ht_smallarray"
- hashitem_T ht_smallarray[HT_INIT_SIZE]; /// initial array
+ hash_T ht_mask; ///< mask used for hash value
+ ///< (nr of items in array is "ht_mask" + 1)
+ size_t ht_used; ///< number of items used
+ size_t ht_filled; ///< number of items used or removed
+ int ht_changed; ///< incremented when adding or removing an item
+ int ht_locked; ///< counter for hash_lock()
+ hashitem_T *ht_array; ///< points to the array, allocated when it's
+ ///< not "ht_smallarray"
+ hashitem_T ht_smallarray[HT_INIT_SIZE]; ///< initial array
} hashtab_T;
/// Iterate over a hashtab