diff options
| author | dundargoc <gocdundar@gmail.com> | 2023-11-12 13:13:58 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-11-12 21:26:39 +0100 |
| commit | 353a4be7e84fdc101318215bdcc8a7e780d737fe (patch) | |
| tree | ad75dc836a028d1e3596e9b09ad5d1bc118d0c01 /src/nvim/eval | |
| parent | 2a57613b9b4206cc627efa63012aac791b8f89e0 (diff) | |
| download | rneovim-353a4be7e84fdc101318215bdcc8a7e780d737fe.tar.gz rneovim-353a4be7e84fdc101318215bdcc8a7e780d737fe.tar.bz2 rneovim-353a4be7e84fdc101318215bdcc8a7e780d737fe.zip | |
build: remove PVS
We already have an extensive suite of static analysis tools we use,
which causes a fair bit of redundancy as we get duplicate warnings. PVS
is also prone to give false warnings which creates a lot of work to
identify and disable.
Diffstat (limited to 'src/nvim/eval')
| -rw-r--r-- | src/nvim/eval/buffer.c | 3 | ||||
| -rw-r--r-- | src/nvim/eval/decode.c | 5 | ||||
| -rw-r--r-- | src/nvim/eval/encode.c | 3 | ||||
| -rw-r--r-- | src/nvim/eval/executor.c | 3 | ||||
| -rw-r--r-- | src/nvim/eval/funcs.c | 9 | ||||
| -rw-r--r-- | src/nvim/eval/gc.c | 3 | ||||
| -rw-r--r-- | src/nvim/eval/typval.c | 5 | ||||
| -rw-r--r-- | src/nvim/eval/typval_encode.c.h | 17 | ||||
| -rw-r--r-- | src/nvim/eval/userfunc.c | 7 | ||||
| -rw-r--r-- | src/nvim/eval/vars.c | 3 | ||||
| -rw-r--r-- | src/nvim/eval/window.c | 3 |
11 files changed, 14 insertions, 47 deletions
diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c index b480d25367..a26ba54ca3 100644 --- a/src/nvim/eval/buffer.c +++ b/src/nvim/eval/buffer.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - // eval/buffer.c: Buffer related builtin functions #include <stdbool.h> diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index 9c47e06f69..c090d1c9fe 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <assert.h> #include <msgpack/object.h> #include <stdbool.h> @@ -964,7 +961,7 @@ int msgpack_to_vim(const msgpack_object mobj, typval_T *const rettv) } break; case MSGPACK_OBJECT_NEGATIVE_INTEGER: - if (mobj.via.i64 >= VARNUMBER_MIN) { // -V547 + if (mobj.via.i64 >= VARNUMBER_MIN) { *rettv = (typval_T) { .v_type = VAR_NUMBER, .v_lock = VAR_UNLOCKED, diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c index 4a0c4ca19a..709733564e 100644 --- a/src/nvim/eval/encode.c +++ b/src/nvim/eval/encode.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - /// @file encode.c /// /// File containing functions for encoding and decoding Vimscript values. diff --git a/src/nvim/eval/executor.c b/src/nvim/eval/executor.c index 7668fb129f..62c59db932 100644 --- a/src/nvim/eval/executor.c +++ b/src/nvim/eval/executor.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <inttypes.h> #include <stdlib.h> diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 6efd9733e5..c6909245af 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <assert.h> #include <fcntl.h> #include <float.h> @@ -4810,7 +4807,7 @@ static void f_min(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) /// "mkdir()" function static void f_mkdir(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) { - int prot = 0755; // -V536 + int prot = 0755; rettv->vval.v_number = FAIL; if (check_secure()) { @@ -5732,9 +5729,9 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl // have to shuffle buf to close gap int adjust_prevlen = 0; - if (dest < buf) { // -V782 + if (dest < buf) { // adjust_prevlen must be 1 or 2. - adjust_prevlen = (int)(buf - dest); // -V782 + adjust_prevlen = (int)(buf - dest); dest = buf; } if (readlen > p - buf + 1) { diff --git a/src/nvim/eval/gc.c b/src/nvim/eval/gc.c index 6a54c4ddc1..bcebd87f71 100644 --- a/src/nvim/eval/gc.c +++ b/src/nvim/eval/gc.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <stddef.h> #include "nvim/eval/gc.h" diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 3657e182af..8a38315706 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include <assert.h> #include <stdbool.h> #include <stddef.h> @@ -4422,7 +4419,7 @@ const char *tv_get_string_buf_chk(const typval_T *const tv, char *const buf) { switch (tv->v_type) { case VAR_NUMBER: - snprintf(buf, NUMBUFLEN, "%" PRIdVARNUMBER, tv->vval.v_number); // -V576 + snprintf(buf, NUMBUFLEN, "%" PRIdVARNUMBER, tv->vval.v_number); return buf; case VAR_FLOAT: vim_snprintf(buf, NUMBUFLEN, "%g", tv->vval.v_float); diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h index 6d29286a58..b958239223 100644 --- a/src/nvim/eval/typval_encode.c.h +++ b/src/nvim/eval/typval_encode.c.h @@ -252,8 +252,6 @@ #include "nvim/func_attr.h" #include "klib/kvec.h" -// -V::1063 - /// Dummy variable used because some macros need lvalue /// /// Must not be written to, if needed one must check that address of the @@ -347,8 +345,8 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE( case VAR_PARTIAL: { partial_T *const pt = tv->vval.v_partial; (void)pt; - TYPVAL_ENCODE_CONV_FUNC_START(tv, (pt == NULL ? NULL : partial_name(pt))); // -V547 - _mp_push(*mpstack, ((MPConvStackVal) { // -V779 + TYPVAL_ENCODE_CONV_FUNC_START(tv, (pt == NULL ? NULL : partial_name(pt))); + _mp_push(*mpstack, ((MPConvStackVal) { .type = kMPConvPartial, .tv = tv, .saved_copyID = copyID - 1, @@ -396,7 +394,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE( case VAR_SPECIAL: switch (tv->vval.v_special) { case kSpecialVarNull: - TYPVAL_ENCODE_CONV_NIL(tv); // -V1037 + TYPVAL_ENCODE_CONV_NIL(tv); break; } break; @@ -509,7 +507,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE( } if (is_string) { TYPVAL_ENCODE_CONV_STR_STRING(tv, buf, len); - } else { // -V523 + } else { TYPVAL_ENCODE_CONV_STRING(tv, buf, len); } xfree(buf); @@ -544,8 +542,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE( } list_T *const val_list = val_di->di_tv.vval.v_list; if (val_list == NULL || tv_list_len(val_list) == 0) { - TYPVAL_ENCODE_CONV_EMPTY_DICT( // -V501 - tv, TYPVAL_ENCODE_NODICT_VAR); + TYPVAL_ENCODE_CONV_EMPTY_DICT(tv, TYPVAL_ENCODE_NODICT_VAR); break; } TV_LIST_ITER_CONST(val_list, li, { @@ -632,7 +629,7 @@ _convert_one_value_regular_dict: {} typval_encode_stop_converting_one_item: return OK; // Prevent “unused label” warnings. - goto typval_encode_stop_converting_one_item; // -V779 + goto typval_encode_stop_converting_one_item; } TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE( @@ -835,5 +832,5 @@ encode_vim_to__error_ret: _mp_destroy(mpstack); return FAIL; // Prevent “unused label” warnings. - goto typval_encode_stop_converting_one_item; // -V779 + goto typval_encode_stop_converting_one_item; } diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index aff4f1de62..959dabafb5 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - // User defined function support #include <assert.h> @@ -1214,7 +1211,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett if (func_or_func_caller_profiling) { call_start = profile_end(call_start); - call_start = profile_sub_wait(wait_start, call_start); // -V614 + call_start = profile_sub_wait(wait_start, call_start); 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); @@ -1400,7 +1397,7 @@ void free_all_functions(void) // Clean up the current_funccal chain and the funccal stack. while (current_funccal != NULL) { tv_clear(current_funccal->fc_rettv); - cleanup_function_call(current_funccal); // -V595 + cleanup_function_call(current_funccal); if (current_funccal == NULL && funccal_stack != NULL) { restore_funccal(); } diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index ed79d8a681..8cc3903f7a 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - // eval/vars.c: functions for dealing with variables #include <assert.h> diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c index f64809f2ef..c0607a4a34 100644 --- a/src/nvim/eval/window.c +++ b/src/nvim/eval/window.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - // eval/window.c: Window related builtin functions #include <stdbool.h> |