From 6db64ad43202af66270d996775e1504ba676b63d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 11 Oct 2016 13:09:38 -0400 Subject: cmake: Use array iteration for default generator list --- Source/cmake.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d74b7c1..6ffa308 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1466,18 +1466,18 @@ void cmake::CreateDefaultGlobalGenerator() { "11.0", "Visual Studio 11 2012" }, { "12.0", "Visual Studio 12 2013" }, { "14.0", "Visual Studio 14 2015" }, - { "15.0", "Visual Studio 15" }, - { 0, 0 } + { "15.0", "Visual Studio 15" } }; - for (int i = 0; vsGenerators[i].MSVersion != 0; i++) { + for (VSVersionedGenerator const* g = cmArrayBegin(vsGenerators); + g != cmArrayEnd(vsGenerators); ++g) { for (size_t b = 0; b < vsVerions.size(); b++) { - std::string reg = vsregBase + vsVerions[b] + vsGenerators[i].MSVersion; + std::string reg = vsregBase + vsVerions[b] + g->MSVersion; reg += ";InstallDir"; std::string dir; if (cmSystemTools::ReadRegistryValue(reg, dir, cmSystemTools::KeyWOW64_32) && cmSystemTools::PathExists(dir)) { - found = vsGenerators[i].GeneratorName; + found = g->GeneratorName; break; } } -- cgit v0.12