From a192865f908f4b9b66a73d41053cc3ee2d9ad22f Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Fri, 5 Sep 2014 13:22:35 -0400 Subject: Attribute/constify get_tv_string(_buf(_chk)). --- src/nvim/eval.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 86ac112212..c58e6ee996 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -16334,14 +16334,16 @@ static linenr_T get_tv_lnum_buf(typval_T *argvars, buf_T *buf) * get_tv_string_chk() and get_tv_string_buf_chk() are similar, but return * NULL on error. */ -static char_u *get_tv_string(typval_T *varp) +static char_u *get_tv_string(const typval_T *varp) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET { static char_u mybuf[NUMBUFLEN]; return get_tv_string_buf(varp, mybuf); } -static char_u *get_tv_string_buf(typval_T *varp, char_u *buf) +static char_u *get_tv_string_buf(const typval_T *varp, char_u *buf) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET { char_u *res = get_tv_string_buf_chk(varp, buf); @@ -16349,14 +16351,16 @@ static char_u *get_tv_string_buf(typval_T *varp, char_u *buf) } /// Careful: This uses a single, static buffer. YOU CAN ONLY USE IT ONCE! -char_u *get_tv_string_chk(typval_T *varp) +char_u *get_tv_string_chk(const typval_T *varp) + FUNC_ATTR_NONNULL_ALL { static char_u mybuf[NUMBUFLEN]; return get_tv_string_buf_chk(varp, mybuf); } -static char_u *get_tv_string_buf_chk(typval_T *varp, char_u *buf) +static char_u *get_tv_string_buf_chk(const typval_T *varp, char_u *buf) + FUNC_ATTR_NONNULL_ALL { switch (varp->v_type) { case VAR_NUMBER: -- cgit