diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-30 12:16:43 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-07 13:37:39 +0200 |
commit | ce23db59c6399199fa55b4b7dc8880522e2f1bca (patch) | |
tree | 5b77d3c84289f023cbe6f4a81cf391a0087fe660 /src/buildtool/execution_api | |
parent | e5d7cb5ce5b9cc40b0c56b18980a4234118c1739 (diff) | |
download | justbuild-ce23db59c6399199fa55b4b7dc8880522e2f1bca.tar.gz |
Enable readability-redundant-member-init check.
Diffstat (limited to 'src/buildtool/execution_api')
11 files changed, 37 insertions, 37 deletions
diff --git a/src/buildtool/execution_api/common/content_blob_container.hpp b/src/buildtool/execution_api/common/content_blob_container.hpp index f15187f1..1788d229 100644 --- a/src/buildtool/execution_api/common/content_blob_container.hpp +++ b/src/buildtool/execution_api/common/content_blob_container.hpp @@ -37,9 +37,9 @@ struct ContentBlob final { bool is_exec) noexcept : digest{std::move(mydigest)}, data(mydata), is_exec{is_exec} {} - TDigest digest{}; - std::shared_ptr<std::string> data{}; - bool is_exec{}; + TDigest digest; + std::shared_ptr<std::string> data; + bool is_exec = false; }; template <typename TDigest> diff --git a/src/buildtool/execution_api/execution_service/server_implementation.hpp b/src/buildtool/execution_api/execution_service/server_implementation.hpp index 0236b17d..1a5db508 100644 --- a/src/buildtool/execution_api/execution_service/server_implementation.hpp +++ b/src/buildtool/execution_api/execution_service/server_implementation.hpp @@ -58,8 +58,8 @@ class ServerImpl final { std::string interface_{"127.0.0.1"}; int port_{0}; - std::string info_file_{}; - std::string pid_file_{}; + std::string info_file_; + std::string pid_file_; }; #endif // SERVER_IMPLEMENATION_HPP diff --git a/src/buildtool/execution_api/local/local_action.cpp b/src/buildtool/execution_api/local/local_action.cpp index e2ee373c..85c0254b 100644 --- a/src/buildtool/execution_api/local/local_action.cpp +++ b/src/buildtool/execution_api/local/local_action.cpp @@ -53,7 +53,7 @@ class BuildCleanupAnchor { } private: - std::filesystem::path const build_path{}; + std::filesystem::path const build_path; }; [[nodiscard]] auto CreateDigestFromLocalOwnedTree( diff --git a/src/buildtool/execution_api/local/local_action.hpp b/src/buildtool/execution_api/local/local_action.hpp index d6ab0e58..96541f58 100644 --- a/src/buildtool/execution_api/local/local_action.hpp +++ b/src/buildtool/execution_api/local/local_action.hpp @@ -42,7 +42,7 @@ class LocalAction final : public IExecutionAction { public: struct Output { - bazel_re::ActionResult action{}; + bazel_re::ActionResult action; bool is_cached{}; }; @@ -65,12 +65,12 @@ class LocalAction final : public IExecutionAction { private: Logger logger_{"LocalExecution"}; LocalContext const& local_context_; - ArtifactDigest const root_digest_{}; - std::vector<std::string> const cmdline_{}; - std::string const cwd_{}; - std::vector<std::string> output_files_{}; - std::vector<std::string> output_dirs_{}; - std::map<std::string, std::string> const env_vars_{}; + ArtifactDigest const root_digest_; + std::vector<std::string> const cmdline_; + std::string const cwd_; + std::vector<std::string> output_files_; + std::vector<std::string> output_dirs_; + std::map<std::string, std::string> const env_vars_; std::vector<bazel_re::Platform_Property> const properties_; std::chrono::milliseconds timeout_{kDefaultTimeout}; CacheFlag cache_flag_{CacheFlag::CacheOutput}; diff --git a/src/buildtool/execution_api/local/local_response.hpp b/src/buildtool/execution_api/local/local_response.hpp index 1bb2480b..fbb58b28 100644 --- a/src/buildtool/execution_api/local/local_response.hpp +++ b/src/buildtool/execution_api/local/local_response.hpp @@ -92,7 +92,7 @@ class LocalResponse final : public IExecutionResponse { } private: - std::string action_id_{}; + std::string action_id_; LocalAction::Output output_{}; Storage const& storage_; ArtifactInfos artifacts_; diff --git a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp index 8378dd70..3d23c235 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp @@ -152,7 +152,7 @@ class BazelCasClient { std::string const& instance_name) const noexcept -> bool; private: - std::unique_ptr<ByteStreamClient> stream_{}; + std::unique_ptr<ByteStreamClient> stream_; RetryConfig const& retry_config_; std::unique_ptr<bazel_re::ContentAddressableStorage::Stub> stub_; Logger logger_{"RemoteCasClient"}; @@ -188,9 +188,9 @@ class BazelCasClient { template <typename T_Content> struct RetryProcessBatchResponse { bool ok{false}; - std::vector<T_Content> result{}; + std::vector<T_Content> result; bool exit_retry_loop{false}; - std::optional<std::string> error_msg{}; + std::optional<std::string> error_msg; }; // If this function is defined in the .cpp file, clang raises an error diff --git a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp index cc423428..fd1ff5c1 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp @@ -37,11 +37,11 @@ class BazelExecutionClient { public: struct ExecutionOutput { - bazel_re::ActionResult action_result{}; + bazel_re::ActionResult action_result; bool cached_result{}; - grpc::Status status{}; - std::unordered_map<std::string, bazel_re::Digest> server_logs{}; - std::string message{}; + grpc::Status status; + std::unordered_map<std::string, bazel_re::Digest> server_logs; + std::string message; }; struct ExecutionResponse { @@ -53,7 +53,7 @@ class BazelExecutionClient { Retry }; - std::string execution_handle{}; + std::string execution_handle; State state{State::Unknown}; std::optional<ExecutionOutput> output{std::nullopt}; diff --git a/src/buildtool/execution_api/remote/bazel/bazel_network.hpp b/src/buildtool/execution_api/remote/bazel/bazel_network.hpp index a744daaf..9a9f6139 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_network.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_network.hpp @@ -92,10 +92,10 @@ class BazelNetwork { -> std::optional<bazel_re::ActionResult>; private: - std::string const instance_name_{}; - std::unique_ptr<BazelCasClient> cas_{}; - std::unique_ptr<BazelAcClient> ac_{}; - std::unique_ptr<BazelExecutionClient> exec_{}; + std::string const instance_name_; + std::unique_ptr<BazelCasClient> cas_; + std::unique_ptr<BazelAcClient> ac_; + std::unique_ptr<BazelExecutionClient> exec_; ExecutionConfiguration exec_config_{}; HashFunction const& hash_function_; diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.hpp b/src/buildtool/execution_api/remote/bazel/bazel_response.hpp index 7c095645..86e7491c 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_response.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_response.hpp @@ -66,8 +66,8 @@ class BazelResponse final : public IExecutionResponse { -> expected<gsl::not_null<DirSymlinks const*>, std::string> final; private: - std::string action_id_{}; - std::shared_ptr<BazelNetwork> const network_{}; + std::string action_id_; + std::shared_ptr<BazelNetwork> const network_; BazelExecutionClient::ExecutionOutput output_{}; ArtifactInfos artifacts_; DirSymlinks dir_symlinks_; diff --git a/src/buildtool/execution_api/remote/config.cpp b/src/buildtool/execution_api/remote/config.cpp index c2832c1b..7a73eaa1 100644 --- a/src/buildtool/execution_api/remote/config.cpp +++ b/src/buildtool/execution_api/remote/config.cpp @@ -27,7 +27,7 @@ auto RemoteExecutionConfig::Builder::Build() const noexcept -> expected<RemoteExecutionConfig, std::string> { // To not duplicate default arguments in builder, create a default config // and copy arguments from there. - RemoteExecutionConfig const default_config; + RemoteExecutionConfig const default_config{}; // Set remote endpoint. auto remote_address = default_config.remote_address; diff --git a/src/buildtool/execution_api/remote/config.hpp b/src/buildtool/execution_api/remote/config.hpp index 45420c80..36e83fdd 100644 --- a/src/buildtool/execution_api/remote/config.hpp +++ b/src/buildtool/execution_api/remote/config.hpp @@ -29,16 +29,16 @@ struct RemoteExecutionConfig final { class Builder; // Server address of remote execution. - std::optional<ServerAddress> const remote_address = {}; + std::optional<ServerAddress> const remote_address; // Server dispatch data - std::vector<DispatchEndpoint> const dispatch = {}; + std::vector<DispatchEndpoint> const dispatch; // Server address of cache endpoint for rebuild. - std::optional<ServerAddress> const cache_address = {}; + std::optional<ServerAddress> const cache_address; // Platform properties for execution. - ExecutionProperties const platform_properties = {}; + ExecutionProperties const platform_properties; }; class RemoteExecutionConfig::Builder final { @@ -80,16 +80,16 @@ class RemoteExecutionConfig::Builder final { private: // Server address of remote execution; needs parsing. - std::optional<std::string> remote_address_raw_{}; + std::optional<std::string> remote_address_raw_; // Server dispatch data file; needs parsing. - std::optional<std::filesystem::path> dispatch_file_{}; + std::optional<std::filesystem::path> dispatch_file_; // Server address of cache endpoint for rebuild; needs parsing. - std::optional<std::string> cache_address_raw_{}; + std::optional<std::string> cache_address_raw_; // Platform properties for execution; needs parsing. - std::vector<std::string> platform_properties_raw_{}; + std::vector<std::string> platform_properties_raw_; }; #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_REMOTE_CONFIG_HPP |