summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-13 14:00:08 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-13 14:00:08 (GMT)
commit09f4edbcefe02239dd175daf198aeac42c3c8bb8 (patch)
tree819184745bd75b1353c58578c9973a3cabdf53e4
parent315fc296e3c1ecddbf59a2144b0dff9a05c715ed (diff)
downloadCMake-09f4edbcefe02239dd175daf198aeac42c3c8bb8.zip
CMake-09f4edbcefe02239dd175daf198aeac42c3c8bb8.tar.gz
CMake-09f4edbcefe02239dd175daf198aeac42c3c8bb8.tar.bz2
Fix Clang -Wbitwise-instead-of-logical warnings
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx13
2 files changed, 10 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 2f700b4..7ddb103 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/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();
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 7d21959..fd88e24 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/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;
}