diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-24 02:35:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 02:35:25 +0200 |
commit | 7d604a1e6158cda79f7ac485e0ef0e349014f8bf (patch) | |
tree | 4234b4bc08bfa6023b91f385642d899266bc825a /src/nvim/eval/typval.c | |
parent | 9fd4a0b52697db053143f51822e68da95c6886aa (diff) | |
parent | fa3db26f100bcb1c27b62b491bd63aed0800795b (diff) | |
download | rneovim-7d604a1e6158cda79f7ac485e0ef0e349014f8bf.tar.gz rneovim-7d604a1e6158cda79f7ac485e0ef0e349014f8bf.tar.bz2 rneovim-7d604a1e6158cda79f7ac485e0ef0e349014f8bf.zip |
Merge #10294 from janlazo/vim-8.0.1239
vim-patch:8.0.1239,8.1.{112,125,165,166,167,169,181,242,270,272,747,850,853,1519}
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r-- | src/nvim/eval/typval.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index ffb46abfea..91a1d083c7 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1221,7 +1221,8 @@ void tv_dict_watcher_notify(dict_T *const dict, const char *const key, /// Allocate a dictionary item /// -/// @note that the value of the item (->di_tv) still needs to be initialized. +/// @note that the type and value of the item (->di_tv) still needs to +/// be initialized. /// /// @param[in] key Key, is copied to the new item. /// @param[in] key_len Key length. @@ -1235,12 +1236,14 @@ dictitem_T *tv_dict_item_alloc_len(const char *const key, const size_t key_len) memcpy(di->di_key, key, key_len); di->di_key[key_len] = NUL; di->di_flags = DI_FLAGS_ALLOC; + di->di_tv.v_lock = VAR_UNLOCKED; return di; } /// Allocate a dictionary item /// -/// @note that the value of the item (->di_tv) still needs to be initialized. +/// @note that the type and value of the item (->di_tv) still needs to +/// be initialized. /// /// @param[in] key Key, is copied to the new item. /// @@ -1572,7 +1575,6 @@ int tv_dict_add_list(dict_T *const d, const char *const key, { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); - item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_LIST; item->di_tv.vval.v_list = list; tv_list_ref(list); @@ -1597,7 +1599,6 @@ int tv_dict_add_dict(dict_T *const d, const char *const key, { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); - item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_DICT; item->di_tv.vval.v_dict = dict; dict->dv_refcount++; @@ -1621,7 +1622,6 @@ int tv_dict_add_nr(dict_T *const d, const char *const key, { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); - item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_NUMBER; item->di_tv.vval.v_number = nr; if (tv_dict_add(d, item) == FAIL) { @@ -1644,7 +1644,6 @@ int tv_dict_add_special(dict_T *const d, const char *const key, { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); - item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_SPECIAL; item->di_tv.vval.v_special = val; if (tv_dict_add(d, item) == FAIL) { @@ -1706,7 +1705,6 @@ int tv_dict_add_allocated_str(dict_T *const d, { dictitem_T *const item = tv_dict_item_alloc_len(key, key_len); - item->di_tv.v_lock = VAR_UNLOCKED; item->di_tv.v_type = VAR_STRING; item->di_tv.vval.v_string = (char_u *)val; if (tv_dict_add(d, item) == FAIL) { |