aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/channel.c1
-rw-r--r--src/nvim/eval/funcs.c7
-rw-r--r--src/nvim/eval/typval.c3
-rw-r--r--src/nvim/ex_getln.c3
-rw-r--r--src/nvim/spell.c1
5 files changed, 10 insertions, 5 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index 22eb31513d..60af11e94b 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -162,6 +162,7 @@ void channel_init(void)
/// Channel is allocated with refcount 1, which should be decreased
/// when the underlying stream closes.
Channel *channel_alloc(ChannelStreamType type)
+ FUNC_ATTR_NONNULL_RET
{
Channel *chan = xcalloc(1, sizeof(*chan));
if (type == kChannelStreamStdio) {
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index c2e1639624..072d206ecb 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -2770,10 +2770,9 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
} else if (strcmp(what, "args") == 0) {
rettv->v_type = VAR_LIST;
- if (tv_list_alloc_ret(rettv, pt->pt_argc) != NULL) {
- for (int i = 0; i < pt->pt_argc; i++) {
- tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]);
- }
+ tv_list_alloc_ret(rettv, pt->pt_argc);
+ for (int i = 0; i < pt->pt_argc; i++) {
+ tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]);
}
} else {
EMSG2(_(e_invarg2), what);
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index d01c597c83..61de83fc21 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -2098,7 +2098,7 @@ void tv_dict_set_keys_readonly(dict_T *const dict)
///
/// @return [allocated] pointer to the created list.
list_T *tv_list_alloc_ret(typval_T *const ret_tv, const ptrdiff_t len)
- FUNC_ATTR_NONNULL_ALL
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
list_T *const l = tv_list_alloc(len);
tv_list_set_ret(ret_tv, l);
@@ -2107,6 +2107,7 @@ list_T *tv_list_alloc_ret(typval_T *const ret_tv, const ptrdiff_t len)
}
dict_T *tv_dict_alloc_lock(VarLockStatus lock)
+ FUNC_ATTR_NONNULL_RET
{
dict_T *const d = tv_dict_alloc();
d->dv_lock = lock;
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 43762e8d6b..75ed5dc0e5 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -3571,6 +3571,7 @@ static void save_cmdline(struct cmdline_info *ccp)
* Restore ccline after it has been saved with save_cmdline().
*/
static void restore_cmdline(struct cmdline_info *ccp)
+ FUNC_ATTR_NONNULL_ALL
{
ccline = *ccp;
}
@@ -3580,6 +3581,7 @@ static void restore_cmdline(struct cmdline_info *ccp)
* passed to restore_cmdline_alloc() later.
*/
char_u *save_cmdline_alloc(void)
+ FUNC_ATTR_NONNULL_RET
{
struct cmdline_info *p = xmalloc(sizeof(struct cmdline_info));
save_cmdline(p);
@@ -3590,6 +3592,7 @@ char_u *save_cmdline_alloc(void)
* Restore the command line from the return value of save_cmdline_alloc().
*/
void restore_cmdline_alloc(char_u *p)
+ FUNC_ATTR_NONNULL_ALL
{
restore_cmdline((struct cmdline_info *)p);
xfree(p);
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index f6dc3a04a7..d1428b0117 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -1677,6 +1677,7 @@ static void int_wordlist_spl(char_u *fname)
// Allocate a new slang_T for language "lang". "lang" can be NULL.
// Caller must fill "sl_next".
slang_T *slang_alloc(char_u *lang)
+ FUNC_ATTR_NONNULL_RET
{
slang_T *lp = xcalloc(1, sizeof(slang_T));