diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp index 80108f80fc7..54d12088acc 100644 --- a/devtools/create_project/cmake.cpp +++ b/devtools/create_project/cmake.cpp @@ -68,11 +68,11 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f LibraryProps("mpc", "mpcdec").Libraries("mpcdec") }; - for (unsigned int i = 0; i < sizeof(s_libraries) / sizeof(s_libraries[0]); i++) { - bool matchingSDL = (s_libraries[i].sdlVersion == kSDLVersionAny) - || (s_libraries[i].sdlVersion == useSDL); - if (std::strcmp(feature, s_libraries[i].feature) == 0 && matchingSDL) { - return &s_libraries[i]; + for (const auto &library : s_libraries) { + bool matchingSDL = (library.sdlVersion == kSDLVersionAny) + || (library.sdlVersion == useSDL); + if (std::strcmp(feature, library.feature) == 0 && matchingSDL) { + return &library; } } diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp index 4d5d90b0100..4105cd94c97 100644 --- a/devtools/create_project/codeblocks.cpp +++ b/devtools/create_project/codeblocks.cpp @@ -44,8 +44,8 @@ void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) { writeReferences(setup, workspace); // Note we assume that the UUID map only includes UUIDs for enabled engines! - for (UUIDMap::const_iterator i = _engineUuidMap.begin(); i != _engineUuidMap.end(); ++i) { - workspace << "\t\tfirst << ".cbp\" />\n"; + for (const auto &i : _engineUuidMap) { + workspace << "\t\t\n"; } workspace << "\t\n" @@ -59,24 +59,24 @@ StringList getFeatureLibraries(const BuildSetup &setup) { libSDL += setup.getSDLName(); libraries.push_back(libSDL); - for (FeatureList::const_iterator i = setup.features.begin(); i != setup.features.end(); ++i) { - if (i->enable && i->library) { + for (const auto &feature : setup.features) { + if (feature.enable && feature.library) { std::string libname; - if (!std::strcmp(i->name, "libcurl")) { - libname = i->name; - } else if (!std::strcmp(i->name, "zlib")) { + if (!std::strcmp(feature.name, "libcurl")) { + libname = feature.name; + } else if (!std::strcmp(feature.name, "zlib")) { libname = "libz"; - } else if (!std::strcmp(i->name, "vorbis")) { + } else if (!std::strcmp(feature.name, "vorbis")) { libname = "libvorbis"; libraries.push_back("libvorbisfile"); - } else if (!std::strcmp(i->name, "png")) { + } else if (!std::strcmp(feature.name, "png")) { libname = "libpng16"; - } else if (!std::strcmp(i->name, "sdlnet")) { + } else if (!std::strcmp(feature.name, "sdlnet")) { libname = libSDL + "_net"; libraries.push_back("iphlpapi"); } else { libname = "lib"; - libname += i->name; + libname += feature.name; } libraries.push_back(libname); } @@ -111,8 +111,8 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s StringList libraries = getFeatureLibraries(setup); std::string deps; - for (StringList::const_iterator i = libraries.begin(); i != libraries.end(); ++i) - deps += (*i) + ".a;"; + for (const auto &library : libraries) + deps += library + ".a;"; project << "\t\t\t\n" "\t\t\t\t