summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-11 12:18:15 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-11 12:18:15 (GMT)
commitb41a548d86f8989e790f0150abd3eb337e8c03d0 (patch)
treee22e5e910e1b5769e8bcec6fa20ac703df013e55 /Source/cmFindPackageCommand.cxx
parente0df0495e5b313e1f017ebb938c4522db6d5b89c (diff)
downloadCMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.zip
CMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.tar.gz
CMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.tar.bz2
Add parentheses around '&&' between '||' for gcc
The GNU compiler warns about possible operator precedence mistakes and asks for explicit parentheses (-Wparentheses). We add the parentheses to silence the warning. This also fixes one real logic error in the find_package() implementation by correcting expression evaluation order.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 9ac73f8..ff1d94c 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -900,13 +900,13 @@ void cmFindPackageCommand::FindConfig()
bool found = false;
// Search for frameworks.
- if(!found && this->SearchFrameworkFirst || this->SearchFrameworkOnly)
+ if(!found && (this->SearchFrameworkFirst || this->SearchFrameworkOnly))
{
found = this->FindFrameworkConfig();
}
// Search for apps.
- if(!found && this->SearchAppBundleFirst || this->SearchAppBundleOnly)
+ if(!found && (this->SearchAppBundleFirst || this->SearchAppBundleOnly))
{
found = this->FindAppBundleConfig();
}
@@ -1136,8 +1136,8 @@ void cmFindPackageCommand::AddPrefixesSystemEnvironment()
std::string const& d = *i;
// If the path is a PREFIX/bin case then add its parent instead.
- if(d.size() >= 4 && strcmp(d.c_str()+d.size()-4, "/bin") == 0 ||
- d.size() >= 5 && strcmp(d.c_str()+d.size()-5, "/sbin") == 0)
+ if((d.size() >= 4 && strcmp(d.c_str()+d.size()-4, "/bin") == 0) ||
+ (d.size() >= 5 && strcmp(d.c_str()+d.size()-5, "/sbin") == 0))
{
this->AddPathInternal(cmSystemTools::GetFilenamePath(d), EnvPath);
}