From: Mikko Rasa Date: Sat, 7 Jan 2023 13:12:53 +0000 (+0200) Subject: Rename some variables to avoid conflicts with C++20 keywords X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ea15b8404257f49b529253b82de45f5e85814154;p=builder.git Rename some variables to avoid conflicts with C++20 keywords --- diff --git a/source/cli/buildercli.cpp b/source/cli/buildercli.cpp index 9f8c895..5741fa6 100644 --- a/source/cli/buildercli.cpp +++ b/source/cli/buildercli.cpp @@ -337,17 +337,17 @@ void BuilderCLI::package_help() SourcePackage &main_pkg = dynamic_cast(package_manager.get_main_package()); const Config &config = main_pkg.get_config(); const auto &options = config.get_options(); - const Package::Requirements &requires = main_pkg.get_required_packages(); + const Package::Requirements &required_pkgs = main_pkg.get_required_packages(); - if(!requires.empty() || !options.empty()) + if(!required_pkgs.empty() || !options.empty()) IO::print("\nHelp for package %s:\n", main_pkg.get_name()); - if(!requires.empty()) + if(!required_pkgs.empty()) { IO::print("\nRequired packages:\n "); - for(auto i=requires.begin(); i!=requires.end(); ++i) + for(auto i=required_pkgs.begin(); i!=required_pkgs.end(); ++i) { - if(i!=requires.begin()) + if(i!=required_pkgs.begin()) IO::print(", "); IO::print((*i)->get_name()); } diff --git a/source/lib/component.cpp b/source/lib/component.cpp index f6ef96c..61aa0db 100644 --- a/source/lib/component.cpp +++ b/source/lib/component.cpp @@ -14,7 +14,7 @@ using namespace Msp; void Component::prepare() { - for(Package *r: requires) + for(Package *r: required_pkgs) { r->prepare(); broken |= r->is_broken(); @@ -34,7 +34,7 @@ void Component::create_build_info() final_build_info.defines[build_macro] = "1"; const Package::Requirements &pkg_reqs = package.get_required_packages(); - Package::Requirements direct_reqs = requires; + Package::Requirements direct_reqs = required_pkgs; direct_reqs.insert(direct_reqs.end(), pkg_reqs.begin(), pkg_reqs.end()); for(Package *r: direct_reqs) final_build_info.update_from(r->get_exported_build_info(), BuildInfo::DEPENDENCY); @@ -181,7 +181,7 @@ void Component::Loader::require(const string &n) { Package *req = obj.package.get_builder().get_package_manager().find_package(n); if(req) - obj.requires.push_back(req); + obj.required_pkgs.push_back(req); else obj.problems.push_back(format("Required package %s not found", n)); } diff --git a/source/lib/component.h b/source/lib/component.h index 7d9aa1a..246bd44 100644 --- a/source/lib/component.h +++ b/source/lib/component.h @@ -40,7 +40,7 @@ protected: std::vector overlays; bool install = false; BuildInfo build_info; - Package::Requirements requires; + Package::Requirements required_pkgs; bool deflt = true; InstallMap install_map; bool broken = false; @@ -66,7 +66,7 @@ protected: public: bool get_install() const { return install; } const InstallMap &get_install_map() const { return install_map; } - const Package::Requirements &get_required_packages() const { return requires; } + const Package::Requirements &get_required_packages() const { return required_pkgs; } bool is_default() const { return deflt; } bool is_broken() const { return broken; } const std::vector &get_problems() const { return problems; } diff --git a/source/lib/package.cpp b/source/lib/package.cpp index 25661fc..0c3adc5 100644 --- a/source/lib/package.cpp +++ b/source/lib/package.cpp @@ -20,7 +20,7 @@ void Package::prepare() prepared = true; - for(Package *r: requires) + for(Package *r: required_pkgs) { r->prepare(); broken |= r->is_broken(); @@ -43,7 +43,7 @@ void Package::Loader::require(const string &n) { Package *req = obj.builder.get_package_manager().find_package(n); if(req) - obj.requires.push_back(req); + obj.required_pkgs.push_back(req); else obj.problems.push_back(format("Required package %s not found", n)); } diff --git a/source/lib/package.h b/source/lib/package.h index e64c698..4d2c8dd 100644 --- a/source/lib/package.h +++ b/source/lib/package.h @@ -35,7 +35,7 @@ protected: std::string name; std::string label; - Requirements requires; + Requirements required_pkgs; BuildInfo export_binfo; bool prepared = false; bool broken = false; @@ -50,7 +50,7 @@ public: Builder &get_builder() const { return builder; } const std::string &get_name() const { return name; } const std::string &get_label() const { return label; } - const Requirements &get_required_packages() const { return requires; } + const Requirements &get_required_packages() const { return required_pkgs; } const BuildInfo &get_exported_build_info() const { return export_binfo; }