diff options
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/build.cc b/src/build.cc index ea65656..906c3ea 100644 --- a/src/build.cc +++ b/src/build.cc @@ -38,7 +38,7 @@ int build(const ctor::settings& settings, // Dry-run returns number of dirty tasks but otherwise does nothing. if(dryrun) { - return dirtyTasks.size(); + return static_cast<int>(dirtyTasks.size()); } if(dirtyTasks.empty()) @@ -114,17 +114,15 @@ int build(const ctor::settings& settings, } } - for(auto process = processes.begin(); - process != processes.end(); - ++process) + for(auto& process : processes) { - if(process->valid() == false) + if(process.valid() == false) { continue; } - process->wait(); - auto ret = process->get(); - if(ret != 0) + process.wait(); + auto ret = process.get(); + if (ret != 0) { return ret; } @@ -144,11 +142,11 @@ std::vector<std::shared_ptr<Task>> getDepTasks(std::shared_ptr<Task> task) for(const auto& dep : deps) { auto depSet = getDepTasks(dep); - for(const auto& dep : depSet) + for(const auto& dep_inner : depSet) { - if(std::find(tasks.begin(), tasks.end(), dep) == tasks.end()) + if(std::find(tasks.begin(), tasks.end(), dep_inner) == tasks.end()) { - tasks.push_back(dep); + tasks.push_back(dep_inner); } } } @@ -171,11 +169,11 @@ int build(const ctor::settings& settings, auto depSet = getDepTasks(task); std::vector<std::shared_ptr<Task>> ts; - for(const auto& task : depSet) + for(const auto& task_inner : depSet) { - if(std::find(ts.begin(), ts.end(), task) == ts.end()) + if(std::find(ts.begin(), ts.end(), task_inner) == ts.end()) { - ts.push_back(task); + ts.push_back(task_inner); } } @@ -217,11 +215,11 @@ int build(const ctor::settings& settings, task_found = true; auto depSet = getDepTasks(task); - for(const auto& task : depSet) + for(const auto& task_inner : depSet) { - if(std::find(ts.begin(), ts.end(), task) == ts.end()) + if(std::find(ts.begin(), ts.end(), task_inner) == ts.end()) { - ts.push_back(task); + ts.push_back(task_inner); } } } |