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/bad_client/bad_client.cc | 8 ++++---- test/core/bad_client/tests/duplicate_header.cc | 4 ++-- test/core/bad_client/tests/head_of_line_blocking.cc | 6 +++--- test/core/bad_client/tests/window_overflow.cc | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'test/core/bad_client') diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index df803d16a2..ee55a95e4e 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -49,7 +49,7 @@ typedef struct { /* Run the server side validator and set done_thd once done */ static void thd_func(void* arg) { - thd_args* a = (thd_args*)arg; + thd_args* a = static_cast(arg); if (a->validator != nullptr) { a->validator(a->server, a->cq, a->registered_method); } @@ -58,12 +58,12 @@ static void thd_func(void* arg) { /* Sets the done_write event */ static void set_done_write(void* arg, grpc_error* error) { - gpr_event* done_write = (gpr_event*)arg; + gpr_event* done_write = static_cast(arg); gpr_event_set(done_write, (void*)1); } static void server_setup_transport(void* ts, grpc_transport* transport) { - thd_args* a = (thd_args*)ts; + thd_args* a = static_cast(ts); grpc_core::ExecCtx exec_ctx; grpc_server_setup_transport(a->server, transport, nullptr, grpc_server_get_channel_args(a->server)); @@ -71,7 +71,7 @@ static void server_setup_transport(void* ts, grpc_transport* transport) { /* Sets the read_done event */ static void set_read_done(void* arg, grpc_error* error) { - gpr_event* read_done = (gpr_event*)arg; + gpr_event* read_done = static_cast(arg); gpr_event_set(read_done, (void*)1); } diff --git a/test/core/bad_client/tests/duplicate_header.cc b/test/core/bad_client/tests/duplicate_header.cc index 0d689bbb7e..12b9c79ab8 100644 --- a/test/core/bad_client/tests/duplicate_header.cc +++ b/test/core/bad_client/tests/duplicate_header.cc @@ -87,7 +87,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = grpc_call_start_batch(s, ops, static_cast(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -108,7 +108,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, static_cast(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); diff --git a/test/core/bad_client/tests/head_of_line_blocking.cc b/test/core/bad_client/tests/head_of_line_blocking.cc index 8668e091b6..427db46446 100644 --- a/test/core/bad_client/tests/head_of_line_blocking.cc +++ b/test/core/bad_client/tests/head_of_line_blocking.cc @@ -117,9 +117,9 @@ int main(int argc, char** argv) { addbuf(prefix, sizeof(prefix) - 1); for (i = 0; i < NUM_FRAMES; i++) { - uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16), - (uint8_t)(FRAME_SIZE >> 8), - (uint8_t)FRAME_SIZE, + uint8_t hdr[9] = {static_cast(FRAME_SIZE >> 16), + static_cast(FRAME_SIZE >> 8), + static_cast(FRAME_SIZE), 0, 0, 0, diff --git a/test/core/bad_client/tests/window_overflow.cc b/test/core/bad_client/tests/window_overflow.cc index fe6b05d03a..7c012ac055 100644 --- a/test/core/bad_client/tests/window_overflow.cc +++ b/test/core/bad_client/tests/window_overflow.cc @@ -76,9 +76,9 @@ int main(int argc, char** argv) { addbuf(PFX_STR, sizeof(PFX_STR) - 1); for (i = 0; i < NUM_FRAMES; i++) { - uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16), - (uint8_t)(FRAME_SIZE >> 8), - (uint8_t)FRAME_SIZE, + uint8_t hdr[9] = {static_cast(FRAME_SIZE >> 16), + static_cast(FRAME_SIZE >> 8), + static_castFRAME_SIZE, 0, 0, 0, -- cgit v1.2.3