summaryrefslogtreecommitdiff
path: root/Source/cmParseArgumentsCommand.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-12-20 21:49:47 +1100
committerCraig Scott <craig.scott@crascit.com>2017-12-20 21:49:47 +1100
commit8ef14467e4622f8f923f2a05a90c8fa0e12f76f9 (patch)
treea49168950ab3f2f8f36f953f6ce4dc97c6f806f9 /Source/cmParseArgumentsCommand.cxx
parentb5bbf06c26260329855b26ecdea44027c3f0f598 (diff)
downloadcmake-8ef14467e4622f8f923f2a05a90c8fa0e12f76f9.tar.gz
Solaris: Fix shadowed declaration warning
"single" is a type declared in /usr/include/floatingpoint.h on Solaris, so the local variable of the same name in cmParseArgumentsCommand.cxx was triggering a compiler warning about the local variable shadowing the type.
Diffstat (limited to 'Source/cmParseArgumentsCommand.cxx')
-rw-r--r--Source/cmParseArgumentsCommand.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx
index 0922e6e24a..9a5b09721e 100644
--- a/Source/cmParseArgumentsCommand.cxx
+++ b/Source/cmParseArgumentsCommand.cxx
@@ -71,8 +71,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
typedef std::map<std::string, std::string> single_map;
typedef std::map<std::string, std::vector<std::string>> multi_map;
options_map options;
- single_map single;
- multi_map multi;
+ single_map singleValArgs;
+ multi_map multiValArgs;
// anything else is put into a vector of unparsed strings
std::vector<std::string> unparsed;
@@ -98,7 +98,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
if (!used_keywords.insert(iter).second) {
this->GetMakefile()->IssueMessage(cmake::WARNING, dup_warning + iter);
}
- single[iter]; // default initialize
+ singleValArgs[iter]; // default initialize
}
// the fourth argument is a (cmake) list of multi argument options
@@ -108,7 +108,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
if (!used_keywords.insert(iter).second) {
this->GetMakefile()->IssueMessage(cmake::WARNING, dup_warning + iter);
}
- multi[iter]; // default initialize
+ multiValArgs[iter]; // default initialize
}
enum insideValues
@@ -161,15 +161,15 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
continue;
}
- const single_map::iterator singleIter = single.find(arg);
- if (singleIter != single.end()) {
+ const single_map::iterator singleIter = singleValArgs.find(arg);
+ if (singleIter != singleValArgs.end()) {
insideValues = SINGLE;
currentArgName = arg;
continue;
}
- const multi_map::iterator multiIter = multi.find(arg);
- if (multiIter != multi.end()) {
+ const multi_map::iterator multiIter = multiValArgs.find(arg);
+ if (multiIter != multiValArgs.end()) {
insideValues = MULTI;
currentArgName = arg;
continue;
@@ -177,14 +177,14 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
switch (insideValues) {
case SINGLE:
- single[currentArgName] = arg;
+ singleValArgs[currentArgName] = arg;
insideValues = NONE;
break;
case MULTI:
if (parseFromArgV) {
- multi[currentArgName].push_back(escape_arg(arg));
+ multiValArgs[currentArgName].push_back(escape_arg(arg));
} else {
- multi[currentArgName].push_back(arg);
+ multiValArgs[currentArgName].push_back(arg);
}
break;
default:
@@ -204,7 +204,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->AddDefinition(prefix + iter.first,
iter.second ? "TRUE" : "FALSE");
}
- for (auto const& iter : single) {
+ for (auto const& iter : singleValArgs) {
if (!iter.second.empty()) {
this->Makefile->AddDefinition(prefix + iter.first, iter.second.c_str());
} else {
@@ -212,7 +212,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
}
}
- for (auto const& iter : multi) {
+ for (auto const& iter : multiValArgs) {
if (!iter.second.empty()) {
this->Makefile->AddDefinition(
prefix + iter.first, cmJoin(cmMakeRange(iter.second), ";").c_str());