Skip to content

Commit

Permalink
fixed -Wpointer-bool-conversion Clang compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Sep 1, 2024
1 parent 3dbfd80 commit a1a957d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/checkcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,6 @@ static std::string innerSmtString(const Token * tok)
{
if (!tok)
return "if";
if (!tok->astTop())
return "if";
const Token * top = tok->astTop();
if (top->str() == "(" && top->astOperand1())
return top->astOperand1()->str();
Expand Down
2 changes: 1 addition & 1 deletion lib/reverseanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace {
if (!condTok)
break;
Analyzer::Action condAction = analyzeRecursive(condTok);
const bool inLoop = condTok->astTop() && Token::Match(condTok->astTop()->previous(), "for|while (");
const bool inLoop = Token::Match(condTok->astTop()->previous(), "for|while (");
// Evaluate condition of for and while loops first
if (inLoop) {
if (Token::findmatch(tok->link(), "goto|break", tok))
Expand Down
2 changes: 1 addition & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7086,7 +7086,7 @@ static void valueFlowContainerSize(const TokenList& tokenlist,
!Token::Match(nameToken, "%name% ("))
continue;
}
if (nameToken->astTop() && Token::Match(nameToken->astTop()->previous(), "for|while"))
if (Token::Match(nameToken->astTop()->previous(), "for|while"))
known = !isVariableChanged(var, settings);
std::vector<ValueFlow::Value> values{ValueFlow::Value{size}};
values.back().valueType = ValueFlow::Value::ValueType::CONTAINER_SIZE;
Expand Down

0 comments on commit a1a957d

Please sign in to comment.