diff --git a/test/core/util/trickle_endpoint.c b/test/core/util/trickle_endpoint.c index 5b6c666950a5416508905b406aa97020b8e2d379..7ab0488a6608abdcfe910eff6d2a7796ada882ad 100644 --- a/test/core/util/trickle_endpoint.c +++ b/test/core/util/trickle_endpoint.c @@ -166,7 +166,9 @@ grpc_endpoint *grpc_trickle_endpoint_create(grpc_endpoint *wrap, return &te->base; } -static double ts2dbl(gpr_timespec s) { return s.tv_sec + 1e-9 * s.tv_nsec; } +static double ts2dbl(gpr_timespec s) { + return (double)s.tv_sec + 1e-9 * (double)s.tv_nsec; +} size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) { diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc index 619a03d4740490caa9472bd0353ea0907e0d0738..d449acd744421609d82342163d5dad0049d15850 100644 --- a/test/cpp/microbenchmarks/bm_fullstack.cc +++ b/test/cpp/microbenchmarks/bm_fullstack.cc @@ -355,7 +355,7 @@ class TrickledCHTTP2 : public EndpointPairFixture { grpc_endpoint_pair p; grpc_passthru_endpoint_create(&p.client, &p.server, initialize_stuff.rq(), &stats_); - double bytes_per_second = 125 * kilobits; + double bytes_per_second = 125.0 * kilobits; p.client = grpc_trickle_endpoint_create(p.client, bytes_per_second); p.server = grpc_trickle_endpoint_create(p.server, bytes_per_second); return p; @@ -1022,7 +1022,8 @@ BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, InProcessCHTTP2) static void TrickleArgs(benchmark::internal::Benchmark* b) { for (int i = 1; i <= 128 * 1024 * 1024; i *= 8) { for (int j = 1; j <= 128 * 1024 * 1024; j *= 8) { - double expected_time = (double)(14 + i) / (125 * (double)j); + double expected_time = + static_cast<double>(14 + i) / (125.0 * static_cast<double>(j)); if (expected_time > 0.01) continue; b->Args({i, j}); }