summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-05 22:09:49 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-05 22:09:49 +0200
commit1a9de8035c35cdb3e0501ce2cf2f816e4220bea0 (patch)
tree8d2e7686145b5e03ddb5a0e181f9bb1b78dd47c7 /Source
parentbfdf1322e7638687c96b323b1df20fd9c08b3044 (diff)
downloadcmake-1a9de8035c35cdb3e0501ce2cf2f816e4220bea0.tar.gz
surround macro arguments with parentheses
Diffstat (limited to 'Source')
-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
7 files changed, 16 insertions, 15 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 0d3725d019..377fee1772 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 cdf292c999..754bb5f5ed 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 eec773fdb6..91da2397f3 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 13736b9122..70612d19eb 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 2824f7e90b..e88e048063 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 7688c59945..340219161d 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 be0ee50531..7da9975818 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"