aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hashtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/hashtab.c')
-rw-r--r--src/nvim/hashtab.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index b14bb01c0e..3397788b00 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -1,3 +1,6 @@
+// This is an open source non-commercial project. Dear PVS-Studio, please check
+// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+
/// @file hashtab.c
///
/// Handling of a hashtable with Vim-specific properties.
@@ -82,7 +85,7 @@ void hash_clear_all(hashtab_T *ht, unsigned int off)
/// used for that key.
/// WARNING: Returned pointer becomes invalid as soon as the hash table
/// is changed in any way.
-hashitem_T *hash_find(hashtab_T *ht, const char_u *key)
+hashitem_T *hash_find(const hashtab_T *const ht, const char_u *const key)
{
return hash_lookup(ht, (const char *)key, STRLEN(key), hash_hash(key));
}
@@ -99,7 +102,8 @@ hashitem_T *hash_find(hashtab_T *ht, const char_u *key)
///
/// @warning Returned pointer becomes invalid as soon as the hash table
/// is changed in any way.
-hashitem_T *hash_find_len(hashtab_T *ht, const char *key, const size_t len)
+hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key,
+ const size_t len)
{
return hash_lookup(ht, key, len, hash_hash_len(key, len));
}
@@ -115,7 +119,7 @@ hashitem_T *hash_find_len(hashtab_T *ht, const char *key, const size_t len)
/// used for that key.
/// WARNING: Returned pointer becomes invalid as soon as the hash table
/// is changed in any way.
-hashitem_T *hash_lookup(hashtab_T *const ht,
+hashitem_T *hash_lookup(const hashtab_T *const ht,
const char *const key, const size_t key_len,
const hash_T hash)
{