PVS/V1037: suppress warning #10526

* Case branches are semantically different.
* Lint
This commit is contained in:
Ihor Antonov
2019-07-17 21:10:45 -04:00
committed by Justin M. Keyes
parent 3d356c14df
commit 9412dcb6ae

View File

@@ -1263,8 +1263,8 @@ static int nfa_regatom(void)
IEMSGN("INTERNAL: Unknown character class char: %" PRId64, c); IEMSGN("INTERNAL: Unknown character class char: %" PRId64, c);
return FAIL; return FAIL;
} }
/* When '.' is followed by a composing char ignore the dot, so that // When '.' is followed by a composing char ignore the dot, so that
* the composing char is matched here. */ // the composing char is matched here.
if (enc_utf8 && c == Magic('.') && utf_iscomposing(peekchr())) { if (enc_utf8 && c == Magic('.') && utf_iscomposing(peekchr())) {
old_regparse = regparse; old_regparse = regparse;
c = getchr(); c = getchr();
@@ -1279,25 +1279,26 @@ static int nfa_regatom(void)
break; break;
case Magic('n'): case Magic('n'):
if (reg_string) if (reg_string) {
/* In a string "\n" matches a newline character. */ // In a string "\n" matches a newline character.
EMIT(NL); EMIT(NL);
else { } else {
/* In buffer text "\n" matches the end of a line. */ // In buffer text "\n" matches the end of a line.
EMIT(NFA_NEWL); EMIT(NFA_NEWL);
regflags |= RF_HASNL; regflags |= RF_HASNL;
} }
break; break;
case Magic('('): case Magic('('):
if (nfa_reg(REG_PAREN) == FAIL) if (nfa_reg(REG_PAREN) == FAIL) {
return FAIL; /* cascaded error */ return FAIL; // cascaded error
}
break; break;
case Magic('|'): case Magic('|'):
case Magic('&'): case Magic('&'):
case Magic(')'): case Magic(')'):
EMSGN(_(e_misplaced), no_Magic(c)); EMSGN(_(e_misplaced), no_Magic(c)); // -V1037
return FAIL; return FAIL;
case Magic('='): case Magic('='):
@@ -1306,7 +1307,7 @@ static int nfa_regatom(void)
case Magic('@'): case Magic('@'):
case Magic('*'): 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)); EMSGN(_(e_misplaced), no_Magic(c));
return FAIL; return FAIL;
@@ -1314,8 +1315,8 @@ static int nfa_regatom(void)
{ {
char_u *lp; char_u *lp;
/* Previous substitute pattern. // Previous substitute pattern.
* Generated as "\%(pattern\)". */ // Generated as "\%(pattern\)".
if (reg_prev_sub == NULL) { if (reg_prev_sub == NULL) {
EMSG(_(e_nopresub)); EMSG(_(e_nopresub));
return FAIL; return FAIL;