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/cmSystemTools.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/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d0ed2d6..8a9c06e 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -510,12 +510,12 @@ std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command) bool win_path = false; - if ( command[0] != '/' && command[1] == ':' && command[2] == '\\' || - command[0] == '\"' && command[1] != '/' && command[2] == ':' - && command[3] == '\\' || - command[0] == '\'' && command[1] != '/' && command[2] == ':' - && command[3] == '\\' || - command[0] == '\\' && command[1] == '\\') + if ((command[0] != '/' && command[1] == ':' && command[2] == '\\') || + (command[0] == '\"' && command[1] != '/' && command[2] == ':' + && command[3] == '\\') || + (command[0] == '\'' && command[1] != '/' && command[2] == ':' + && command[3] == '\\') || + (command[0] == '\\' && command[1] == '\\')) { win_path = true; } |