diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 7 | ||||
-rw-r--r-- | Source/cmExportSetMap.cxx | 7 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmListCommand.cxx | 10 | ||||
-rw-r--r-- | Source/cmLoadCacheCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 7 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 21 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 12 | ||||
-rw-r--r-- | Source/cmakemain.cxx | 12 |
12 files changed, 36 insertions, 62 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4a4ef50..daae107 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 1) -set(CMake_VERSION_PATCH 20150118) +set(CMake_VERSION_PATCH 20150119) #set(CMake_VERSION_RC 1) diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index f0bae28..32d5cd3 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -676,11 +676,8 @@ void cmComputeLinkDepends::InferDependencies() } // Add the inferred dependencies to the graph. - for(DependSet::const_iterator j = common.begin(); j != common.end(); ++j) - { - int dependee_index = *j; - this->EntryConstraintGraph[depender_index].push_back(dependee_index); - } + cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index]; + edges.insert(edges.end(), common.begin(), common.end()); } } diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx index 5174118..14c4458 100644 --- a/Source/cmExportSetMap.cxx +++ b/Source/cmExportSetMap.cxx @@ -25,12 +25,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name) void cmExportSetMap::clear() { - for(std::map<std::string, cmExportSet*>::iterator it = this->begin(); - it != this->end(); - ++ it) - { - delete it->second; - } + cmDeleteAll(*this); this->derived::clear(); } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 387cea6..d64b0d7 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -62,6 +62,7 @@ void cmExtraEclipseCDT4Generator if (*lit == "CXX") { this->Natures.insert("org.eclipse.cdt.core.ccnature"); + this->Natures.insert("org.eclipse.cdt.core.cnature"); } else if (*lit == "C") { diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index b2a2386..bf96951 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -98,12 +98,8 @@ const char *cmCompiledGeneratorExpression::Evaluate( { this->Output += (*it)->Evaluate(&context, dagChecker); - for(std::set<std::string>::const_iterator - p = context.SeenTargetProperties.begin(); - p != context.SeenTargetProperties.end(); ++p) - { - this->SeenTargetProperties.insert(*p); - } + this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(), + context.SeenTargetProperties.end()); if (context.HadError) { this->Output = ""; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f8eaf8a..1745d9a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1510,11 +1510,7 @@ void cmGlobalGenerator::CreateGeneratorTargets() //---------------------------------------------------------------------------- void cmGlobalGenerator::ClearGeneratorMembers() { - for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin(); - i != this->GeneratorTargets.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->GeneratorTargets); this->GeneratorTargets.clear(); cmDeleteAll(this->EvaluationFiles); diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 85413ca..107dca9 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -345,13 +345,9 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args) return false; } } - size_t cc; - size_t cnt = 0; - for ( cc = 3; cc < args.size(); ++ cc ) - { - varArgsExpanded.insert(varArgsExpanded.begin()+item+cnt, args[cc]); - cnt ++; - } + + varArgsExpanded.insert(varArgsExpanded.begin()+item, + args.begin() + 3, args.end()); std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 540dd3b..93aec32 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -110,10 +110,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) // Prepare the table of variables to read. this->Prefix = args[2]; - for(unsigned int i=3; i < args.size(); ++i) - { - this->VariablesToRead.insert(args[i]); - } + this->VariablesToRead.insert(args.begin() + 3, args.end()); // Read the cache file. cmsys::ifstream fin(cacheFile.c_str()); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 84b34d9..f825f5f 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -738,11 +738,8 @@ cmLocalUnixMakefileGenerator3 // Add the output to the local help if requested. if(in_help) { - for (std::vector<std::string>::const_iterator i = outputs.begin(); - i != outputs.end(); ++i) - { - this->LocalHelp.push_back(*i); - } + this->LocalHelp.insert(this->LocalHelp.end(), + outputs.begin(), outputs.end()); } } diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 251a043..646300d 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -239,7 +239,20 @@ private: namespace ContainerAlgorithms { -template<typename Container> +template<typename T> +struct cmIsPair +{ + enum { value = false }; +}; + +template<typename K, typename V> +struct cmIsPair<std::pair<K, V> > +{ + enum { value = true }; +}; + +template<typename Container, + bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value> struct DefaultDeleter { void operator()(typename Container::value_type value) { @@ -247,10 +260,10 @@ struct DefaultDeleter } }; -template<typename K, typename V> -struct DefaultDeleter<std::map<K, V> > +template<typename Container> +struct DefaultDeleter<Container, /* valueTypeIsPair = */ true> { - void operator()(typename std::map<K, V>::value_type value) { + void operator()(typename Container::value_type value) { delete value.second; } }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c193f20..98cb75c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -539,12 +539,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear(); this->Internal->LinkClosureMap.clear(); this->Internal->SourceFilesMap.clear(); - for (cmTargetLinkInformationMap::const_iterator it - = this->LinkInformation.begin(); - it != this->LinkInformation.end(); ++it) - { - delete it->second; - } + cmDeleteAll(this->LinkInformation); this->LinkInformation.clear(); } @@ -6874,10 +6869,7 @@ cmTargetLinkInformationMap //---------------------------------------------------------------------------- cmTargetLinkInformationMap::~cmTargetLinkInformationMap() { - for(derived::iterator i = this->begin(); i != this->end(); ++i) - { - delete i->second; - } + cmDeleteAll(*this); } //---------------------------------------------------------------------------- diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f3e54d3..6d25b70 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -96,11 +96,9 @@ static const char * cmDocumentationOptions[][2] = static int do_command(int ac, char const* const* av) { std::vector<std::string> args; + args.reserve(ac - 1); args.push_back(av[0]); - for(int i = 2; i < ac; ++i) - { - args.push_back(av[i]); - } + args.insert(args.end(), av + 2, av + ac); return cmcmd::ExecuteCMakeCommand(args); } @@ -221,11 +219,7 @@ int do_cmake(int ac, char const* const* av) // the command line args are processed here so that you can do // -DCMAKE_MODULE_PATH=/some/path and have this value accessible here - std::vector<std::string> args; - for(int i =0; i < ac; ++i) - { - args.push_back(av[i]); - } + std::vector<std::string> args(av, av + ac); hcm.SetCacheArgs(args); std::vector<cmDocumentationEntry> generators; |