summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-05 20:09:49 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-05 20:09:49 (GMT)
commit1a9de8035c35cdb3e0501ce2cf2f816e4220bea0 (patch)
tree8d2e7686145b5e03ddb5a0e181f9bb1b78dd47c7
parentbfdf1322e7638687c96b323b1df20fd9c08b3044 (diff)
downloadCMake-1a9de8035c35cdb3e0501ce2cf2f816e4220bea0.zip
CMake-1a9de8035c35cdb3e0501ce2cf2f816e4220bea0.tar.gz
CMake-1a9de8035c35cdb3e0501ce2cf2f816e4220bea0.tar.bz2
surround macro arguments with parentheses
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx8
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/cmCurl.cxx4
-rw-r--r--Source/cmDocumentation.cxx2
-rw-r--r--Source/cmGraphVizWriter.cxx4
-rw-r--r--Source/cmPolicies.cxx7
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Tests/CMakeLib/testGeneratedFileStream.cxx2
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx4
9 files changed, 19 insertions, 18 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 0d3725d..377fee1 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -87,17 +87,17 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
*/
#define DECLARE_AND_OPEN_ARCHIVE(filename, archive) \
cmGeneratedFileStream gf; \
- gf.Open(filename.c_str(), false, true); \
+ gf.Open((filename).c_str(), false, true); \
if (!GenerateHeader(&gf)) { \
cmCPackLogger(cmCPackLog::LOG_ERROR, \
"Problem to generate Header for archive < " \
- << filename << ">." << std::endl); \
+ << (filename) << ">." << std::endl); \
return 0; \
} \
cmArchiveWrite archive(gf, this->Compress, this->ArchiveFormat); \
- if (!archive) { \
+ if (!(archive)) { \
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \
- << filename << ">. ERROR =" << archive.GetError() \
+ << (filename) << ">. ERROR =" << (archive).GetError() \
<< std::endl); \
return 0; \
}
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index cdf292c..754bb5f 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -366,11 +366,11 @@ int cmCTestBuildHandler::ProcessHandler()
regexes.clear(); \
cmCTestOptionalLog(this->CTest, DEBUG, \
this << "Add " #regexes << std::endl, this->Quiet); \
- for (it = strings.begin(); it != strings.end(); ++it) { \
+ for (it = (strings).begin(); it != (strings).end(); ++it) { \
cmCTestOptionalLog(this->CTest, DEBUG, \
"Add " #strings ": " << *it << std::endl, \
this->Quiet); \
- regexes.push_back(it->c_str()); \
+ (regexes).push_back(it->c_str()); \
}
cmCTestBuildHandlerPopulateRegexVector(this->CustomErrorMatches,
this->ErrorMatchRegex);
diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx
index eec773f..91da239 100644
--- a/Source/cmCurl.cxx
+++ b/Source/cmCurl.cxx
@@ -25,9 +25,9 @@
#endif
#define check_curl_result(result, errstr) \
- if (result != CURLE_OK && result != CURLE_NOT_BUILT_IN) { \
+ if ((result) != CURLE_OK && (result) != CURLE_NOT_BUILT_IN) { \
e += e.empty() ? "" : "\n"; \
- e += errstr; \
+ e += (errstr); \
e += ::curl_easy_strerror(result); \
}
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 13736b9..70612d1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -166,7 +166,7 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
#define GET_OPT_ARGUMENT(target) \
if ((i + 1 < argc) && !this->IsOption(argv[i + 1])) { \
- target = argv[i + 1]; \
+ (target) = argv[i + 1]; \
i = i + 1; \
};
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 2824f7e..e88e048 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -98,7 +98,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
{ \
const char* value = mf->GetDefinition(cmakeDefinition); \
if (value) { \
- var = value; \
+ (var) = value; \
} \
}
@@ -111,7 +111,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
{ \
const char* value = mf->GetDefinition(cmakeDefinition); \
if (value) { \
- var = mf->IsOn(cmakeDefinition); \
+ (var) = mf->IsOn(cmakeDefinition); \
} \
}
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 7688c59..3402191 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -86,9 +86,10 @@ static bool isPolicyNewerThan(cmPolicies::PolicyID id, unsigned int majorV,
switch (id) {
#define POLICY_CASE(ID, V_MAJOR, V_MINOR, V_PATCH) \
case cmPolicies::ID: \
- return ( \
- majorV < V_MAJOR || (majorV == V_MAJOR && minorV + 1 < V_MINOR + 1) || \
- (majorV == V_MAJOR && minorV == V_MINOR && patchV + 1 < V_PATCH + 1));
+ return (majorV < (V_MAJOR) || \
+ (majorV == (V_MAJOR) && minorV + 1 < (V_MINOR) + 1) || \
+ (majorV == (V_MAJOR) && minorV == (V_MINOR) && \
+ patchV + 1 < (V_PATCH) + 1));
CM_FOR_EACH_POLICY_ID_VERSION(POLICY_CASE)
#undef POLICY_CASE
case cmPolicies::CMPCOUNT:
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index be0ee50..7da9975 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1484,7 +1484,7 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
/* Format the time using 'ls -l' conventions. */
tim = archive_entry_mtime(entry);
-#define HALF_YEAR (time_t)365 * 86400 / 2
+#define HALF_YEAR ((time_t)365 * 86400 / 2)
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Windows' strftime function does not support %e format. */
#define DAY_FMT "%d"
diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx
index a31cc42..b419b9e 100644
--- a/Tests/CMakeLib/testGeneratedFileStream.cxx
+++ b/Tests/CMakeLib/testGeneratedFileStream.cxx
@@ -16,7 +16,7 @@
#include <string>
#define cmFailed(m1, m2) \
- std::cout << "FAILED: " << m1 << m2 << "\n"; \
+ std::cout << "FAILED: " << (m1) << (m2) << "\n"; \
failed = 1
int testGeneratedFileStream(int /*unused*/, char* /*unused*/ [])
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index 8e8d4c4..e834b93 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -14,9 +14,9 @@
#include <iostream>
#include <string>
-#define cmPassed(m) std::cout << "Passed: " << m << "\n"
+#define cmPassed(m) std::cout << "Passed: " << (m) << "\n"
#define cmFailed(m) \
- std::cout << "FAILED: " << m << "\n"; \
+ std::cout << "FAILED: " << (m) << "\n"; \
failed = 1
int testSystemTools(int /*unused*/, char* /*unused*/ [])