Skip to content

Commit 20ff103

Browse files
committed
Fix formatting
1 parent f4ca315 commit 20ff103

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

lib/checkother.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -998,24 +998,24 @@ void CheckOtherImpl::checkUnreachableSwitchCase()
998998
tok && tok != scope.bodyEnd;
999999
tok = tok->next()) {
10001000

1001-
// Do not inspect cases belonging to a nested switch.
1002-
if (Token::simpleMatch(tok, "{") &&
1003-
tok->scope()->type == ScopeType::eSwitch) {
1004-
tok = tok->link();
1005-
continue;
1006-
}
1007-
if (!Token::simpleMatch(tok, "case"))
1008-
continue;
1009-
const Token* caseExpression = tok->astOperand1();
1010-
if (!caseExpression)
1011-
continue;
1012-
const ValueFlow::Value* caseValue =
1013-
caseExpression->getKnownValue(ValueFlow::Value::ValueType::INT);
1014-
if (!caseValue)
1015-
continue;
1016-
if (switchValue->intvalue == caseValue->intvalue)
1017-
continue;
1018-
unreachableSwitchCaseError(tok, caseExpression->expressionString());
1001+
// Do not inspect cases belonging to a nested switch.
1002+
if (Token::simpleMatch(tok, "{") &&
1003+
tok->scope()->type == ScopeType::eSwitch) {
1004+
tok = tok->link();
1005+
continue;
1006+
}
1007+
if (!Token::simpleMatch(tok, "case"))
1008+
continue;
1009+
const Token* caseExpression = tok->astOperand1();
1010+
if (!caseExpression)
1011+
continue;
1012+
const ValueFlow::Value* caseValue =
1013+
caseExpression->getKnownValue(ValueFlow::Value::ValueType::INT);
1014+
if (!caseValue)
1015+
continue;
1016+
if (switchValue->intvalue == caseValue->intvalue)
1017+
continue;
1018+
unreachableSwitchCaseError(tok, caseExpression->expressionString());
10191019
}
10201020
}
10211021
}

0 commit comments

Comments
 (0)