aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-26 03:42:23 +0300
committerZyX <kp-pav@yandex.ru>2017-03-29 10:08:46 +0300
commit58e34e8d99b01bf3937824fc50502e39a8c39eba (patch)
tree9f7e2da65dd6627ecb2f4ee0f8b7c3a6d37ba0b1 /src/nvim/eval/typval.c
parentf4256243dbdbd2858be716f9f52763bd9a76be4d (diff)
downloadrneovim-58e34e8d99b01bf3937824fc50502e39a8c39eba.tar.gz
rneovim-58e34e8d99b01bf3937824fc50502e39a8c39eba.tar.bz2
rneovim-58e34e8d99b01bf3937824fc50502e39a8c39eba.zip
eval/typval: Allow NULL dict as tv_dict_get_callback() argument
Also removes NULL key input: tv_dict_find() does not allow this.
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r--src/nvim/eval/typval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index 48ff3ab623..da58cf5ca9 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -825,8 +825,7 @@ void tv_dict_watcher_add(dict_T *const dict, const char *const key_pattern,
/// @param[in] cb2 Second callback to check.
///
/// @return True if they are equal, false otherwise.
-static bool tv_callback_equal(const Callback *const cb1,
- const Callback *const cb2)
+bool tv_callback_equal(const Callback *const cb1, const Callback *const cb2)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
if (cb1->type != cb2->type) {
@@ -1240,7 +1239,7 @@ const char *tv_dict_get_string_buf(const dict_T *const d, const char *const key,
bool tv_dict_get_callback(dict_T *const d,
const char *const key, const ptrdiff_t key_len,
Callback *const result)
- FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
+ FUNC_ATTR_NONNULL_ARG(2, 4) FUNC_ATTR_WARN_UNUSED_RESULT
{
result->type = kCallbackNone;