diff options
author | Scott Prager <splinterofchaos@gmail.com> | 2014-09-05 13:22:35 -0400 |
---|---|---|
committer | Scott Prager <splinterofchaos@gmail.com> | 2014-12-11 20:30:01 -0500 |
commit | a192865f908f4b9b66a73d41053cc3ee2d9ad22f (patch) | |
tree | 1ea08c5e6ec63d22d3b43993bca7d8fdd1a5d431 /src | |
parent | 3d93e47d9af5722c0e1be1d073090347d6ae28e3 (diff) | |
download | rneovim-a192865f908f4b9b66a73d41053cc3ee2d9ad22f.tar.gz rneovim-a192865f908f4b9b66a73d41053cc3ee2d9ad22f.tar.bz2 rneovim-a192865f908f4b9b66a73d41053cc3ee2d9ad22f.zip |
Attribute/constify get_tv_string(_buf(_chk)).
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 12 |
1 files changed, 8 insertions, 4 deletions
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: |