diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-11 19:15:18 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-11 21:48:37 +0100 |
commit | e166206702c8dbd3162452cf26f368e856ac0138 (patch) | |
tree | e4e659fc91b0a47f04755b6298b8085370aefc8d /src/tasks.cc | |
parent | 936fb83eec4038a48e6e42f9f5d93677dc216ab4 (diff) |
More clang-tidy fixes and increase warning level (and fix them)
Diffstat (limited to 'src/tasks.cc')
-rw-r--r-- | src/tasks.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tasks.cc b/src/tasks.cc index 0e59097..2f9e47a 100644 --- a/src/tasks.cc +++ b/src/tasks.cc @@ -8,6 +8,7 @@ #include <list> #include <iostream> #include <algorithm> +#include <span> #include "ctor.h" #include "task.h" @@ -24,20 +25,22 @@ const std::deque<Target>& getTargets(const ctor::settings& settings, bool resolve_externals) { + auto config_files = std::span(configFiles).subspan(0, numConfigFiles); + static bool initialised{false}; static std::deque<Target> targets; if(!initialised) { const auto& externals = ctor::get_configuration().externals; - for(std::size_t i = 0; i < numConfigFiles; ++i) + for(const auto& config_file : config_files) { std::string path = - std::filesystem::path(configFiles[i].file).parent_path().string(); + std::filesystem::path(config_file.file).parent_path().string(); if(settings.verbose > 1) { - std::cout << configFiles[i].file << " in path " << path << "\n"; + std::cout << config_file.file << " in path " << path << "\n"; } - auto configs = configFiles[i].cb(settings); + auto configs = config_file.cb(settings); for(auto& config : configs) { if(resolve_externals) @@ -167,7 +170,7 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration& return tasks; } -std::shared_ptr<Task> getNextTask(const std::vector<std::shared_ptr<Task>>& allTasks, +std::shared_ptr<Task> getNextTask([[maybe_unused]]const std::vector<std::shared_ptr<Task>>& allTasks, std::vector<std::shared_ptr<Task>>& dirtyTasks) { for(auto dirtyTask = dirtyTasks.begin(); |