diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-01 14:48:58 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-07 13:37:39 +0200 |
commit | c461673aad0970bc89f6336c966d2305eaae0dbb (patch) | |
tree | 7c5235778fdcabba010feb26133ec307b4268fe5 /src | |
parent | 7df9944604e2ef92abce20c00ea265793b151261 (diff) | |
download | justbuild-c461673aad0970bc89f6336c966d2305eaae0dbb.tar.gz |
Enable bugprone-implicit-widening-of-multiplication-result check.
Diffstat (limited to 'src')
5 files changed, 5 insertions, 5 deletions
diff --git a/src/buildtool/common/remote/retry_config.hpp b/src/buildtool/common/remote/retry_config.hpp index 91c8b75e..ed4b0108 100644 --- a/src/buildtool/common/remote/retry_config.hpp +++ b/src/buildtool/common/remote/retry_config.hpp @@ -78,7 +78,7 @@ class RetryConfig final { static std::mutex mutex; static std::mt19937 rng{std::random_device{}()}; try { - dist_type dist{0, backoff * 3}; + dist_type dist{0, 3UL * backoff}; std::unique_lock lock(mutex); return dist(rng); } catch (...) { diff --git a/src/buildtool/execution_api/common/bytestream_utils.hpp b/src/buildtool/execution_api/common/bytestream_utils.hpp index 672ae017..232c6728 100644 --- a/src/buildtool/execution_api/common/bytestream_utils.hpp +++ b/src/buildtool/execution_api/common/bytestream_utils.hpp @@ -31,7 +31,7 @@ class ByteStreamUtils final { public: // Chunk size for uploads (default size used by BuildBarn) - static constexpr std::size_t kChunkSize = 64 * 1024; + static constexpr std::size_t kChunkSize = 64UL * 1024; /// \brief Create a read request for the bytestream service to be /// transferred over the net. Handles serialization/deserialization on its diff --git a/src/buildtool/execution_api/common/message_limits.hpp b/src/buildtool/execution_api/common/message_limits.hpp index 47b3b8b1..5ad1818a 100644 --- a/src/buildtool/execution_api/common/message_limits.hpp +++ b/src/buildtool/execution_api/common/message_limits.hpp @@ -17,6 +17,6 @@ #include <grpc/grpc.h> // Max size for batch transfers -static constexpr std::size_t kMaxBatchTransferSize = 3 * 1024 * 1024; +static constexpr std::size_t kMaxBatchTransferSize = 3UL * 1024 * 1024; static_assert(kMaxBatchTransferSize < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, "Max batch transfer size too large."); diff --git a/src/buildtool/execution_api/execution_service/capabilities_server.cpp b/src/buildtool/execution_api/execution_service/capabilities_server.cpp index 0f3f7855..dc1532e1 100644 --- a/src/buildtool/execution_api/execution_service/capabilities_server.cpp +++ b/src/buildtool/execution_api/execution_service/capabilities_server.cpp @@ -36,7 +36,7 @@ auto CapabilitiesServiceImpl::GetCapabilities( cache.add_digest_functions( ::bazel_re::DigestFunction_Value::DigestFunction_Value_SHA256); cache.mutable_action_cache_update_capabilities()->set_update_enabled(false); - static constexpr std::size_t kMaxBatchTransferSize = 1024 * 1024; + static constexpr std::size_t kMaxBatchTransferSize = 1024UL * 1024; cache.set_max_batch_total_size_bytes(kMaxBatchTransferSize); static_assert(kMaxBatchTransferSize < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, "Max batch transfer size too large."); diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp index d506f4b9..39dd3cf7 100644 --- a/src/buildtool/file_system/file_system_manager.hpp +++ b/src/buildtool/file_system/file_system_manager.hpp @@ -1185,7 +1185,7 @@ class FileSystemManager { /// Non-zero return values indicate errors, which can be decoded using /// \ref ErrorToString. class LowLevel { - static constexpr std::size_t kDefaultChunkSize = 1024 * 32; + static constexpr std::size_t kDefaultChunkSize = 1024UL * 32; static constexpr int kWriteFlags = O_WRONLY | O_CREAT | O_TRUNC; // NOLINT static constexpr int kWritePerms = // 644 |