From be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Fri, 9 Feb 2018 09:16:55 -0800 Subject: Autofix c casts to c++ casts --- test/core/fling/client.cc | 4 ++-- test/core/fling/fling_stream_test.cc | 2 +- test/core/fling/fling_test.cc | 2 +- test/core/fling/server.cc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/core/fling') diff --git a/test/core/fling/client.cc b/test/core/fling/client.cc index 92f59b7fdb..0141e7e748 100644 --- a/test/core/fling/client.cc +++ b/test/core/fling/client.cc @@ -127,7 +127,7 @@ static void step_ping_pong_stream(void) { static double now(void) { gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME); - return 1e9 * (double)tv.tv_sec + tv.tv_nsec; + return 1e9 * static_cast(tv.tv_sec) + tv.tv_nsec; } typedef struct { @@ -195,7 +195,7 @@ int main(int argc, char** argv) { channel = grpc_insecure_channel_create(target, nullptr, nullptr); cq = grpc_completion_queue_create_for_next(nullptr); - the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); + the_buffer = grpc_raw_byte_buffer_create(&slice, static_cast(payload_size)); histogram = grpc_histogram_create(0.01, 60e9); sc.init(); diff --git a/test/core/fling/fling_stream_test.cc b/test/core/fling/fling_stream_test.cc index d5fd7a8d46..32bc989641 100644 --- a/test/core/fling/fling_stream_test.cc +++ b/test/core/fling/fling_stream_test.cc @@ -37,7 +37,7 @@ int main(int argc, char** argv) { gpr_subprocess *svr, *cli; /* figure out where we are */ if (lslash) { - memcpy(root, me, (size_t)(lslash - me)); + memcpy(root, me, static_cast(lslash - me)); root[lslash - me] = 0; } else { strcpy(root, "."); diff --git a/test/core/fling/fling_test.cc b/test/core/fling/fling_test.cc index d95317b7e6..3587a4acaa 100644 --- a/test/core/fling/fling_test.cc +++ b/test/core/fling/fling_test.cc @@ -37,7 +37,7 @@ int main(int argc, const char** argv) { gpr_subprocess *svr, *cli; /* figure out where we are */ if (lslash) { - memcpy(root, me, (size_t)(lslash - me)); + memcpy(root, me, static_cast(lslash - me)); root[lslash - me] = 0; } else { strcpy(root, "."); diff --git a/test/core/fling/server.cc b/test/core/fling/server.cc index b19a25a185..cad4a8fd8c 100644 --- a/test/core/fling/server.cc +++ b/test/core/fling/server.cc @@ -112,7 +112,7 @@ static void handle_unary_method(void) { op->data.recv_close_on_server.cancelled = &was_cancelled; op++; - error = grpc_call_start_batch(call, unary_ops, (size_t)(op - unary_ops), + error = grpc_call_start_batch(call, unary_ops, static_cast(op - unary_ops), tag(FLING_SERVER_BATCH_OPS_FOR_UNARY), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); } @@ -189,7 +189,7 @@ int main(int argc, char** argv) { grpc_test_init(1, fake_argv); grpc_init(); - srand((unsigned)clock()); + srand(static_cast(clock())); cl = gpr_cmdline_create("fling server"); gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr); -- cgit v1.2.3