From 98baea63ff85296a0f47e4fbbe68f6a95b1df112 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 May 2017 03:48:10 +0300 Subject: eval: Silence V782 --- src/nvim/eval.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 75cf564f55..982dc2841a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -13058,8 +13058,9 @@ static void f_readfile(typval_T *argvars, typval_T *rettv, FunPtr fptr) /* have to shuffle buf to close gap */ int adjust_prevlen = 0; - if (dest < buf) { - adjust_prevlen = (int)(buf - dest); /* must be 1 or 2 */ + if (dest < buf) { // -V782 + adjust_prevlen = (int)(buf - dest); // -V782 + // adjust_prevlen must be 1 or 2. dest = buf; } if (readlen > p - buf + 1) -- cgit From d9239181afcbd3230640b83bf3f971034dabb1ab Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 May 2017 03:51:19 +0300 Subject: eval: Fix V507 --- src/nvim/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 982dc2841a..ca1d50c1af 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21094,9 +21094,9 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, // Do not want errors such as E724 here. emsg_off++; char *tofree = encode_tv2string(&argvars[i], NULL); - char *s = tofree; emsg_off--; - if (s != NULL) { + if (tofree != NULL) { + char *s = tofree; char buf[MSG_BUF_LEN]; if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) { trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, -- cgit From 37a77506b0ddbc9dab7dd5984c843258e623b3f4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 May 2017 03:54:07 +0300 Subject: eval: Silence V614: potentially uninitialized variable Could not be uninitialized because `func_or_func_caller_profiling` is true only if `do_profiling` is `YES`, and if `do_profiling` is `YES` then `script_prof_save()` was called to initialize the variable. --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index ca1d50c1af..e4b3128930 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21160,7 +21160,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, if (func_or_func_caller_profiling) { call_start = profile_end(call_start); - call_start = profile_sub_wait(wait_start, call_start); + call_start = profile_sub_wait(wait_start, call_start); // -V614 fp->uf_tm_total = profile_add(fp->uf_tm_total, call_start); fp->uf_tm_self = profile_self(fp->uf_tm_self, call_start, fp->uf_tm_children); -- cgit