1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-19 02:17:27 +08:00

Convert more loops to range-based for-loops

This commit is contained in:
Vitaly Stakhovsky
2020-03-09 12:00:00 -04:00
committed by Brad King
parent 9296cd0551
commit cbbca9ee2a
2 changed files with 5 additions and 6 deletions

View File

@@ -2914,11 +2914,11 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
// command line without any escapes. However we still have to // command line without any escapes. However we still have to
// get the '$' and '#' characters through WMake as '$$' and // get the '$' and '#' characters through WMake as '$$' and
// '$#'. // '$#'.
for (const char* c = define.c_str(); *c; ++c) { for (char c : define) {
if (*c == '$' || *c == '#') { if (c == '$' || c == '#') {
def += '$'; def += '$';
} }
def += *c; def += c;
} }
} else { } else {
// Make the definition appear properly on the command line. Use // Make the definition appear properly on the command line. Use

View File

@@ -1510,10 +1510,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) { if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> depends = cmExpandedList(deps); std::vector<std::string> depends = cmExpandedList(deps);
const char* sep = ""; const char* sep = "";
for (std::vector<std::string>::iterator j = depends.begin(); for (const std::string& d : depends) {
j != depends.end(); ++j) {
fc.AdditionalDeps += sep; fc.AdditionalDeps += sep;
fc.AdditionalDeps += lg->ConvertToXMLOutputPath(*j); fc.AdditionalDeps += lg->ConvertToXMLOutputPath(d);
sep = ";"; sep = ";";
needfc = true; needfc = true;
} }