Remove long_u: hashtab: Enable clint: Add to clint.

- Add hashtab.[ch] to clint file.
- Fix clint errors.
This commit is contained in:
Eliseo Martínez 2014-05-24 01:17:51 +02:00
parent ffed9bfae9
commit f179081fc8
3 changed files with 10 additions and 8 deletions

View File

@ -9,6 +9,8 @@ src/nvim/api/vim.c
src/nvim/api/vim.h src/nvim/api/vim.h
src/nvim/api/window.c src/nvim/api/window.c
src/nvim/api/window.h src/nvim/api/window.h
src/nvim/hashtab.c
src/nvim/hashtab.h
src/nvim/indent.c src/nvim/indent.c
src/nvim/indent.h src/nvim/indent.h
src/nvim/log.c src/nvim/log.c

View File

@ -67,7 +67,7 @@ void hash_clear_all(hashtab_T *ht, unsigned int off)
hash_clear(ht); hash_clear(ht);
} }
/// Find item for given "key" in hashtable "ht". /// Find item for given "key" in hashtable "ht".
/// ///
/// @param key The key of the looked-for item. Must not be NULL. /// @param key The key of the looked-for item. Must not be NULL.
/// ///
@ -210,7 +210,7 @@ int hash_add_item(hashtab_T *ht, hashitem_T *hi, char_u *key, hash_T hash)
} }
/// Remove item "hi" from hashtable "ht". /// Remove item "hi" from hashtable "ht".
/// ///
/// Caller must take care of freeing the item itself. /// Caller must take care of freeing the item itself.
/// ///
/// @param hi The hash item to be removed. /// @param hi The hash item to be removed.
@ -222,7 +222,7 @@ void hash_remove(hashtab_T *ht, hashitem_T *hi)
hash_may_resize(ht, 0); hash_may_resize(ht, 0);
} }
/// Lock hashtable (prevent changes in ht_array). /// Lock hashtable (prevent changes in ht_array).
/// ///
/// Don't use this when items are to be added! /// Don't use this when items are to be added!
/// Must call hash_unlock() later. /// Must call hash_unlock() later.

View File

@ -5,10 +5,10 @@
#include "nvim/vim.h" #include "nvim/vim.h"
/// Type for hash number (hash calculation result). /// Type for hash number (hash calculation result).
typedef size_t hash_T; typedef size_t hash_T;
/// The address of "hash_removed" is used as a magic number /// The address of "hash_removed" is used as a magic number
/// for hi_key to indicate a removed item. /// for hi_key to indicate a removed item.
#define HI_KEY_REMOVED &hash_removed #define HI_KEY_REMOVED &hash_removed
#define HASHITEM_EMPTY(hi) ((hi)->hi_key == NULL \ #define HASHITEM_EMPTY(hi) ((hi)->hi_key == NULL \
|| (hi)->hi_key == &hash_removed) || (hi)->hi_key == &hash_removed)
@ -34,7 +34,7 @@ typedef struct hashitem_S {
hash_T hi_hash; hash_T hi_hash;
/// Item key. /// Item key.
/// ///
/// Possible values mean the following: /// Possible values mean the following:
/// NULL : Item was never used. /// NULL : Item was never used.
/// HI_KEY_REMOVED : Item was removed. /// HI_KEY_REMOVED : Item was removed.
@ -44,7 +44,7 @@ typedef struct hashitem_S {
/// Initial size for a hashtable. /// Initial size for a hashtable.
/// Our items are relatively small and growing is expensive, thus start with 16. /// Our items are relatively small and growing is expensive, thus start with 16.
/// Must be a power of 2. /// Must be a power of 2.
#define HT_INIT_SIZE 16 #define HT_INIT_SIZE 16
/// An array-based hashtable. /// An array-based hashtable.
@ -80,4 +80,4 @@ void hash_lock(hashtab_T *ht);
void hash_unlock(hashtab_T *ht); void hash_unlock(hashtab_T *ht);
hash_T hash_hash(char_u *key); hash_T hash_hash(char_u *key);
#endif /* NVIM_HASHTAB_H */ #endif // NVIM_HASHTAB_H