diff options
author | Ihor Antonov <ngortheone@users.noreply.github.com> | 2019-07-17 21:10:45 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-18 03:10:45 +0200 |
commit | 9412dcb6ae34700a65d1aeab809c13fcf6de793e (patch) | |
tree | 8a62a955e8d0603d75783b4f5664557e5573b29e /src | |
parent | 3d356c14df523472571a75e58e69e3e47c4999c4 (diff) | |
download | rneovim-9412dcb6ae34700a65d1aeab809c13fcf6de793e.tar.gz rneovim-9412dcb6ae34700a65d1aeab809c13fcf6de793e.tar.bz2 rneovim-9412dcb6ae34700a65d1aeab809c13fcf6de793e.zip |
PVS/V1037: suppress warning #10526
* Case branches are semantically different.
* Lint
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/regexp_nfa.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index a28e05bd7e..a8919560a0 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1263,8 +1263,8 @@ static int nfa_regatom(void) IEMSGN("INTERNAL: Unknown character class char: %" PRId64, c); return FAIL; } - /* When '.' is followed by a composing char ignore the dot, so that - * the composing char is matched here. */ + // When '.' is followed by a composing char ignore the dot, so that + // the composing char is matched here. if (enc_utf8 && c == Magic('.') && utf_iscomposing(peekchr())) { old_regparse = regparse; c = getchr(); @@ -1279,25 +1279,26 @@ static int nfa_regatom(void) break; case Magic('n'): - if (reg_string) - /* In a string "\n" matches a newline character. */ + if (reg_string) { + // In a string "\n" matches a newline character. EMIT(NL); - else { - /* In buffer text "\n" matches the end of a line. */ + } else { + // In buffer text "\n" matches the end of a line. EMIT(NFA_NEWL); regflags |= RF_HASNL; } break; case Magic('('): - if (nfa_reg(REG_PAREN) == FAIL) - return FAIL; /* cascaded error */ + if (nfa_reg(REG_PAREN) == FAIL) { + return FAIL; // cascaded error + } break; case Magic('|'): case Magic('&'): case Magic(')'): - EMSGN(_(e_misplaced), no_Magic(c)); + EMSGN(_(e_misplaced), no_Magic(c)); // -V1037 return FAIL; case Magic('='): @@ -1306,7 +1307,7 @@ static int nfa_regatom(void) case Magic('@'): case Magic('*'): case Magic('{'): - /* these should follow an atom, not form an atom */ + // these should follow an atom, not form an atom EMSGN(_(e_misplaced), no_Magic(c)); return FAIL; @@ -1314,8 +1315,8 @@ static int nfa_regatom(void) { char_u *lp; - /* Previous substitute pattern. - * Generated as "\%(pattern\)". */ + // Previous substitute pattern. + // Generated as "\%(pattern\)". if (reg_prev_sub == NULL) { EMSG(_(e_nopresub)); return FAIL; |