From e166206702c8dbd3162452cf26f368e856ac0138 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 11 Dec 2024 19:15:18 +0100 Subject: More clang-tidy fixes and increase warning level (and fix them) --- src/tasks.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/tasks.cc') 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 #include #include +#include #include "ctor.h" #include "task.h" @@ -24,20 +25,22 @@ const std::deque& getTargets(const ctor::settings& settings, bool resolve_externals) { + auto config_files = std::span(configFiles).subspan(0, numConfigFiles); + static bool initialised{false}; static std::deque 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> taskFactory(const ctor::build_configuration& return tasks; } -std::shared_ptr getNextTask(const std::vector>& allTasks, +std::shared_ptr getNextTask([[maybe_unused]]const std::vector>& allTasks, std::vector>& dirtyTasks) { for(auto dirtyTask = dirtyTasks.begin(); -- cgit v1.2.3