[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-665-g1a8f42e

Daniel Pfeifer daniel at pfeifer-mail.de
Fri Oct 21 15:41:37 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1a8f42e50f1435c05479ad3039e27d6c842a69fd (commit)
       via  32040cd3aefa07524d64f65340bdc2b7e1cca513 (commit)
      from  35e25ada0edbcd6a36204ea13a4da8309dab3cfc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a8f42e50f1435c05479ad3039e27d6c842a69fd
commit 1a8f42e50f1435c05479ad3039e27d6c842a69fd
Merge: 35e25ad 32040cd
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Oct 21 15:41:30 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 21 15:41:30 2016 -0400

    Merge topic 'separate-compilation' into next
    
    32040cd3 Fix newly discovered clang-tidy issues


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32040cd3aefa07524d64f65340bdc2b7e1cca513
commit 32040cd3aefa07524d64f65340bdc2b7e1cca513
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Oct 21 21:32:43 2016 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Fri Oct 21 21:32:43 2016 +0200

    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.

diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 18118a3..56cf91a 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -270,8 +270,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
     yet its linker language. */
   if ((type == cmStateEnums::SHARED_LIBRARY ||
        type == cmStateEnums::MODULE_LIBRARY) &&
-      (this->Makefile->GetState()->GetGlobalPropertyAsBool(
-         "TARGET_SUPPORTS_SHARED_LIBS") == false)) {
+      !this->Makefile->GetState()->GetGlobalPropertyAsBool(
+        "TARGET_SUPPORTS_SHARED_LIBS")) {
     std::ostringstream w;
     w << "ADD_LIBRARY called with "
       << (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE")
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() &&
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 8dd204b..6b5870b 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2449,18 +2449,14 @@ public:
   {
   }
 
-  ~cURLEasyGuard(void)
+  ~cURLEasyGuard()
   {
     if (this->Easy) {
       ::curl_easy_cleanup(this->Easy);
     }
   }
 
-  inline void release(void)
-  {
-    this->Easy = CM_NULLPTR;
-    return;
-  }
+  void release() { this->Easy = CM_NULLPTR; }
 
 private:
   ::CURL* Easy;
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 9e08f30..118c581 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -302,7 +302,7 @@ bool cmFindBase::CheckForVariableInCache()
     cmState* state = this->Makefile->GetState();
     const char* cacheEntry = state->GetCacheEntryValue(this->VariableName);
     bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
-    bool cached = cacheEntry ? true : false;
+    bool cached = cacheEntry != CM_NULLPTR;
     if (found) {
       // If the user specifies the entry on the command line without a
       // type we should add the type and docstring but keep the
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 2784e16..373b728 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -673,8 +673,8 @@ bool cmFindPackageCommand::HandlePackageMode()
   bool configFileSetFOUNDFalse = false;
 
   if (fileFound) {
-    if ((this->Makefile->IsDefinitionSet(foundVar)) &&
-        (this->Makefile->IsOn(foundVar) == false)) {
+    if (this->Makefile->IsDefinitionSet(foundVar) &&
+        !this->Makefile->IsOn(foundVar)) {
       // by removing Foo_FOUND here if it is FALSE, we don't really change
       // the situation for the Config file which is about to be included,
       // but we make it possible to detect later on whether the Config file
@@ -693,8 +693,8 @@ bool cmFindPackageCommand::HandlePackageMode()
       found = true;
 
       // Check whether the Config file has set Foo_FOUND to FALSE:
-      if ((this->Makefile->IsDefinitionSet(foundVar)) &&
-          (this->Makefile->IsOn(foundVar) == false)) {
+      if (this->Makefile->IsDefinitionSet(foundVar) &&
+          !this->Makefile->IsOn(foundVar)) {
         // we get here if the Config file has set Foo_FOUND actively to FALSE
         found = false;
         configFileSetFOUNDFalse = true;
@@ -1416,8 +1416,7 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
   // Look for foo-config-version.cmake
   std::string version_file = version_file_base;
   version_file += "-version.cmake";
-  if ((haveResult == false) &&
-      (cmSystemTools::FileExists(version_file.c_str(), true))) {
+  if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) {
     result = this->CheckVersionFile(version_file, version);
     haveResult = true;
   }
@@ -1425,14 +1424,13 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
   // Look for fooConfigVersion.cmake
   version_file = version_file_base;
   version_file += "Version.cmake";
-  if ((haveResult == false) &&
-      (cmSystemTools::FileExists(version_file.c_str(), true))) {
+  if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) {
     result = this->CheckVersionFile(version_file, version);
     haveResult = true;
   }
 
   // If no version was requested a versionless package is acceptable.
-  if ((haveResult == false) && (this->Version.empty())) {
+  if (!haveResult && this->Version.empty()) {
     result = true;
   }
 
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx
index 6f3ea6a..db855d2 100644
--- a/Source/cmHexFileConverter.cxx
+++ b/Source/cmHexFileConverter.cxx
@@ -206,7 +206,7 @@ bool cmHexFileConverter::TryConvert(const char* inFileName,
     } else if (type == IntelHex) {
       success = ConvertIntelHexLine(buf, outFile);
     }
-    if (success == false) {
+    if (!success) {
       break;
     }
   }
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 12b3aa8..82d2ee3 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -64,7 +64,7 @@ public:
   void FinalPass() CM_OVERRIDE;
   bool HasFinalPass() const CM_OVERRIDE
   {
-    return this->info.FinalPass ? true : false;
+    return this->info.FinalPass != CM_NULLPTR;
   }
 
   /**

-----------------------------------------------------------------------

Summary of changes:
 Source/cmAddLibraryCommand.cxx  |    4 ++--
 Source/cmConditionEvaluator.cxx |   12 ++++++------
 Source/cmFileCommand.cxx        |    8 ++------
 Source/cmFindBase.cxx           |    2 +-
 Source/cmFindPackageCommand.cxx |   16 +++++++---------
 Source/cmHexFileConverter.cxx   |    2 +-
 Source/cmLoadCommandCommand.cxx |    2 +-
 7 files changed, 20 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list