From 1fc09b5b984e0963b5550310dd5d614d3007ba5a Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 2 Apr 2018 00:46:18 +0300 Subject: eval/typval_encode: Silence PVS/V501,V547,V779 These kinds of warnings are inevitable for generic macros. --- src/nvim/eval/typval_encode.c.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h index f2d0d7265f..4556ce8193 100644 --- a/src/nvim/eval/typval_encode.c.h +++ b/src/nvim/eval/typval_encode.c.h @@ -340,8 +340,9 @@ 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))); - _mp_push(*mpstack, ((MPConvStackVal) { + TYPVAL_ENCODE_CONV_FUNC_START( // -V547 + tv, (pt == NULL ? NULL : partial_name(pt))); + _mp_push(*mpstack, ((MPConvStackVal) { // -V779 .type = kMPConvPartial, .tv = tv, .saved_copyID = copyID - 1, @@ -541,7 +542,8 @@ 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(tv, TYPVAL_ENCODE_NODICT_VAR); + TYPVAL_ENCODE_CONV_EMPTY_DICT( // -V501 + tv, TYPVAL_ENCODE_NODICT_VAR); break; } TV_LIST_ITER_CONST(val_list, li, { -- cgit From 5acda0357661af0c50e4fa2b8825e9c3678ca013 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 9 Apr 2018 10:18:40 +0300 Subject: eval/decode: Silence PVS/V547: code written for 32-bit integers --- src/nvim/eval/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index 17799b500c..4d75c7bda1 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -985,7 +985,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) { + if (mobj.via.i64 >= VARNUMBER_MIN) { // -V547 *rettv = (typval_T) { .v_type = VAR_NUMBER, .v_lock = VAR_UNLOCKED, -- cgit From 07b67f9eff56ff741484109e4dcea42020c5f750 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 10 Apr 2018 01:01:16 +0300 Subject: eval: Fix PVS/V547: ufunc_T is actually an incomplete type --- src/nvim/eval/typval.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 2272a580d6..60bc7ff375 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -286,9 +286,8 @@ struct ufunc { ///< used for s: variables int uf_refcount; ///< reference count, see func_name_refcount() funccall_T *uf_scoped; ///< l: local variables for closure - char_u uf_name[1]; ///< name of function (actually longer); can - ///< start with 123_ ( is K_SPECIAL - ///< KS_EXTRA KE_SNR) + char_u uf_name[]; ///< Name of function; can start with 123_ + ///< ( is K_SPECIAL KS_EXTRA KE_SNR) }; /// Maximum number of function arguments -- cgit From b7a46f22999ed5e1f6757b803bcab683575afb5a Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 20 Apr 2018 00:04:25 +0300 Subject: eval/typval: Remove struct dictitem_S which is not used anywhere --- src/nvim/eval/typval.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 60bc7ff375..33e2aa6b61 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -197,15 +197,6 @@ typedef struct { }, \ } -// Structure to hold an item of a Dictionary. -// Also used for a variable. -// The key is copied into "di_key" to avoid an extra alloc/free for it. -struct dictitem_S { - typval_T di_tv; ///< type and value of the variable - char_u di_flags; ///< flags (only used for variable) - char_u di_key[1]; ///< key (actually longer!) -}; - #define TV_DICTITEM_STRUCT(...) \ struct { \ typval_T di_tv; /* Structure that holds scope dictionary itself. */ \ -- cgit From 6c2b442ee094bef944207b94fcedbc7dbd7dc166 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 22 Apr 2018 20:20:53 +0300 Subject: eval/typval: Silence PVS/V576: format is correct --- src/nvim/eval/typval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index c8b550f902..7930653be0 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -2825,7 +2825,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); + snprintf(buf, NUMBUFLEN, "%" PRIdVARNUMBER, tv->vval.v_number); // -V576 return buf; } case VAR_STRING: { -- cgit