From 7f9184f31450a0cff738b2d92a5e08535251348c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 14 Feb 2017 22:39:47 -0800 Subject: [PATCH] Review feedback --- test/core/util/trickle_endpoint.c | 4 +++- test/cpp/microbenchmarks/bm_fullstack.cc | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/core/util/trickle_endpoint.c b/test/core/util/trickle_endpoint.c index 5b6c666950a..7ab0488a660 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 619a03d4740..d449acd7444 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(14 + i) / (125.0 * static_cast(j)); if (expected_time > 0.01) continue; b->Args({i, j}); }