diff options
author | Brad King <brad.king@kitware.com> | 2009-09-11 12:18:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-11 12:18:15 (GMT) |
commit | b41a548d86f8989e790f0150abd3eb337e8c03d0 (patch) | |
tree | e22e5e910e1b5769e8bcec6fa20ac703df013e55 /Source/CursesDialog/cmCursesMainForm.cxx | |
parent | e0df0495e5b313e1f017ebb938c4522db6d5b89c (diff) | |
download | CMake-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/CursesDialog/cmCursesMainForm.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 4d588a9..c0c409e 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -231,7 +231,8 @@ void cmCursesMainForm::RePost() { cmCacheManager::CacheIterator mit = this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || !this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -259,7 +260,8 @@ void cmCursesMainForm::RePost() { cmCacheManager::CacheIterator mit = this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || !this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -327,7 +329,8 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) { cmCacheManager::CacheIterator mit = this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || !this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -344,7 +347,8 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) { cmCacheManager::CacheIterator mit = this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || !this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -914,10 +918,10 @@ void cmCursesMainForm::HandleInput() this->SearchMode = false; } */ - else if ( key >= 'a' && key <= 'z' || - key >= 'A' && key <= 'Z' || - key >= '0' && key <= '9' || - key == '_' ) + else if ((key >= 'a' && key <= 'z') || + (key >= 'A' && key <= 'Z') || + (key >= '0' && key <= '9') || + (key == '_' )) { if ( this->SearchString.size() < static_cast<std::string::size_type>(x-10) ) { |