summaryrefslogtreecommitdiff
path: root/src/buildtool/main/describe.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-05-16 11:24:14 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-05-17 10:36:13 +0200
commit580539ab08a098e7f348fee3c46fbf5d44cd4d54 (patch)
treeb73f35182abf0b278ba435925a6cc01381705fc4 /src/buildtool/main/describe.cpp
parent0f96e596f42ef8619f173c547d7ee6c1be3aba12 (diff)
downloadjustbuild-580539ab08a098e7f348fee3c46fbf5d44cd4d54.tar.gz
RepositoryConfig: Instance should not be changed once populated
Once a RepositoryConfig instance gets populated, it must never be changed again. Therefore, all functions accepting these instances should only take them as pointers to const.
Diffstat (limited to 'src/buildtool/main/describe.cpp')
-rw-r--r--src/buildtool/main/describe.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buildtool/main/describe.cpp b/src/buildtool/main/describe.cpp
index 659ec3ab..1fb861d5 100644
--- a/src/buildtool/main/describe.cpp
+++ b/src/buildtool/main/describe.cpp
@@ -59,9 +59,10 @@ void PrintFields(nlohmann::json const& fields,
}
}
-void PrettyPrintRule(nlohmann::json const& rdesc,
- BuildMaps::Base::EntityName const& rule_name,
- gsl::not_null<RepositoryConfig*> const& repo_config) {
+void PrettyPrintRule(
+ nlohmann::json const& rdesc,
+ BuildMaps::Base::EntityName const& rule_name,
+ gsl::not_null<const RepositoryConfig*> const& repo_config) {
auto doc = rdesc.find("doc");
if (doc != rdesc.end()) {
PrintDoc(*doc, " | ");
@@ -228,7 +229,7 @@ void PrintRuleAsOrderedJson(nlohmann::json const& rdesc,
auto DescribeUserDefinedRule(
BuildMaps::Base::EntityName const& rule_name,
- gsl::not_null<RepositoryConfig*> const& repo_config,
+ gsl::not_null<const RepositoryConfig*> const& repo_config,
std::size_t jobs,
bool print_json) -> int {
bool failed{};
@@ -266,7 +267,7 @@ auto DescribeUserDefinedRule(
}
auto DescribeTarget(BuildMaps::Target::ConfiguredTarget const& id,
- gsl::not_null<RepositoryConfig*> const& repo_config,
+ gsl::not_null<const RepositoryConfig*> const& repo_config,
std::size_t jobs,
bool print_json) -> int {
#ifndef BOOTSTRAP_BUILD_TOOL