diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-21 19:32:43 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-21 19:32:43 (GMT) |
commit | 569509f4bfbf44c67e237a01f957fdfe52223cfa (patch) | |
tree | fae8b2848d52b1f3ba8ed8f50f5e4135f170ee95 /Source/cmConditionEvaluator.cxx | |
parent | 6c9b3b5c03b41842d3d79c1bd80691be7e5c6f89 (diff) | |
download | CMake-569509f4bfbf44c67e237a01f957fdfe52223cfa.zip CMake-569509f4bfbf44c67e237a01f957fdfe52223cfa.tar.gz CMake-569509f4bfbf44c67e237a01f957fdfe52223cfa.tar.bz2 |
Fix newly discovered clang-tidy issues
Clang-tidy reports some issues only from the currently compiled source
file and its associated header file. Separating the compilation of
commands exposed some clang-tidy issues that were not reported previously.
Fix them.
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r-- | Source/cmConditionEvaluator.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 4c0b649..7d98e73 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -222,7 +222,7 @@ bool cmConditionEvaluator::GetBooleanValue( double d = strtod(arg.c_str(), &end); if (*end == '\0') { // The whole string is a number. Use C conversion to bool. - return d ? true : false; + return static_cast<bool>(d); } } @@ -444,7 +444,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, if (this->IsKeyword(keyCOMMAND, *arg) && argP1 != newArgs.end()) { cmCommand* command = this->Makefile.GetState()->GetCommand(argP1->c_str()); - this->HandlePredicate(command ? true : false, reducible, arg, newArgs, + this->HandlePredicate(command != CM_NULLPTR, reducible, arg, newArgs, argP1, argP2); } // does a policy exist @@ -456,7 +456,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, // does a target exist if (this->IsKeyword(keyTARGET, *arg) && argP1 != newArgs.end()) { this->HandlePredicate( - this->Makefile.FindTargetToUse(argP1->GetValue()) ? true : false, + this->Makefile.FindTargetToUse(argP1->GetValue()) != CM_NULLPTR, reducible, arg, newArgs, argP1, argP2); } // does a test exist @@ -464,7 +464,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, this->Policy64Status != cmPolicies::WARN) { if (this->IsKeyword(keyTEST, *arg) && argP1 != newArgs.end()) { const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str()); - this->HandlePredicate(haveTest ? true : false, reducible, arg, + this->HandlePredicate(haveTest != CM_NULLPTR, reducible, arg, newArgs, argP1, argP2); } } else if (this->Policy64Status == cmPolicies::WARN && @@ -638,8 +638,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, bool success = cmSystemTools::FileTimeCompare( arg->GetValue(), (argP2)->GetValue(), &fileIsNewer); this->HandleBinaryOp( - (success == false || fileIsNewer == 1 || fileIsNewer == 0), - reducible, arg, newArgs, argP1, argP2); + (!success || fileIsNewer == 1 || fileIsNewer == 0), reducible, arg, + newArgs, argP1, argP2); } if (argP1 != newArgs.end() && argP2 != newArgs.end() && |