aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/surface/concurrent_connectivity_test.cc
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
committerGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:16:55 -0800
commitbe82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch)
treecc5e1234073eb250a2c319b5a4db2919fce060ea /test/core/surface/concurrent_connectivity_test.cc
parent194436342137924b4fb7429bede037a4b5ec7edb (diff)
Autofix c casts to c++ casts
Diffstat (limited to 'test/core/surface/concurrent_connectivity_test.cc')
-rw-r--r--test/core/surface/concurrent_connectivity_test.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc
index 235d136376..ffef966d86 100644
--- a/test/core/surface/concurrent_connectivity_test.cc
+++ b/test/core/surface/concurrent_connectivity_test.cc
@@ -55,14 +55,14 @@
// it should never take longer that this to shutdown the server
#define SERVER_SHUTDOWN_TIMEOUT 30000
-static void* tag(int n) { return (void*)(uintptr_t)n; }
-static int detag(void* p) { return (int)(uintptr_t)p; }
+static void* tag(int n) { return (void*)static_cast<uintptr_t>(n); }
+static int detag(void* p) { return static_cast<int>((uintptr_t)p); }
void create_loop_destroy(void* addr) {
for (int i = 0; i < NUM_OUTER_LOOPS; ++i) {
grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
grpc_channel* chan =
- grpc_insecure_channel_create((char*)addr, nullptr, nullptr);
+ grpc_insecure_channel_create(static_cast<char*>(addr), nullptr, nullptr);
for (int j = 0; j < NUM_INNER_LOOPS; ++j) {
gpr_timespec later_time =
@@ -94,7 +94,7 @@ struct server_thread_args {
};
void server_thread(void* vargs) {
- struct server_thread_args* args = (struct server_thread_args*)vargs;
+ struct server_thread_args* args = static_cast<struct server_thread_args*>(vargs);
grpc_event ev;
gpr_timespec deadline =
grpc_timeout_milliseconds_to_deadline(SERVER_SHUTDOWN_TIMEOUT);
@@ -107,7 +107,7 @@ static void on_connect(void* vargs, grpc_endpoint* tcp,
grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor) {
gpr_free(acceptor);
- struct server_thread_args* args = (struct server_thread_args*)vargs;
+ struct server_thread_args* args = static_cast<struct server_thread_args*>(vargs);
grpc_endpoint_shutdown(tcp,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
grpc_endpoint_destroy(tcp);
@@ -117,11 +117,11 @@ static void on_connect(void* vargs, grpc_endpoint* tcp,
}
void bad_server_thread(void* vargs) {
- struct server_thread_args* args = (struct server_thread_args*)vargs;
+ struct server_thread_args* args = static_cast<struct server_thread_args*>(vargs);
grpc_core::ExecCtx exec_ctx;
grpc_resolved_address resolved_addr;
- struct sockaddr_storage* addr = (struct sockaddr_storage*)resolved_addr.addr;
+ struct sockaddr_storage* addr = reinterpret_cast<struct sockaddr_storage*>(resolved_addr.addr);
int port;
grpc_tcp_server* s;
grpc_error* error = grpc_tcp_server_create(nullptr, nullptr, &s);
@@ -245,7 +245,7 @@ void watches_with_short_timeouts(void* addr) {
for (int i = 0; i < NUM_OUTER_LOOPS_SHORT_TIMEOUTS; ++i) {
grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr);
grpc_channel* chan =
- grpc_insecure_channel_create((char*)addr, nullptr, nullptr);
+ grpc_insecure_channel_create(static_cast<char*>(addr), nullptr, nullptr);
for (int j = 0; j < NUM_INNER_LOOPS_SHORT_TIMEOUTS; ++j) {
gpr_timespec later_time =