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/rebuild.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/rebuild.cc') diff --git a/src/rebuild.cc b/src/rebuild.cc index c176744..1db5e83 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -8,6 +8,7 @@ #include #include #include +#include #include "configure.h" #include "ctor.h" @@ -105,7 +106,7 @@ int unreg(const char* location) } } - return found; + return static_cast(found); } std::array externalConfigFiles; @@ -150,6 +151,8 @@ bool contains(const std::vector& sources, const std::string& file) bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[], bool relaunch_allowed) { + auto args_span = std::span(argv, static_cast(argc)); + using namespace std::string_literals; if(global_settings.verbose > 1) @@ -187,7 +190,7 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[ { std::filesystem::path buildfile = settings.builddir; - std::filesystem::path currentfile = argv[0]; + std::filesystem::path currentfile = args_span[0]; config.target = std::filesystem::relative(currentfile, buildfile).string(); } @@ -267,11 +270,12 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[ { args.emplace_back("--no-rerun"); } - for(int i = 1; i < argc; ++i) + for(std::size_t i = 1; i < args_span.size(); ++i) { - args.emplace_back(argv[i]); + args.emplace_back(args_span[i]); } - auto ret = execute(settings, argv[0], args); + + auto ret = execute(settings, args_span[0], args); //if(ret != 0) { exit(ret); -- cgit v1.2.3