Browse Source

Fix Clang -Wbitwise-instead-of-logical warnings

Brad King 4 years ago
parent
commit
09f4edbcef
2 changed files with 10 additions and 5 deletions
  1. 1 1
      Source/CPack/cmCPackGenerator.cxx
  2. 9 4
      Tests/CMakeLib/testUVRAII.cxx

+ 1 - 1
Source/CPack/cmCPackGenerator.cxx

@@ -186,7 +186,7 @@ int cmCPackGenerator::InstallProject()
   std::string bareTempInstallDirectory =
     this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
   std::string tempInstallDirectoryStr = bareTempInstallDirectory;
-  bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) |
+  bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) ||
     cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
   if (!setDestDir) {
     tempInstallDirectoryStr += this->GetPackagingInstallPrefix();

+ 9 - 4
Tests/CMakeLib/testUVRAII.cxx

@@ -221,10 +221,15 @@ static bool testLoopDestructor()
 
 int testUVRAII(int, char** const)
 {
-  if ((testAsyncShutdown() &&
-       testAsyncDtor() & testAsyncMove() & testCrossAssignment() &
-         testAllMoves() & testLoopReset() & testLoopDestructor()) == 0) {
+  if (!testAsyncShutdown()) {
     return -1;
   }
-  return 0;
+  bool passed = true;
+  passed = testAsyncDtor() && passed;
+  passed = testAsyncMove() && passed;
+  passed = testCrossAssignment() && passed;
+  passed = testAllMoves() && passed;
+  passed = testLoopReset() && passed;
+  passed = testLoopDestructor() && passed;
+  return passed ? 0 : -1;
 }