summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx4
-rw-r--r--Source/cmIDEOptions.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx10
5 files changed, 21 insertions, 26 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 70cb72a..c57649f 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -278,8 +278,8 @@ void cmGlobalVisualStudio8Generator::AddExtraIDETargets()
{
cmGlobalVisualStudio7Generator::AddExtraIDETargets();
if (this->AddCheckTarget()) {
- for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- const auto& tgts = this->LocalGenerators[i]->GetGeneratorTargets();
+ for (auto& LocalGenerator : this->LocalGenerators) {
+ const auto& tgts = LocalGenerator->GetGeneratorTargets();
// All targets depend on the build-system check target.
for (const auto& ti : tgts) {
if (ti->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 5a22697..9468d4a 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -21,8 +21,8 @@ cmIDEOptions::cmIDEOptions()
this->DoingInclude = false;
this->AllowSlash = false;
this->DoingFollowing = nullptr;
- for (int i = 0; i < FlagTableCount; ++i) {
- this->FlagTable[i] = nullptr;
+ for (auto& flag : this->FlagTable) {
+ flag = nullptr;
}
}
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index e1587f8..4d9fa2c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1435,8 +1435,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
fout << "\t<Files>\n";
// Loop through every source group.
- for (unsigned int i = 0; i < sourceGroups.size(); ++i) {
- cmSourceGroup sg = sourceGroups[i];
+ for (auto const& sg : sourceGroups) {
this->WriteGroup(&sg, target, fout, libName, configs, sources);
}
@@ -1630,9 +1629,9 @@ std::string cmLocalVisualStudio7Generator::ComputeLongestObjectDirectory(
// Compute the maximum length configuration name.
std::string config_max;
- for (auto i = configs.begin(); i != configs.end(); ++i) {
- if (i->size() > config_max.size()) {
- config_max = *i;
+ for (auto& config : configs) {
+ if (config.size() > config_max.size()) {
+ config_max = config;
}
}
@@ -1658,9 +1657,8 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
// Write the children to temporary output.
bool hasChildrenWithSources = false;
std::ostringstream tmpOut;
- for (unsigned int i = 0; i < children.size(); ++i) {
- if (this->WriteGroup(&children[i], target, tmpOut, libName, configs,
- sources)) {
+ for (const auto& child : children) {
+ if (this->WriteGroup(&child, target, tmpOut, libName, configs, sources)) {
hasChildrenWithSources = true;
}
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d91723f..87b1301 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -275,8 +275,8 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
this->NsightTegra = gg->IsNsightTegra();
this->Android = gg->TargetsAndroid();
- for (int i = 0; i < 4; ++i) {
- this->NsightTegraVersion[i] = 0;
+ for (unsigned int& version : this->NsightTegraVersion) {
+ version = 0;
}
sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u",
&this->NsightTegraVersion[0], &this->NsightTegraVersion[1],
@@ -2338,19 +2338,16 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(
if (!deployLocation.empty()) {
e2.Element("Link", deployLocation + "\\%(FileName)%(Extension)");
}
- for (size_t i = 0; i != this->Configurations.size(); ++i) {
- if (cge->Evaluate(this->LocalGenerator, this->Configurations[i]) ==
- "1") {
+ for (auto& config : this->Configurations) {
+ if (cge->Evaluate(this->LocalGenerator, config) == "1") {
e2.WritePlatformConfigTag("DeploymentContent",
"'$(Configuration)|$(Platform)'=='" +
- this->Configurations[i] + "|" +
- this->Platform + "'",
+ config + "|" + this->Platform + "'",
"true");
} else {
e2.WritePlatformConfigTag("ExcludedFromBuild",
"'$(Configuration)|$(Platform)'=='" +
- this->Configurations[i] + "|" +
- this->Platform + "'",
+ config + "|" + this->Platform + "'",
"true");
}
}
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index af614af..763f676 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -51,9 +51,9 @@ cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
{
if (table) {
- for (int i = 0; i < FlagTableCount; ++i) {
- if (!this->FlagTable[i]) {
- this->FlagTable[i] = table;
+ for (auto& flag : this->FlagTable) {
+ if (!flag) {
+ flag = table;
break;
}
}
@@ -62,8 +62,8 @@ void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
void cmVisualStudioGeneratorOptions::ClearTables()
{
- for (int i = 0; i < FlagTableCount; ++i) {
- this->FlagTable[i] = nullptr;
+ for (auto& flag : this->FlagTable) {
+ flag = nullptr;
}
}