[CI] Upgraded clang to 19 for sanity tests (#38070)

This change upgrades the sanity test to use Clang 19, including clang-format and clang-tidy. (It's a partial implementation of the changes proposed in #38038)

Key updates:
- Docker images now utilize Clang 19.
- Code has been reformatted using the updated clang-format.
- Resolved `readability-math-missing-parentheses` warnings raised by clang-tidy.

Note that the other part of the clang-19 upgrade, "using clang-19 for C++ test" will be done once opentelemetry-cpp fixes the clang-19 build error.

Closes #38070

PiperOrigin-RevId: 693833548
pull/37782/merge
Esun Kim 3 weeks ago committed by Copybara-Service
parent 6a0377ea4c
commit 6a0c483bea
  1. 6
      .clang-tidy
  2. 4
      src/core/ext/filters/http/message_compress/compression_filter.cc
  3. 3
      src/core/ext/transport/chaotic_good/chaotic_good_transport.h
  4. 2
      src/core/ext/transport/chaotic_good/server_transport.cc
  5. 3
      src/core/ext/transport/chaotic_good_legacy/chaotic_good_transport.h
  6. 2
      src/core/ext/transport/chaotic_good_legacy/server_transport.cc
  7. 5
      src/core/ext/transport/chttp2/transport/bin_decoder.cc
  8. 6
      src/core/ext/transport/chttp2/transport/bin_encoder.cc
  9. 4
      src/core/ext/transport/chttp2/transport/decode_huff.h
  10. 2
      src/core/ext/transport/chttp2/transport/flow_control.cc
  11. 2
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  12. 2
      src/core/lib/event_engine/posix_engine/timer_heap.cc
  13. 4
      src/core/lib/iomgr/closure.h
  14. 2
      src/core/lib/iomgr/timer_heap.cc
  15. 3
      src/core/lib/promise/match_promise.h
  16. 6
      src/core/lib/resource_quota/memory_quota.cc
  17. 2
      src/core/lib/surface/filter_stack_call.h
  18. 2
      src/core/lib/transport/bdp_estimator.cc
  19. 8
      src/core/lib/transport/timeout_encoding.cc
  20. 2
      src/core/load_balancing/outlier_detection/outlier_detection.cc
  21. 6
      src/core/telemetry/histogram_view.cc
  22. 8
      src/core/util/gpr_time.cc
  23. 4
      src/core/util/string.cc
  24. 8
      src/core/util/time.cc
  25. 4
      src/core/util/time.h
  26. 4
      src/cpp/server/load_reporter/load_reporter_async_service_impl.cc
  27. 2
      templates/tools/dockerfile/grpc_clang_format/Dockerfile.template
  28. 2
      templates/tools/dockerfile/grpc_clang_tidy/Dockerfile.template
  29. 2
      templates/tools/dockerfile/test/sanity/Dockerfile.template
  30. 8
      test/core/channelz/channelz_test.cc
  31. 2
      test/core/event_engine/posix/timer_heap_test.cc
  32. 2
      test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc
  33. 4
      test/core/http/parser_test.cc
  34. 2
      test/core/iomgr/endpoint_tests.cc
  35. 3
      test/core/iomgr/tcp_posix_test.cc
  36. 4
      test/core/iomgr/timer_heap_test.cc
  37. 3
      test/core/network_benchmarks/low_level_ping_pong.cc
  38. 4
      test/core/promise/inter_activity_pipe_test.cc
  39. 2
      test/core/promise/sleep_test.cc
  40. 2
      test/core/resolver/fake_resolver_test.cc
  41. 2
      test/core/resource_quota/memory_quota_test.cc
  42. 6
      test/core/test_util/histogram.cc
  43. 2
      test/core/test_util/stack_tracer.cc
  44. 2
      test/core/tsi/alts/crypt/gsec_test_util.cc
  45. 4
      test/core/util/validation_errors_test.cc
  46. 6
      test/cpp/end2end/xds/xds_cluster_end2end_test.cc
  47. 4
      test/cpp/microbenchmarks/callback_unary_ping_pong.h
  48. 2
      test/cpp/microbenchmarks/fullstack_context_mutators.h
  49. 4
      test/cpp/microbenchmarks/fullstack_unary_ping_pong.h
  50. 4
      test/cpp/qps/driver.cc
  51. 2
      test/cpp/qps/qps_json_driver.cc
  52. 4
      test/cpp/qps/usage_timer.cc
  53. 2
      test/cpp/util/cli_credentials.cc
  54. 2
      tools/bazelify_tests/dockerimage_current_versions.bzl
  55. 2
      tools/dockerfile/grpc_clang_format/Dockerfile
  56. 2
      tools/dockerfile/grpc_clang_tidy/Dockerfile
  57. 2
      tools/dockerfile/test/sanity.current_version
  58. 2
      tools/dockerfile/test/sanity/Dockerfile

@ -70,6 +70,7 @@ Checks: '-*,
-bugprone-assignment-in-if-condition, -bugprone-assignment-in-if-condition,
-bugprone-branch-clone, -bugprone-branch-clone,
-bugprone-casting-through-void, -bugprone-casting-through-void,
-bugprone-crtp-constructor-accessibility,
-bugprone-easily-swappable-parameters, -bugprone-easily-swappable-parameters,
-bugprone-empty-catch, -bugprone-empty-catch,
-bugprone-exception-escape, -bugprone-exception-escape,
@ -80,8 +81,10 @@ Checks: '-*,
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result, -bugprone-not-null-terminated-result,
-bugprone-reserved-identifier, -bugprone-reserved-identifier,
-bugprone-return-const-ref-from-parameter,
-bugprone-signed-char-misuse, -bugprone-signed-char-misuse,
-bugprone-sizeof-expression, -bugprone-sizeof-expression,
-bugprone-suspicious-stringview-data-usage,
-bugprone-switch-missing-default-case, -bugprone-switch-missing-default-case,
-bugprone-too-small-loop-variable, -bugprone-too-small-loop-variable,
-bugprone-unchecked-optional-access, -bugprone-unchecked-optional-access,
@ -92,6 +95,7 @@ Checks: '-*,
performance-*, performance-*,
-performance-avoid-endl, -performance-avoid-endl,
-performance-enum-size, -performance-enum-size,
-performance-inefficient-vector-operation,
-performance-no-automatic-move, -performance-no-automatic-move,
-performance-no-int-to-ptr, -performance-no-int-to-ptr,
-performance-noexcept-swap, -performance-noexcept-swap,
@ -140,7 +144,7 @@ Checks: '-*,
readability-duplicate-include, readability-duplicate-include,
readability-function-size, readability-function-size,
readability-inconsistent-declaration-parameter-name, readability-inconsistent-declaration-parameter-name,
readability-math-missing-parentheses, -readability-math-missing-parentheses,
readability-misleading-indentation, readability-misleading-indentation,
readability-misplaced-array-index, readability-misplaced-array-index,
readability-redundant-access-specifiers, readability-redundant-access-specifiers,

@ -136,8 +136,8 @@ MessageHandle ChannelCompression::CompressMessage(
const char* algo_name; const char* algo_name;
const size_t before_size = payload->Length(); const size_t before_size = payload->Length();
const size_t after_size = tmp.Length(); const size_t after_size = tmp.Length();
const float savings_ratio = 1.0f - static_cast<float>(after_size) / const float savings_ratio = 1.0f - (static_cast<float>(after_size) /
static_cast<float>(before_size); static_cast<float>(before_size));
CHECK(grpc_compression_algorithm_name(algorithm, &algo_name)); CHECK(grpc_compression_algorithm_name(algorithm, &algo_name));
LOG(INFO) << absl::StrFormat( LOG(INFO) << absl::StrFormat(
"Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR

@ -108,7 +108,8 @@ class ChaoticGoodTransport : public RefCounted<ChaoticGoodTransport> {
}); });
}, },
[&frame_header]() { [&frame_header]() {
return [status = frame_header.status()]() mutable return
[status = frame_header.status()]() mutable
-> absl::StatusOr<std::tuple<FrameHeader, BufferPair>> { -> absl::StatusOr<std::tuple<FrameHeader, BufferPair>> {
return std::move(status); return std::move(status);
}; };

@ -176,7 +176,7 @@ auto ChaoticGoodServerTransport::SendCallBody(
const uint32_t padding = const uint32_t padding =
message_length % aligned_bytes == 0 message_length % aligned_bytes == 0
? 0 ? 0
: aligned_bytes - message_length % aligned_bytes; : aligned_bytes - (message_length % aligned_bytes);
CHECK_EQ((message_length + padding) % aligned_bytes, 0u); CHECK_EQ((message_length + padding) % aligned_bytes, 0u);
frame.message = frame.message =
FragmentMessage(std::move(message), padding, message_length); FragmentMessage(std::move(message), padding, message_length);

@ -108,7 +108,8 @@ class ChaoticGoodTransport : public RefCounted<ChaoticGoodTransport> {
}); });
}, },
[&frame_header]() { [&frame_header]() {
return [status = frame_header.status()]() mutable return
[status = frame_header.status()]() mutable
-> absl::StatusOr<std::tuple<FrameHeader, BufferPair>> { -> absl::StatusOr<std::tuple<FrameHeader, BufferPair>> {
return std::move(status); return std::move(status);
}; };

@ -176,7 +176,7 @@ auto ChaoticGoodServerTransport::SendCallBody(
const uint32_t padding = const uint32_t padding =
message_length % aligned_bytes == 0 message_length % aligned_bytes == 0
? 0 ? 0
: aligned_bytes - message_length % aligned_bytes; : aligned_bytes - (message_length % aligned_bytes);
CHECK_EQ((message_length + padding) % aligned_bytes, 0u); CHECK_EQ((message_length + padding) % aligned_bytes, 0u);
frame.message = frame.message =
FragmentMessage(std::move(message), padding, message_length); FragmentMessage(std::move(message), padding, message_length);

@ -96,7 +96,7 @@ size_t grpc_chttp2_base64_infer_length_after_decode(const grpc_slice& slice) {
<< " (without padding), which is invalid.\n"; << " (without padding), which is invalid.\n";
return 0; return 0;
} }
return tuples * 3 + tail_xtra[tail_case]; return (tuples * 3) + tail_xtra[tail_case];
} }
bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) { bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) {
@ -215,7 +215,8 @@ grpc_slice grpc_chttp2_base64_decode_with_length(const grpc_slice& input,
input_length / 4 * 3 + tail_xtra[input_length % 4])) { input_length / 4 * 3 + tail_xtra[input_length % 4])) {
LOG(ERROR) << "Base64 decoding failed, output_length " << output_length LOG(ERROR) << "Base64 decoding failed, output_length " << output_length
<< " is longer than the max possible output length " << " is longer than the max possible output length "
<< (input_length / 4 * 3 + tail_xtra[input_length % 4]) << ".\n"; << ((input_length / 4 * 3) + tail_xtra[input_length % 4])
<< ".\n";
grpc_core::CSliceUnref(output); grpc_core::CSliceUnref(output);
return grpc_empty_slice(); return grpc_empty_slice();
} }

@ -51,7 +51,7 @@ grpc_slice grpc_chttp2_base64_encode(const grpc_slice& input) {
size_t input_length = GRPC_SLICE_LENGTH(input); size_t input_length = GRPC_SLICE_LENGTH(input);
size_t input_triplets = input_length / 3; size_t input_triplets = input_length / 3;
size_t tail_case = input_length % 3; size_t tail_case = input_length % 3;
size_t output_length = input_triplets * 4 + tail_xtra[tail_case]; size_t output_length = (input_triplets * 4) + tail_xtra[tail_case];
grpc_slice output = GRPC_SLICE_MALLOC(output_length); grpc_slice output = GRPC_SLICE_MALLOC(output_length);
const uint8_t* in = GRPC_SLICE_START_PTR(input); const uint8_t* in = GRPC_SLICE_START_PTR(input);
char* out = reinterpret_cast<char*> GRPC_SLICE_START_PTR(output); char* out = reinterpret_cast<char*> GRPC_SLICE_START_PTR(output);
@ -171,9 +171,9 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(
size_t input_length = GRPC_SLICE_LENGTH(input); size_t input_length = GRPC_SLICE_LENGTH(input);
size_t input_triplets = input_length / 3; size_t input_triplets = input_length / 3;
size_t tail_case = input_length % 3; size_t tail_case = input_length % 3;
size_t output_syms = input_triplets * 4 + tail_xtra[tail_case]; size_t output_syms = (input_triplets * 4) + tail_xtra[tail_case];
size_t max_output_bits = 11 * output_syms; size_t max_output_bits = 11 * output_syms;
size_t max_output_length = max_output_bits / 8 + (max_output_bits % 8 != 0); size_t max_output_length = (max_output_bits / 8) + (max_output_bits % 8 != 0);
grpc_slice output = GRPC_SLICE_MALLOC(max_output_length); grpc_slice output = GRPC_SLICE_MALLOC(max_output_length);
const uint8_t* in = GRPC_SLICE_START_PTR(input); const uint8_t* in = GRPC_SLICE_START_PTR(input);
uint8_t* start_out = GRPC_SLICE_START_PTR(output); uint8_t* start_out = GRPC_SLICE_START_PTR(output);

@ -87,7 +87,7 @@ class HuffDecoderCommon {
return table1_emit_[i >> 6][emit]; return table1_emit_[i >> 6][emit];
} }
static inline uint64_t GetOp13(size_t i) { static inline uint64_t GetOp13(size_t i) {
return table13_0_inner_[(i < 3 ? (i) : ((i - 3) / 12 + 3))]; return table13_0_inner_[(i < 3 ? (i) : (((i - 3) / 12) + 3))];
} }
static inline uint64_t GetEmit13(size_t, size_t emit) { static inline uint64_t GetEmit13(size_t, size_t emit) {
return (emit < 1 ? (((void)emit, 92)) : ((emit - 1) ? 208 : 195)); return (emit < 1 ? (((void)emit, 92)) : ((emit - 1) ? 208 : 195));
@ -189,7 +189,7 @@ class HuffDecoderCommon {
} }
static inline uint64_t GetEmit37(size_t, size_t emit) { return emit + 236; } static inline uint64_t GetEmit37(size_t, size_t emit) { return emit + 236; }
static inline uint64_t GetOp36(size_t i) { static inline uint64_t GetOp36(size_t i) {
return table36_0_inner_[(i < 3 ? (i / 2 + 0) : ((i - 3) + 1))]; return table36_0_inner_[(i < 3 ? ((i / 2) + 0) : ((i - 3) + 1))];
} }
static inline uint64_t GetEmit36(size_t, size_t emit) { static inline uint64_t GetEmit36(size_t, size_t emit) {
return table36_0_emit_[emit]; return table36_0_emit_[emit];

@ -182,7 +182,7 @@ TransportFlowControl::TargetInitialWindowSizeBasedOnMemoryPressureAndBdp()
// and a value t such that t_min <= t <= t_max, return the value on the line // and a value t such that t_min <= t <= t_max, return the value on the line
// segment at t. // segment at t.
auto lerp = [](double t, double t_min, double t_max, double a, double b) { auto lerp = [](double t, double t_min, double t_max, double a, double b) {
return a + (b - a) * (t - t_min) / (t_max - t_min); return a + ((b - a) * (t - t_min) / (t_max - t_min));
}; };
// We split memory pressure into three broad regions: // We split memory pressure into three broad regions:
// 1. Low memory pressure, the "anything goes" case - we assume no memory // 1. Low memory pressure, the "anything goes" case - we assume no memory

@ -403,7 +403,7 @@ absl::optional<std::vector<uint8_t>> HPackParser::String::Unbase64Loop(
} }
std::vector<uint8_t> out; std::vector<uint8_t> out;
out.reserve(3 * (end - cur) / 4 + 3); out.reserve((3 * (end - cur) / 4) + 3);
// Decode 4 bytes at a time while we can // Decode 4 bytes at a time while we can
while (end - cur >= 4) { while (end - cur >= 4) {

@ -50,7 +50,7 @@ void TimerHeap::AdjustUpwards(size_t i, Timer* t) {
// position. // position.
void TimerHeap::AdjustDownwards(size_t i, Timer* t) { void TimerHeap::AdjustDownwards(size_t i, Timer* t) {
for (;;) { for (;;) {
size_t left_child = 1 + 2 * i; size_t left_child = 1 + (2 * i);
if (left_child >= timers_.size()) break; if (left_child >= timers_.size()) break;
size_t right_child = left_child + 1; size_t right_child = left_child + 1;
size_t next_i = size_t next_i =

@ -212,7 +212,9 @@ inline grpc_closure* grpc_closure_create(grpc_iomgr_cb_func cb, void* cb_arg) {
#endif #endif
#define GRPC_CLOSURE_LIST_INIT \ #define GRPC_CLOSURE_LIST_INIT \
{ nullptr, nullptr } { \
nullptr, nullptr \
}
inline void grpc_closure_list_init(grpc_closure_list* closure_list) { inline void grpc_closure_list_init(grpc_closure_list* closure_list) {
closure_list->head = closure_list->tail = nullptr; closure_list->head = closure_list->tail = nullptr;

@ -48,7 +48,7 @@ static void adjust_upwards(grpc_timer** first, uint32_t i, grpc_timer* t) {
static void adjust_downwards(grpc_timer** first, uint32_t i, uint32_t length, static void adjust_downwards(grpc_timer** first, uint32_t i, uint32_t length,
grpc_timer* t) { grpc_timer* t) {
for (;;) { for (;;) {
uint32_t left_child = 1u + 2u * i; uint32_t left_child = 1u + (2u * i);
if (left_child >= length) break; if (left_child >= length) break;
uint32_t right_child = left_child + 1; uint32_t right_child = left_child + 1;
uint32_t next_i = right_child < length && first[left_child]->deadline > uint32_t next_i = right_child < length && first[left_child]->deadline >

@ -50,8 +50,7 @@ struct ConstructPromiseVariantVisitor {
// the result into a variant type that covers ALL of the possible return types // the result into a variant type that covers ALL of the possible return types
// given the input types listed in Ts... // given the input types listed in Ts...
template <typename T> template <typename T>
auto operator()(T x) auto operator()(T x) -> absl::variant<promise_detail::PromiseLike<
-> absl::variant<promise_detail::PromiseLike<
decltype(CallConstructorThenFactory(std::declval<Ts>()))>...> { decltype(CallConstructorThenFactory(std::declval<Ts>()))>...> {
return CallConstructorThenFactory(x); return CallConstructorThenFactory(x);
} }

@ -346,7 +346,7 @@ void GrpcMemoryAllocatorImpl::MaybeDonateBack() {
size_t ret = 0; size_t ret = 0;
if (!IsUnconstrainedMaxQuotaBufferSizeEnabled() && if (!IsUnconstrainedMaxQuotaBufferSizeEnabled() &&
free > kMaxQuotaBufferSize / 2) { free > kMaxQuotaBufferSize / 2) {
ret = std::max(ret, free - kMaxQuotaBufferSize / 2); ret = std::max(ret, free - (kMaxQuotaBufferSize / 2));
} }
ret = std::max(ret, free > 8192 ? free / 2 : free); ret = std::max(ret, free > 8192 ? free / 2 : free);
const size_t new_free = free - ret; const size_t new_free = free - ret;
@ -719,8 +719,8 @@ double PressureController::Update(double error) {
// (If we want a control value that's higher than the last one we snap // (If we want a control value that's higher than the last one we snap
// immediately because it's likely that memory pressure is growing unchecked). // immediately because it's likely that memory pressure is growing unchecked).
if (new_control < last_control_) { if (new_control < last_control_) {
new_control = new_control = std::max(new_control,
std::max(new_control, last_control_ - max_reduction_per_tick_ / 1000.0); last_control_ - (max_reduction_per_tick_ / 1000.0));
} }
last_control_ = new_control; last_control_ = new_control;
return new_control; return new_control;

@ -131,7 +131,7 @@ class FilterStackCall final : public Call {
static size_t InitialSizeEstimate() { static size_t InitialSizeEstimate() {
return sizeof(FilterStackCall) + return sizeof(FilterStackCall) +
sizeof(BatchControl) * kMaxConcurrentBatches; (sizeof(BatchControl) * kMaxConcurrentBatches);
} }
char* GetPeer() final; char* GetPeer() final;

@ -43,7 +43,7 @@ Timestamp BdpEstimator::CompletePing() {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec dt_ts = gpr_time_sub(now, ping_start_time_); gpr_timespec dt_ts = gpr_time_sub(now, ping_start_time_);
double dt = static_cast<double>(dt_ts.tv_sec) + double dt = static_cast<double>(dt_ts.tv_sec) +
1e-9 * static_cast<double>(dt_ts.tv_nsec); (1e-9 * static_cast<double>(dt_ts.tv_nsec));
double bw = dt > 0 ? (static_cast<double>(accumulator_) / dt) : 0; double bw = dt > 0 ? (static_cast<double>(accumulator_) / dt) : 0;
Duration start_inter_ping_delay = inter_ping_delay_; Duration start_inter_ping_delay = inter_ping_delay_;
GRPC_TRACE_LOG(bdp_estimator, INFO) GRPC_TRACE_LOG(bdp_estimator, INFO)

@ -258,12 +258,12 @@ absl::optional<Duration> ParseTimeout(const Slice& text) {
Duration timeout; Duration timeout;
switch (*p) { switch (*p) {
case 'n': case 'n':
timeout = timeout = Duration::Milliseconds((x / GPR_NS_PER_MS) +
Duration::Milliseconds(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0)); (x % GPR_NS_PER_MS != 0));
break; break;
case 'u': case 'u':
timeout = timeout = Duration::Milliseconds((x / GPR_US_PER_MS) +
Duration::Milliseconds(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0)); (x % GPR_US_PER_MS != 0));
break; break;
case 'm': case 'm':
timeout = Duration::Milliseconds(x); timeout = Duration::Milliseconds(x);

@ -924,7 +924,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() {
double stdev = std::sqrt(variance); double stdev = std::sqrt(variance);
const double success_rate_stdev_factor = const double success_rate_stdev_factor =
static_cast<double>(config.success_rate_ejection->stdev_factor) / 1000; static_cast<double>(config.success_rate_ejection->stdev_factor) / 1000;
double ejection_threshold = mean - stdev * success_rate_stdev_factor; double ejection_threshold = mean - (stdev * success_rate_stdev_factor);
GRPC_TRACE_LOG(outlier_detection_lb, INFO) GRPC_TRACE_LOG(outlier_detection_lb, INFO)
<< "[outlier_detection_lb " << parent_.get() << "] stdev=" << stdev << "[outlier_detection_lb " << parent_.get() << "] stdev=" << stdev
<< ", ejection_threshold=" << ejection_threshold; << ", ejection_threshold=" << ejection_threshold;

@ -54,9 +54,9 @@ double HistogramView::ThresholdForCountBelow(double count_below) const {
// should lie // should lie
lower_bound = bucket_boundaries[lower_idx]; lower_bound = bucket_boundaries[lower_idx];
upper_bound = bucket_boundaries[lower_idx + 1]; upper_bound = bucket_boundaries[lower_idx + 1];
return upper_bound - (upper_bound - lower_bound) * return upper_bound -
(count_so_far - count_below) / ((upper_bound - lower_bound) * (count_so_far - count_below) /
static_cast<double>(buckets[lower_idx]); static_cast<double>(buckets[lower_idx]));
} }
} }

@ -224,7 +224,7 @@ int gpr_time_similar(gpr_timespec a, gpr_timespec b, gpr_timespec threshold) {
int32_t gpr_time_to_millis(gpr_timespec t) { int32_t gpr_time_to_millis(gpr_timespec t) {
if (t.tv_sec >= 2147483) { if (t.tv_sec >= 2147483) {
if (t.tv_sec == 2147483 && t.tv_nsec < 648 * GPR_NS_PER_MS) { if (t.tv_sec == 2147483 && t.tv_nsec < 648 * GPR_NS_PER_MS) {
return 2147483 * GPR_MS_PER_SEC + t.tv_nsec / GPR_NS_PER_MS; return (2147483 * GPR_MS_PER_SEC) + (t.tv_nsec / GPR_NS_PER_MS);
} }
return 2147483647; return 2147483647;
} else if (t.tv_sec <= -2147483) { } else if (t.tv_sec <= -2147483) {
@ -232,13 +232,13 @@ int32_t gpr_time_to_millis(gpr_timespec t) {
// care?) // care?)
return -2147483647; return -2147483647;
} else { } else {
return static_cast<int32_t>(t.tv_sec * GPR_MS_PER_SEC + return static_cast<int32_t>((t.tv_sec * GPR_MS_PER_SEC) +
t.tv_nsec / GPR_NS_PER_MS); (t.tv_nsec / GPR_NS_PER_MS));
} }
} }
double gpr_timespec_to_micros(gpr_timespec t) { double gpr_timespec_to_micros(gpr_timespec t) {
return static_cast<double>(t.tv_sec) * GPR_US_PER_SEC + t.tv_nsec * 1e-3; return (static_cast<double>(t.tv_sec) * GPR_US_PER_SEC) + (t.tv_nsec * 1e-3);
} }
gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type) { gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type) {

@ -183,7 +183,7 @@ int gpr_ltoa(long value, char* output) {
sign = value < 0 ? -1 : 1; sign = value < 0 ? -1 : 1;
while (value) { while (value) {
output[i++] = static_cast<char>('0' + sign * (value % 10)); output[i++] = static_cast<char>('0' + (sign * (value % 10)));
value /= 10; value /= 10;
} }
if (sign < 0) output[i++] = '-'; if (sign < 0) output[i++] = '-';
@ -204,7 +204,7 @@ int int64_ttoa(int64_t value, char* output) {
sign = value < 0 ? -1 : 1; sign = value < 0 ? -1 : 1;
while (value) { while (value) {
output[i++] = static_cast<char>('0' + sign * (value % 10)); output[i++] = static_cast<char>('0' + (sign * (value % 10)));
value /= 10; value /= 10;
} }
if (sign < 0) output[i++] = '-'; if (sign < 0) output[i++] = '-';

@ -120,9 +120,9 @@ gpr_timespec MillisecondsAsTimespec(int64_t millis, gpr_clock_type clock_type) {
int64_t TimespanToMillisRoundUp(gpr_timespec ts) { int64_t TimespanToMillisRoundUp(gpr_timespec ts) {
CHECK(ts.clock_type == GPR_TIMESPAN); CHECK(ts.clock_type == GPR_TIMESPAN);
double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) + double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS + (static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS) +
static_cast<double>(GPR_NS_PER_SEC - 1) / (static_cast<double>(GPR_NS_PER_SEC - 1) /
static_cast<double>(GPR_NS_PER_SEC); static_cast<double>(GPR_NS_PER_SEC));
if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) { if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) {
return std::numeric_limits<int64_t>::min(); return std::numeric_limits<int64_t>::min();
} }
@ -135,7 +135,7 @@ int64_t TimespanToMillisRoundUp(gpr_timespec ts) {
int64_t TimespanToMillisRoundDown(gpr_timespec ts) { int64_t TimespanToMillisRoundDown(gpr_timespec ts) {
CHECK(ts.clock_type == GPR_TIMESPAN); CHECK(ts.clock_type == GPR_TIMESPAN);
double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) + double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS; (static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS);
if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) { if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) {
return std::numeric_limits<int64_t>::min(); return std::numeric_limits<int64_t>::min();
} }

@ -227,11 +227,11 @@ class Duration {
} }
static constexpr Duration MicrosecondsRoundUp(int64_t micros) { static constexpr Duration MicrosecondsRoundUp(int64_t micros) {
return Duration(micros / GPR_US_PER_MS + (micros % GPR_US_PER_MS != 0)); return Duration((micros / GPR_US_PER_MS) + (micros % GPR_US_PER_MS != 0));
} }
static constexpr Duration NanosecondsRoundUp(int64_t nanos) { static constexpr Duration NanosecondsRoundUp(int64_t nanos) {
return Duration(nanos / GPR_NS_PER_MS + (nanos % GPR_NS_PER_MS != 0)); return Duration((nanos / GPR_NS_PER_MS) + (nanos % GPR_NS_PER_MS != 0));
} }
constexpr bool operator==(Duration other) const { constexpr bool operator==(Duration other) const {

@ -223,8 +223,8 @@ void LoadReporterAsyncServiceImpl::ReportLoadHandler::OnReadDone(
load_key_); load_key_);
const auto& load_report_interval = initial_request.load_report_interval(); const auto& load_report_interval = initial_request.load_report_interval();
load_report_interval_ms_ = load_report_interval_ms_ =
static_cast<unsigned long>(load_report_interval.seconds() * 1000 + static_cast<unsigned long>((load_report_interval.seconds() * 1000) +
load_report_interval.nanos() / 1000); (load_report_interval.nanos() / 1000));
LOG(INFO) << "[LRS " << service_ LOG(INFO) << "[LRS " << service_
<< "] Initial request received. Start load reporting (load " << "] Initial request received. Start load reporting (load "
"balanced host: " "balanced host: "

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
ADD clang_format_all_the_things.sh / ADD clang_format_all_the_things.sh /

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
# Install prerequisites for the clang-tidy script # Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean RUN apt-get update && apt-get install -y python3 jq git && apt-get clean

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
<%include file="../../apt_get_basic.include"/> <%include file="../../apt_get_basic.include"/>

@ -472,9 +472,13 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) {
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) {
ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channel_with_uuid1; ChannelFixture channel_with_uuid1;
{ ServerFixture channel_with_uuid2; } {
ServerFixture channel_with_uuid2;
}
ChannelFixture channel_with_uuid3; ChannelFixture channel_with_uuid3;
{ ServerFixture server_with_uuid4; } {
ServerFixture server_with_uuid4;
}
ChannelFixture channel_with_uuid5; ChannelFixture channel_with_uuid5;
// Current state of list: [1, NULL, 3, NULL, 5] // Current state of list: [1, NULL, 3, NULL, 5]
std::string json_str = ChannelzRegistry::GetTopChannels(2); std::string json_str = ChannelzRegistry::GetTopChannels(2);

@ -50,7 +50,7 @@ std::vector<Timer> CreateTestElements(size_t num_elements) {
void CheckValid(TimerHeap* pq) { void CheckValid(TimerHeap* pq) {
const std::vector<Timer*>& timers = pq->TestOnlyGetTimers(); const std::vector<Timer*>& timers = pq->TestOnlyGetTimers();
for (size_t i = 0; i < timers.size(); ++i) { for (size_t i = 0; i < timers.size(); ++i) {
size_t left_child = 1u + 2u * i; size_t left_child = 1u + (2u * i);
size_t right_child = left_child + 1u; size_t right_child = left_child + 1u;
if (left_child < timers.size()) { if (left_child < timers.size()) {
EXPECT_LE(timers[i]->deadline, timers[left_child]->deadline); EXPECT_LE(timers[i]->deadline, timers[left_child]->deadline);

@ -64,7 +64,7 @@ constexpr char g_grpc_config_prefix[] = "grpc_config=";
absl::Status ErrorToAbslStatus( absl::Status ErrorToAbslStatus(
const event_engine_client_channel_resolver::Error& error) { const event_engine_client_channel_resolver::Error& error) {
// clamp error.code() in (0, 16] // clamp error.code() in (0, 16]
return absl::Status(static_cast<absl::StatusCode>(error.code() % 16 + 1), return absl::Status(static_cast<absl::StatusCode>((error.code() % 16) + 1),
error.message()); error.message());
} }

@ -317,8 +317,8 @@ TEST(ParserTest, MainTest) {
char* tmp1 = char* tmp1 =
static_cast<char*>(gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH)); static_cast<char*>(gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH));
memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1); memset(tmp1, 'a', (2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) - 1);
tmp1[2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1] = 0; tmp1[(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) - 1] = 0;
std::string tmp2 = std::string tmp2 =
absl::StrFormat("HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1); absl::StrFormat("HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1);
gpr_free(tmp1); gpr_free(tmp1);

@ -80,7 +80,7 @@ static void end_test(grpc_endpoint_test_config config) { config.clean_up(); }
static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size, static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size,
size_t* num_blocks, uint8_t* current_data) { size_t* num_blocks, uint8_t* current_data) {
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0); size_t nslices = (num_bytes / slice_size) + (num_bytes % slice_size ? 1 : 0);
grpc_slice* slices = grpc_slice* slices =
static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nslices)); static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nslices));
size_t num_bytes_left = num_bytes; size_t num_bytes_left = num_bytes;

@ -316,7 +316,8 @@ struct write_socket_state {
static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size, static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size,
size_t* num_blocks, uint8_t* current_data) { size_t* num_blocks, uint8_t* current_data) {
size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u); size_t nslices =
(num_bytes / slice_size) + (num_bytes % slice_size ? 1u : 0u);
grpc_slice* slices = grpc_slice* slices =
static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nslices)); static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nslices));
size_t num_bytes_left = num_bytes; size_t num_bytes_left = num_bytes;

@ -52,7 +52,7 @@ static int contains(grpc_timer_heap* pq, grpc_timer* el) {
static void check_valid(grpc_timer_heap* pq) { static void check_valid(grpc_timer_heap* pq) {
size_t i; size_t i;
for (i = 0; i < pq->timer_count; ++i) { for (i = 0; i < pq->timer_count; ++i) {
size_t left_child = 1u + 2u * i; size_t left_child = 1u + (2u * i);
size_t right_child = left_child + 1u; size_t right_child = left_child + 1u;
if (left_child < pq->timer_count) { if (left_child < pq->timer_count) {
ASSERT_LE(pq->timers[i]->deadline, pq->timers[left_child]->deadline); ASSERT_LE(pq->timers[i]->deadline, pq->timers[left_child]->deadline);
@ -232,7 +232,7 @@ static void shrink_test(void) {
size_t expected_size; size_t expected_size;
// A large random number to allow for multiple shrinkages, at least 512. // A large random number to allow for multiple shrinkages, at least 512.
const size_t num_elements = static_cast<size_t>(rand()) % 2000 + 512; const size_t num_elements = (static_cast<size_t>(rand()) % 2000) + 512;
grpc_timer_heap_init(&pq); grpc_timer_heap_init(&pq);

@ -290,7 +290,8 @@ static void print_histogram(grpc_histogram* histogram) {
static double now(void) { static double now(void) {
gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME); gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME);
return 1e9 * static_cast<double>(tv.tv_sec) + static_cast<double>(tv.tv_nsec); return (1e9 * static_cast<double>(tv.tv_sec)) +
static_cast<double>(tv.tv_nsec);
} }
static void client_thread(thread_args* args) { static void client_thread(thread_args* args) {

@ -102,7 +102,9 @@ TEST(InterActivityPipe, CanClose) {
})); }));
EXPECT_FALSE(done); EXPECT_FALSE(done);
// Drop the sender // Drop the sender
{ auto x = std::move(pipe.sender); } {
auto x = std::move(pipe.sender);
}
EXPECT_TRUE(done); EXPECT_TRUE(done);
} }

@ -179,7 +179,7 @@ TEST(Sleep, StressTest) {
for (size_t i = 0; i < kNumActivities / 2; i++) { for (size_t i = 0; i < kNumActivities / 2; i++) {
notifications[i]->WaitForNotification(); notifications[i]->WaitForNotification();
activities[i].reset(); activities[i].reset();
activities[i + kNumActivities / 2].reset(); activities[i + (kNumActivities / 2)].reset();
exec_ctx.Flush(); exec_ctx.Flush();
} }
} }

@ -108,7 +108,7 @@ class FakeResolverTest : public ::testing::Test {
EndpointAddressesList addresses; EndpointAddressesList addresses;
for (size_t i = 0; i < num_addresses; ++i) { for (size_t i = 0; i < num_addresses; ++i) {
std::string uri_string = absl::StrFormat( std::string uri_string = absl::StrFormat(
"ipv4:127.0.0.1:100%" PRIuPTR, test_counter * num_addresses + i); "ipv4:127.0.0.1:100%" PRIuPTR, (test_counter * num_addresses) + i);
absl::StatusOr<URI> uri = URI::Parse(uri_string); absl::StatusOr<URI> uri = URI::Parse(uri_string);
EXPECT_TRUE(uri.ok()); EXPECT_TRUE(uri.ok());
grpc_resolved_address address; grpc_resolved_address address;

@ -130,7 +130,7 @@ TEST(MemoryQuotaTest, MakeSlice) {
for (int i = 1; i < 1000; i++) { for (int i = 1; i < 1000; i++) {
ExecCtx exec_ctx; ExecCtx exec_ctx;
int min = i; int min = i;
int max = 10 * i - 9; int max = (10 * i) - 9;
slices.push_back(memory_allocator.MakeSlice(MemoryRequest(min, max))); slices.push_back(memory_allocator.MakeSlice(MemoryRequest(min, max)));
} }
ExecCtx exec_ctx; ExecCtx exec_ctx;

@ -185,9 +185,9 @@ static double threshold_for_count_below(grpc_histogram* h, double count_below) {
// should lie // should lie
lower_bound = bucket_start(h, static_cast<double>(lower_idx)); lower_bound = bucket_start(h, static_cast<double>(lower_idx));
upper_bound = bucket_start(h, static_cast<double>(lower_idx + 1)); upper_bound = bucket_start(h, static_cast<double>(lower_idx + 1));
return grpc_core::Clamp(upper_bound - (upper_bound - lower_bound) * return grpc_core::Clamp(
(count_so_far - count_below) / upper_bound - ((upper_bound - lower_bound) *
h->buckets[lower_idx], (count_so_far - count_below) / h->buckets[lower_idx]),
h->min_seen, h->max_seen); h->min_seen, h->max_seen);
} }
} }

@ -29,7 +29,7 @@
namespace { namespace {
constexpr int kPrintfPointerFieldWidth = 2 + 2 * sizeof(void*); constexpr int kPrintfPointerFieldWidth = 2 + (2 * sizeof(void*));
void DumpPCAndFrameSizeAndSymbol(void (*writerfn)(const char*, void*), void DumpPCAndFrameSizeAndSymbol(void (*writerfn)(const char*, void*),
void* writerfn_arg, void* pc, void* writerfn_arg, void* pc,

@ -25,7 +25,7 @@ void gsec_test_random_bytes(uint8_t* bytes, size_t length) {
srand(time(nullptr)); srand(time(nullptr));
size_t ind; size_t ind;
for (ind = 0; ind < length; ind++) { for (ind = 0; ind < length; ind++) {
bytes[ind] = static_cast<uint8_t>(rand() % 255 + 1); bytes[ind] = static_cast<uint8_t>((rand() % 255) + 1);
} }
} }

@ -29,7 +29,9 @@ TEST(ValidationErrors, NoErrors) {
EXPECT_EQ(errors.size(), 0); EXPECT_EQ(errors.size(), 0);
{ {
ValidationErrors::ScopedField field(&errors, "foo"); ValidationErrors::ScopedField field(&errors, "foo");
{ ValidationErrors::ScopedField field(&errors, ".bar"); } {
ValidationErrors::ScopedField field(&errors, ".bar");
}
} }
EXPECT_TRUE(errors.ok()); EXPECT_TRUE(errors.ok());
EXPECT_EQ(errors.size(), 0); EXPECT_EQ(errors.size(), 0);

@ -1007,7 +1007,7 @@ TEST_P(EdsTest, Drops) {
const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
const double kDropRateForLbAndThrottle = const double kDropRateForLbAndThrottle =
kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; kDropRateForLb + ((1 - kDropRateForLb) * kDropRateForThrottle);
const double kErrorTolerance = 0.05; const double kErrorTolerance = 0.05;
const size_t kNumRpcs = const size_t kNumRpcs =
ComputeIdealNumRpcs(kDropRateForLbAndThrottle, kErrorTolerance); ComputeIdealNumRpcs(kDropRateForLbAndThrottle, kErrorTolerance);
@ -1079,7 +1079,7 @@ TEST_P(EdsTest, DropConfigUpdate) {
const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
const double kDropRateForLbAndThrottle = const double kDropRateForLbAndThrottle =
kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; kDropRateForLb + ((1 - kDropRateForLb) * kDropRateForThrottle);
const size_t kNumRpcsLbOnly = const size_t kNumRpcsLbOnly =
ComputeIdealNumRpcs(kDropRateForLb, kErrorTolerance); ComputeIdealNumRpcs(kDropRateForLb, kErrorTolerance);
const size_t kNumRpcsBoth = const size_t kNumRpcsBoth =
@ -2340,7 +2340,7 @@ TEST_P(ClientLoadReportingTest, DropStats) {
const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
const double kDropRateForLbAndThrottle = const double kDropRateForLbAndThrottle =
kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; kDropRateForLb + ((1 - kDropRateForLb) * kDropRateForThrottle);
const size_t kNumRpcs = const size_t kNumRpcs =
ComputeIdealNumRpcs(kDropRateForLbAndThrottle, kErrorTolerance); ComputeIdealNumRpcs(kDropRateForLbAndThrottle, kErrorTolerance);
// The ADS response contains two drop categories. // The ADS response contains two drop categories.

@ -91,8 +91,8 @@ static void BM_CallbackUnaryPingPong(benchmark::State& state) {
cv.wait(l); cv.wait(l);
} }
fixture.reset(); fixture.reset();
state.SetBytesProcessed(request_msgs_size * state.iterations() + state.SetBytesProcessed((request_msgs_size * state.iterations()) +
response_msgs_size * state.iterations()); (response_msgs_size * state.iterations()));
} }
} // namespace testing } // namespace testing

@ -91,7 +91,7 @@ class RandomAsciiMetadata {
std::string s; std::string s;
s.reserve(length + 1); s.reserve(length + 1);
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
s += static_cast<char>(rand() % 26 + 'a'); s += static_cast<char>((rand() % 26) + 'a');
} }
return s; return s;
} }

@ -107,8 +107,8 @@ static void BM_UnaryPingPong(benchmark::State& state) {
fixture.reset(); fixture.reset();
server_env[0]->~ServerEnv(); server_env[0]->~ServerEnv();
server_env[1]->~ServerEnv(); server_env[1]->~ServerEnv();
state.SetBytesProcessed(state.range(0) * state.iterations() + state.SetBytesProcessed((state.range(0) * state.iterations()) +
state.range(1) * state.iterations()); (state.range(1) * state.iterations()));
} }
} // namespace testing } // namespace testing
} // namespace grpc } // namespace grpc

@ -178,8 +178,8 @@ static void postprocess_scenario_result(ScenarioResult* result) {
result->mutable_summary()->set_server_cpu_usage(0); result->mutable_summary()->set_server_cpu_usage(0);
} else { } else {
auto server_cpu_usage = auto server_cpu_usage =
100 - 100 * average(result->server_stats(), ServerIdleCpuTime) / 100 - (100 * average(result->server_stats(), ServerIdleCpuTime) /
average(result->server_stats(), ServerTotalCpuTime); average(result->server_stats(), ServerTotalCpuTime));
result->mutable_summary()->set_server_cpu_usage(server_cpu_usage); result->mutable_summary()->set_server_cpu_usage(server_cpu_usage);
} }

@ -180,7 +180,7 @@ static double BinarySearch(
const std::map<std::string, std::string>& per_worker_credential_types, const std::map<std::string, std::string>& per_worker_credential_types,
bool* success) { bool* success) {
while (low <= high * (1 - absl::GetFlag(FLAGS_error_tolerance))) { while (low <= high * (1 - absl::GetFlag(FLAGS_error_tolerance))) {
double mid = low + (high - low) / 2; double mid = low + ((high - low) / 2);
double current_cpu_load = double current_cpu_load =
GetCpuLoad(scenario, mid, per_worker_credential_types, success); GetCpuLoad(scenario, mid, per_worker_credential_types, success);
VLOG(2) << absl::StrFormat("Binary Search: current_offered_load %.0f", mid); VLOG(2) << absl::StrFormat("Binary Search: current_offered_load %.0f", mid);

@ -31,7 +31,7 @@
#include <sys/time.h> #include <sys/time.h>
static double time_double(struct timeval* tv) { static double time_double(struct timeval* tv) {
return tv->tv_sec + 1e-6 * tv->tv_usec; return tv->tv_sec + (1e-6 * tv->tv_usec);
} }
#endif #endif
@ -39,7 +39,7 @@ UsageTimer::UsageTimer() : start_(Sample()) {}
double UsageTimer::Now() { double UsageTimer::Now() {
auto ts = gpr_now(GPR_CLOCK_REALTIME); auto ts = gpr_now(GPR_CLOCK_REALTIME);
return ts.tv_sec + 1e-9 * ts.tv_nsec; return ts.tv_sec + (1e-9 * ts.tv_nsec);
} }
static void get_resource_usage(double* utime, double* stime) { static void get_resource_usage(double* utime, double* stime) {

@ -63,7 +63,7 @@ namespace {
const char ACCESS_TOKEN_PREFIX[] = "access_token="; const char ACCESS_TOKEN_PREFIX[] = "access_token=";
constexpr int ACCESS_TOKEN_PREFIX_LEN = constexpr int ACCESS_TOKEN_PREFIX_LEN =
sizeof(ACCESS_TOKEN_PREFIX) / sizeof(*ACCESS_TOKEN_PREFIX) - 1; (sizeof(ACCESS_TOKEN_PREFIX) / sizeof(*ACCESS_TOKEN_PREFIX)) - 1;
bool IsAccessToken(const std::string& auth) { bool IsAccessToken(const std::string& auth) {
return auth.length() > ACCESS_TOKEN_PREFIX_LEN && return auth.length() > ACCESS_TOKEN_PREFIX_LEN &&

@ -112,5 +112,5 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68", "tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68",
"tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:d2e79919b2e2d4cc36a29682ecb5170641df4fb506cfb453978ffdeb8a841bd9", "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:d2e79919b2e2d4cc36a29682ecb5170641df4fb506cfb453978ffdeb8a841bd9",
"tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:6e8b4696ba0661f11a31ed0992a94d2efcd889a018f57160f0e2fb62963f3593", "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:6e8b4696ba0661f11a31ed0992a94d2efcd889a018f57160f0e2fb62963f3593",
"tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:4fb77e7130e10934e65ec0657e286a8ca5850e9a25441dabe2174b3cb6a56180", "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:7fd5e54075e74ff4aa5eceb6f00dd15fd5151b43c30a85fa4bd5d55f3dcf8287",
} }

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
ADD clang_format_all_the_things.sh / ADD clang_format_all_the_things.sh /

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
# Install prerequisites for the clang-tidy script # Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean RUN apt-get update && apt-get install -y python3 jq git && apt-get clean

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:0006a2ed3aca736f842b3e1bf758cb6ab621922d@sha256:4fb77e7130e10934e65ec0657e286a8ca5850e9a25441dabe2174b3cb6a56180 us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:7b20e380c8ace88e99a1ec934eed62f706aa5bfa@sha256:7fd5e54075e74ff4aa5eceb6f00dd15fd5151b43c30a85fa4bd5d55f3dcf8287

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM silkeh/clang:18-bookworm FROM silkeh/clang:19-bookworm
#================= #=================
# Basic C core dependencies # Basic C core dependencies

Loading…
Cancel
Save