diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-10 20:15:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-10 20:15:44 -0700 |
commit | b735583377bf5c15a7bd5e910e4ae9fa833c1e42 (patch) | |
tree | c2a33c7597b8122aeae26b82fa759d11efa3aa84 | |
parent | 7bb858c39cac9b9af321fc90470c91d2e31ed96e (diff) | |
parent | 2ed7cda8cd0fe7dd29fa7879a7bf6df9256d38cd (diff) | |
download | rneovim-b735583377bf5c15a7bd5e910e4ae9fa833c1e42.tar.gz rneovim-b735583377bf5c15a7bd5e910e4ae9fa833c1e42.tar.bz2 rneovim-b735583377bf5c15a7bd5e910e4ae9fa833c1e42.zip |
Merge #10969 from janlazo/clang_pvs
-rw-r--r-- | src/nvim/cursor_shape.c | 6 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 4 | ||||
-rw-r--r-- | src/nvim/regexp.c | 1 | ||||
-rw-r--r-- | src/nvim/spell.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 0377cb97e5..96ff1e5631 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -118,7 +118,6 @@ char_u *parse_shape_opt(int what) // Repeat for all modes before the colon. // For the 'a' mode, we loop to handle all the modes. all_idx = -1; - assert(modep < colonp); while (modep < colonp || all_idx >= 0) { if (all_idx < 0) { // Find the mode @@ -230,8 +229,9 @@ char_u *parse_shape_opt(int what) } } modep = p; - if (*modep == ',') - ++modep; + if (modep != NULL && *modep == ',') { + modep++; + } } } diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index e24ccc38b0..be6e48465f 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -5139,9 +5139,7 @@ static int qf_setprop_context(qf_info_T *qi, int qf_idx, dictitem_T *di) { tv_free(qi->qf_lists[qf_idx].qf_ctx); typval_T *ctx = xcalloc(1, sizeof(typval_T)); - if (ctx != NULL) { - tv_copy(&di->di_tv, ctx); - } + tv_copy(&di->di_tv, ctx); qi->qf_lists[qf_idx].qf_ctx = ctx; return OK; diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 06b99d0b75..37d71699dd 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -5522,6 +5522,7 @@ do_class: * there is an error. */ static char_u *regnext(char_u *p) + FUNC_ATTR_NONNULL_ALL { int offset; diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 40bb882948..760ac2e6c1 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2305,6 +2305,7 @@ static int find_region(char_u *rp, char_u *region) /// /// @returns Case type of word int captype(char_u *word, char_u *end) + FUNC_ATTR_NONNULL_ARG(1) { char_u *p; int c; @@ -2355,6 +2356,7 @@ int captype(char_u *word, char_u *end) // capital. So that make_case_word() can turn WOrd into Word. // Add ALLCAP for "WOrD". static int badword_captype(char_u *word, char_u *end) + FUNC_ATTR_NONNULL_ALL { int flags = captype(word, end); int c; |