diff options
author | 2018-02-09 09:16:55 -0800 | |
---|---|---|
committer | 2018-02-09 09:16:55 -0800 | |
commit | be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch) | |
tree | cc5e1234073eb250a2c319b5a4db2919fce060ea /test/core/memory_usage/server.cc | |
parent | 194436342137924b4fb7429bede037a4b5ec7edb (diff) |
Autofix c casts to c++ casts
Diffstat (limited to 'test/core/memory_usage/server.cc')
-rw-r--r-- | test/core/memory_usage/server.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/core/memory_usage/server.cc b/test/core/memory_usage/server.cc index a276102e83..f016fb248d 100644 --- a/test/core/memory_usage/server.cc +++ b/test/core/memory_usage/server.cc @@ -73,7 +73,7 @@ typedef struct { static fling_call calls[100006]; static void request_call_unary(int call_idx) { - if (call_idx == (int)(sizeof(calls) / sizeof(fling_call))) { + if (call_idx == static_cast<int>(sizeof(calls) / sizeof(fling_call))) { gpr_log(GPR_INFO, "Used all call slots (10000) on server. Server exit."); _exit(0); } @@ -84,7 +84,7 @@ static void request_call_unary(int call_idx) { } static void send_initial_metadata_unary(void* tag) { - grpc_metadata_array_init(&(*(fling_call*)tag).initial_metadata_send); + grpc_metadata_array_init(&(*static_cast<fling_call*>(tag)).initial_metadata_send); metadata_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA; metadata_ops[0].data.send_initial_metadata.count = 0; @@ -111,7 +111,7 @@ static void send_snapshot(void* tag, struct grpc_memory_counters* snapshot) { grpc_slice snapshot_slice = grpc_slice_new(snapshot, sizeof(*snapshot), gpr_free); payload_buffer = grpc_raw_byte_buffer_create(&snapshot_slice, 1); - grpc_metadata_array_init(&(*(fling_call*)tag).initial_metadata_send); + grpc_metadata_array_init(&(*static_cast<fling_call*>(tag)).initial_metadata_send); op = snapshot_ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -163,7 +163,7 @@ int main(int argc, char** argv) { grpc_test_init(1, fake_argv); grpc_init(); - srand((unsigned)clock()); + srand(static_cast<unsigned>(clock())); cl = gpr_cmdline_create("fling server"); gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr); @@ -204,7 +204,7 @@ int main(int argc, char** argv) { addr = addr_buf = nullptr; // initialize call instances - for (int i = 0; i < (int)(sizeof(calls) / sizeof(fling_call)); i++) { + for (int i = 0; i < static_cast<int>(sizeof(calls) / sizeof(fling_call)); i++) { grpc_call_details_init(&calls[i].call_details); calls[i].state = FLING_SERVER_NEW_REQUEST; } @@ -281,7 +281,7 @@ int main(int argc, char** argv) { grpc_metadata_array_destroy(&s->request_metadata_recv); break; case FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL: - for (int k = 0; k < (int)(sizeof(calls) / sizeof(fling_call)); + for (int k = 0; k < static_cast<int>(sizeof(calls) / sizeof(fling_call)); ++k) { if (calls[k].state == FLING_SERVER_WAIT_FOR_DESTROY) { calls[k].state = FLING_SERVER_SEND_STATUS_FLING_CALL; |