summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-09-04 20:17:22 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-09-10 20:21:41 (GMT)
commitd25a5a7ec91bfa072d3cf1a302830a54506c88c0 (patch)
treed06203c8e5b5fdd38645e0fb9b284ded26651f44 /Source/CPack
parentbbf48c494ad28d1c8ac5aa6e4cecb35c2cbf1b84 (diff)
downloadCMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.zip
CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.gz
CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.bz2
clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx28
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx6
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx3
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx9
4 files changed, 18 insertions, 28 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index d1ffcef..94530c1 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -77,8 +77,7 @@ int cmCPackIFWGenerator::PackageFiles()
if (!this->OnlineOnly && !this->DownloadedPackages.empty()) {
ifwCmd.emplace_back("-i");
- std::set<cmCPackIFWPackage*>::iterator it =
- this->DownloadedPackages.begin();
+ auto it = this->DownloadedPackages.begin();
ifwArg = (*it)->Name;
++it;
while (it != this->DownloadedPackages.end()) {
@@ -137,8 +136,7 @@ int cmCPackIFWGenerator::PackageFiles()
if (!this->Installer.Resources.empty()) {
ifwCmd.emplace_back("-r");
- std::vector<std::string>::iterator it =
- this->Installer.Resources.begin();
+ auto it = this->Installer.Resources.begin();
std::string path = this->toplevel + "/resources/";
ifwArg = path + *it;
++it;
@@ -180,8 +178,7 @@ int cmCPackIFWGenerator::PackageFiles()
} else if (!this->DownloadedPackages.empty() &&
!this->Installer.RemoteRepositories.empty()) {
ifwCmd.emplace_back("-e");
- std::set<cmCPackIFWPackage*>::iterator it =
- this->DownloadedPackages.begin();
+ auto it = this->DownloadedPackages.begin();
ifwArg = (*it)->Name;
++it;
while (it != this->DownloadedPackages.end()) {
@@ -193,14 +190,13 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd.emplace_back("-i");
ifwArg.clear();
// Binary
- std::set<cmCPackIFWPackage*>::iterator bit =
- this->BinaryPackages.begin();
+ auto bit = this->BinaryPackages.begin();
while (bit != this->BinaryPackages.end()) {
ifwArg += (*bit)->Name + ",";
++bit;
}
// Depend
- DependenceMap::iterator it = this->DependentPackages.begin();
+ auto it = this->DependentPackages.begin();
ifwArg += it->second.Name;
++it;
while (it != this->DependentPackages.end()) {
@@ -410,7 +406,7 @@ std::string cmCPackIFWGenerator::GetComponentInstallDirNameSuffix(
cmCPackComponent* cmCPackIFWGenerator::GetComponent(
const std::string& projectName, const std::string& componentName)
{
- ComponentsMap::iterator cit = this->Components.find(componentName);
+ auto cit = this->Components.find(componentName);
if (cit != this->Components.end()) {
return &(cit->second);
}
@@ -422,7 +418,7 @@ cmCPackComponent* cmCPackIFWGenerator::GetComponent(
}
std::string name = this->GetComponentPackageName(component);
- PackagesMap::iterator pit = this->Packages.find(name);
+ auto pit = this->Packages.find(name);
if (pit != this->Packages.end()) {
return component;
}
@@ -462,7 +458,7 @@ cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
}
std::string name = this->GetGroupPackageName(group);
- PackagesMap::iterator pit = this->Packages.find(name);
+ auto pit = this->Packages.find(name);
if (pit != this->Packages.end()) {
return group;
}
@@ -593,23 +589,21 @@ std::string cmCPackIFWGenerator::GetComponentPackageName(
cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
cmCPackComponentGroup* group) const
{
- std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit =
- this->GroupPackages.find(group);
+ auto pit = this->GroupPackages.find(group);
return pit != this->GroupPackages.end() ? pit->second : nullptr;
}
cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
cmCPackComponent* component) const
{
- std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit =
- this->ComponentPackages.find(component);
+ auto pit = this->ComponentPackages.find(component);
return pit != this->ComponentPackages.end() ? pit->second : nullptr;
}
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
const std::string& repositoryName)
{
- RepositoriesMap::iterator rit = this->Repositories.find(repositoryName);
+ auto rit = this->Repositories.find(repositoryName);
if (rit != this->Repositories.end()) {
return &(rit->second);
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index fb75145..5fa8cce 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -620,7 +620,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
// Write dependencies
if (!compDepSet.empty()) {
std::ostringstream dependencies;
- std::set<DependenceStruct>::iterator it = compDepSet.begin();
+ auto it = compDepSet.begin();
dependencies << it->NameWithCompare();
++it;
while (it != compDepSet.end()) {
@@ -638,7 +638,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
// Write automatic dependency on
if (!compAutoDepSet.empty()) {
std::ostringstream dependencies;
- std::set<DependenceStruct>::iterator it = compAutoDepSet.begin();
+ auto it = compAutoDepSet.begin();
dependencies << it->NameWithCompare();
++it;
while (it != compAutoDepSet.end()) {
@@ -674,7 +674,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
// Replaces
if (!this->Replaces.empty()) {
std::ostringstream replaces;
- std::vector<std::string>::iterator it = this->Replaces.begin();
+ auto it = this->Replaces.begin();
replaces << *it;
++it;
while (it != this->Replaces.end()) {
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 4d41049..a564eb1 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -158,8 +158,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
const std::string& name)
{
- cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it =
- this->GeneratorCreators.find(name);
+ auto it = this->GeneratorCreators.find(name);
if (it == this->GeneratorCreators.end()) {
return nullptr;
}
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 0f621cc..e8728a3 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -184,8 +184,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
// The default behavior is to have one package by component group
// unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
if (!ignoreGroup) {
- std::map<std::string, cmCPackComponentGroup>::iterator mainCompGIt =
- this->ComponentGroups.end();
+ auto mainCompGIt = this->ComponentGroups.end();
std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
for (compGIt = this->ComponentGroups.begin();
@@ -206,8 +205,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
retval &= PackageOnePack(initialTopLevel, compGIt->first);
}
// Handle Orphan components (components not belonging to any groups)
- std::map<std::string, cmCPackComponent>::iterator mainCompIt =
- this->Components.end();
+ auto mainCompIt = this->Components.end();
std::map<std::string, cmCPackComponent>::iterator compIt;
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
@@ -251,8 +249,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
// CPACK_COMPONENTS_IGNORE_GROUPS is set
// We build 1 package per component
else {
- std::map<std::string, cmCPackComponent>::iterator mainCompIt =
- this->Components.end();
+ auto mainCompIt = this->Components.end();
std::map<std::string, cmCPackComponent>::iterator compIt;
for (compIt = this->Components.begin(); compIt != this->Components.end();