diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-12 14:56:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 14:56:50 -0700 |
commit | 426399c2c4dd325bf00ffe1f410c1b9fd5053692 (patch) | |
tree | 1221e9b06624bee081f4a89b34820775e6e58f1e | |
parent | 11fe132dd9c2e7d9613a24bf6f976557a924c3a2 (diff) | |
parent | 500c34479072589914f0c1c4a51a8c2d781a37b3 (diff) | |
download | rneovim-426399c2c4dd325bf00ffe1f410c1b9fd5053692.tar.gz rneovim-426399c2c4dd325bf00ffe1f410c1b9fd5053692.tar.bz2 rneovim-426399c2c4dd325bf00ffe1f410c1b9fd5053692.zip |
Merge #10999 from janlazo/clang_pvs2
-rw-r--r-- | src/nvim/api/private/dispatch.c | 1 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 1 | ||||
-rw-r--r-- | src/nvim/cursor_shape.c | 2 | ||||
-rw-r--r-- | src/nvim/digraph.c | 1 | ||||
-rw-r--r-- | src/nvim/eval/typval.h | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 1 | ||||
-rw-r--r-- | src/nvim/ex_eval.c | 1 | ||||
-rw-r--r-- | src/nvim/file_search.c | 1 | ||||
-rw-r--r-- | src/nvim/hardcopy.c | 1 | ||||
-rw-r--r-- | src/nvim/indent_c.c | 1 | ||||
-rw-r--r-- | src/nvim/log.c | 1 | ||||
-rw-r--r-- | src/nvim/msgpack_rpc/helpers.c | 1 | ||||
-rw-r--r-- | src/nvim/msgpack_rpc/server.c | 1 | ||||
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/regexp_nfa.c | 1 | ||||
-rw-r--r-- | src/nvim/shada.c | 1 | ||||
-rw-r--r-- | src/nvim/spell.c | 1 | ||||
-rw-r--r-- | src/nvim/tag.c | 25 | ||||
-rw-r--r-- | src/nvim/undo.c | 1 |
19 files changed, 14 insertions, 32 deletions
diff --git a/src/nvim/api/private/dispatch.c b/src/nvim/api/private/dispatch.c index 8492225a69..2975df3c68 100644 --- a/src/nvim/api/private/dispatch.c +++ b/src/nvim/api/private/dispatch.c @@ -3,7 +3,6 @@ #include <inttypes.h> #include <stdbool.h> -#include <stdint.h> #include <assert.h> #include <msgpack.h> diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 147830493a..5480bb5173 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2,7 +2,6 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <stdint.h> #include <inttypes.h> #include <stdbool.h> #include <stdlib.h> diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 96ff1e5631..9c8128db4f 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -104,7 +104,7 @@ char_u *parse_shape_opt(int what) if (*p_guicursor == NUL) { modep = (char_u *)"a:block-blinkon0"; } - while (*modep != NUL) { + while (modep != NULL && *modep != NUL) { colonp = vim_strchr(modep, ':'); commap = vim_strchr(modep, ','); diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 09b365ca12..ea9b210255 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -7,7 +7,6 @@ #include <assert.h> #include <stdbool.h> -#include <stdint.h> #include <inttypes.h> #include "nvim/vim.h" diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 823367560a..0b04170cac 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -3,11 +3,9 @@ #include <inttypes.h> #include <stddef.h> -#include <stdint.h> #include <string.h> #include <stdbool.h> #include <assert.h> -#include <limits.h> #include "nvim/types.h" #include "nvim/hashtab.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 154bf9f5f6..61a32bccfa 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -8,7 +8,6 @@ #include <assert.h> #include <string.h> #include <stdbool.h> -#include <stdint.h> #include <stdlib.h> #include <inttypes.h> diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 5b2a1c5c51..28bc222827 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -8,7 +8,6 @@ /// Functions for Ex command line for the +eval feature. #include <assert.h> #include <stdbool.h> -#include <stdint.h> #include <inttypes.h> #include <limits.h> diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 05611fb8ba..ad6a481bc5 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -46,7 +46,6 @@ #include <assert.h> #include <string.h> #include <stdbool.h> -#include <stdint.h> #include <inttypes.h> #include <limits.h> diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 3e0e438434..43cf372e07 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -8,7 +8,6 @@ #include <assert.h> #include <string.h> #include <inttypes.h> -#include <stdint.h> #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index f8ce6200d7..3938da761b 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -3,7 +3,6 @@ #include <assert.h> #include <inttypes.h> -#include <stdint.h> #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/src/nvim/log.c b/src/nvim/log.c index a2f83d4d09..db36611933 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -12,7 +12,6 @@ #include <inttypes.h> #include <stdarg.h> #include <stdbool.h> -#include <stdint.h> #include <stdio.h> #if !defined(WIN32) # include <sys/time.h> // for gettimeofday() diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 18b0bf3c16..a4a36e5ebf 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -1,7 +1,6 @@ // 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 <stdint.h> #include <stdbool.h> #include <inttypes.h> diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c index e5d80aea1d..6168f097a7 100644 --- a/src/nvim/msgpack_rpc/server.c +++ b/src/nvim/msgpack_rpc/server.c @@ -4,7 +4,6 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include <stdint.h> #include <inttypes.h> #include "nvim/msgpack_rpc/channel.h" diff --git a/src/nvim/option.c b/src/nvim/option.c index ae75644794..58398fa244 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -25,9 +25,7 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> -#include <stdint.h> #include <string.h> -#include <stdint.h> #include <stdlib.h> #include <limits.h> diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index c0129a00fb..63640e723e 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -10,7 +10,6 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> -#include <stdint.h> #include <limits.h> #include "nvim/ascii.h" diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 4b34153164..2306da94c6 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -5,7 +5,6 @@ #include <stddef.h> #include <stdbool.h> #include <string.h> -#include <stdint.h> #include <inttypes.h> #include <errno.h> #include <assert.h> diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 760ac2e6c1..0cde781fc3 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -72,7 +72,6 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> -#include <stdint.h> #include <string.h> #include <stdlib.h> #include <wctype.h> diff --git a/src/nvim/tag.c b/src/nvim/tag.c index beee3c7594..91f3da1793 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2770,10 +2770,11 @@ expand_tags ( static int add_tag_field ( dict_T *dict, - char *field_name, - char_u *start, /* start of the value */ - char_u *end /* after the value; can be NULL */ + const char *field_name, + const char_u *start, // start of the value + const char_u *end // after the value; can be NULL ) + FUNC_ATTR_NONNULL_ARG(1, 2) { int len = 0; int retval; @@ -2811,7 +2812,7 @@ add_tag_field ( int get_tags(list_T *list, char_u *pat, char_u *buf_fname) { int num_matches, i, ret; - char_u **matches, *p; + char_u **matches; char_u *full_fname; dict_T *dict; tagptrs_T tp; @@ -2849,16 +2850,16 @@ int get_tags(list_T *list, char_u *pat, char_u *buf_fname) xfree(full_fname); if (tp.command_end != NULL) { - for (p = tp.command_end + 3; - *p != NUL && *p != '\n' && *p != '\r'; ++p) { - if (p == tp.tagkind || (p + 5 == tp.tagkind - && STRNCMP(p, "kind:", 5) == 0)) - /* skip "kind:<kind>" and "<kind>" */ + for (char_u *p = tp.command_end + 3; + *p != NUL && *p != '\n' && *p != '\r'; p++) { + if (p == tp.tagkind + || (p + 5 == tp.tagkind && STRNCMP(p, "kind:", 5) == 0)) { + // skip "kind:<kind>" and "<kind>" p = tp.tagkind_end - 1; - else if (STRNCMP(p, "file:", 5) == 0) - /* skip "file:" (static tag) */ + } else if (STRNCMP(p, "file:", 5) == 0) { + // skip "file:" (static tag) p += 4; - else if (!ascii_iswhite(*p)) { + } else if (!ascii_iswhite(*p)) { char_u *s, *n; int len; diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 8ec36a8fe3..035613c7fd 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -79,7 +79,6 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> -#include <stdint.h> #include <string.h> #include <fcntl.h> |