From 8ef14467e4622f8f923f2a05a90c8fa0e12f76f9 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 20 Dec 2017 21:49:47 +1100 Subject: 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. --- Source/cmParseArgumentsCommand.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 0922e6e..9a5b097 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -71,8 +71,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector const& args, typedef std::map single_map; typedef std::map> 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 unparsed; @@ -98,7 +98,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector 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 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 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 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 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 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()); -- cgit v0.12