From 565b18b69c4fa112ef87b85cb4be1c4945a75831 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 23 Sep 2015 10:09:42 -0700 Subject: clang-format all core files --- src/core/iomgr/exec_ctx.h | 4 ++-- src/core/iomgr/iocp_windows.c | 6 ++---- src/core/iomgr/iocp_windows.h | 4 ++-- src/core/iomgr/pollset_set_windows.c | 4 ++-- src/core/iomgr/pollset_windows.c | 6 +++--- src/core/iomgr/sockaddr_utils.c | 3 ++- src/core/iomgr/tcp_client_windows.c | 5 +++-- src/core/iomgr/tcp_server_windows.c | 8 ++++---- src/core/iomgr/tcp_windows.c | 18 ++++++++---------- 9 files changed, 28 insertions(+), 30 deletions(-) (limited to 'src/core/iomgr') diff --git a/src/core/iomgr/exec_ctx.h b/src/core/iomgr/exec_ctx.h index bfa08c41dd..f99aa038c5 100644 --- a/src/core/iomgr/exec_ctx.h +++ b/src/core/iomgr/exec_ctx.h @@ -38,7 +38,7 @@ /** Execution context. * A bag of data that collects information along a callstack. - * Generally created at public API entry points, and passed down as + * Generally created at public API entry points, and passed down as * pointer to child functions that manipulate it. * * Specific responsibilities (this may grow in the future): @@ -48,7 +48,7 @@ * * CONVENTIONS: * Instance of this must ALWAYS be constructed on the stack, never - * heap allocated. Instances and pointers to them must always be called + * heap allocated. Instances and pointers to them must always be called * exec_ctx. Instances are always passed as the first argument * to a function that takes it, and always as a pointer (grpc_exec_ctx * is never copied). diff --git a/src/core/iomgr/iocp_windows.c b/src/core/iomgr/iocp_windows.c index 0378cf0c76..3556b2c301 100644 --- a/src/core/iomgr/iocp_windows.c +++ b/src/core/iomgr/iocp_windows.c @@ -169,8 +169,7 @@ void grpc_iocp_add_socket(grpc_winsocket *socket) { the callback now. -) The IOCP hasn't completed yet, and we're queuing it for later. */ static void socket_notify_on_iocp(grpc_exec_ctx *exec_ctx, - grpc_winsocket *socket, - grpc_closure *closure, + grpc_winsocket *socket, grpc_closure *closure, grpc_winsocket_callback_info *info) { int run_now = 0; GPR_ASSERT(info->closure == NULL); @@ -191,8 +190,7 @@ void grpc_socket_notify_on_write(grpc_exec_ctx *exec_ctx, socket_notify_on_iocp(exec_ctx, socket, closure, &socket->write_info); } -void grpc_socket_notify_on_read(grpc_exec_ctx *exec_ctx, - grpc_winsocket *socket, +void grpc_socket_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket, grpc_closure *closure) { socket_notify_on_iocp(exec_ctx, socket, closure, &socket->read_info); } diff --git a/src/core/iomgr/iocp_windows.h b/src/core/iomgr/iocp_windows.h index 35c418f3b4..b0209e04e3 100644 --- a/src/core/iomgr/iocp_windows.h +++ b/src/core/iomgr/iocp_windows.h @@ -44,11 +44,11 @@ void grpc_iocp_shutdown(void); void grpc_iocp_add_socket(grpc_winsocket *); void grpc_socket_notify_on_write(grpc_exec_ctx *exec_ctx, - grpc_winsocket *winsocket, + grpc_winsocket *winsocket, grpc_closure *closure); void grpc_socket_notify_on_read(grpc_exec_ctx *exec_ctx, - grpc_winsocket *winsocket, + grpc_winsocket *winsocket, grpc_closure *closure); #endif /* GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H */ diff --git a/src/core/iomgr/pollset_set_windows.c b/src/core/iomgr/pollset_set_windows.c index 75da6dbfa1..53d5d3dcd4 100644 --- a/src/core/iomgr/pollset_set_windows.c +++ b/src/core/iomgr/pollset_set_windows.c @@ -41,11 +41,11 @@ void grpc_pollset_set_init(grpc_pollset_set* pollset_set) {} void grpc_pollset_set_destroy(grpc_pollset_set* pollset_set) {} -void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx, +void grpc_pollset_set_add_pollset(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pollset_set, grpc_pollset* pollset) {} -void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx, +void grpc_pollset_set_del_pollset(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pollset_set, grpc_pollset* pollset) {} diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c index 7707c3d502..5e835743af 100644 --- a/src/core/iomgr/pollset_windows.c +++ b/src/core/iomgr/pollset_windows.c @@ -98,9 +98,9 @@ void grpc_pollset_destroy(grpc_pollset *pollset) { gpr_mu_destroy(&pollset->mu); } -void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, - grpc_pollset_worker *worker, - gpr_timespec now, gpr_timespec deadline) { +void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, + grpc_pollset_worker *worker, gpr_timespec now, + gpr_timespec deadline) { int added_worker = 0; worker->next = worker->prev = NULL; gpr_cv_init(&worker->cv); diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c index df74fe2fe0..511a5d5c59 100644 --- a/src/core/iomgr/sockaddr_utils.c +++ b/src/core/iomgr/sockaddr_utils.c @@ -160,7 +160,8 @@ int grpc_sockaddr_to_string(char **out, const struct sockaddr *addr, } /* Windows inet_ntop wants a mutable ip pointer */ if (ip != NULL && - inet_ntop(addr->sa_family, (void*)ip, ntop_buf, sizeof(ntop_buf)) != NULL) { + inet_ntop(addr->sa_family, (void *)ip, ntop_buf, sizeof(ntop_buf)) != + NULL) { ret = gpr_join_host_port(out, ntop_buf, port); } else { ret = gpr_asprintf(out, "(sockaddr family=%d)", addr->sa_family); diff --git a/src/core/iomgr/tcp_client_windows.c b/src/core/iomgr/tcp_client_windows.c index 15fe30fb72..3540c55676 100644 --- a/src/core/iomgr/tcp_client_windows.c +++ b/src/core/iomgr/tcp_client_windows.c @@ -120,7 +120,7 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *acp, int from_iocp) { /* Tries to issue one async connection, then schedules both an IOCP notification request for the connection, and one timeout alert. */ void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_done, - grpc_endpoint **endpoint, + grpc_endpoint **endpoint, grpc_pollset_set *interested_parties, const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline) { @@ -179,7 +179,8 @@ void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_done, socket = grpc_winsocket_create(sock, "client"); info = &socket->write_info; - success = ConnectEx(sock, addr, (int)addr_len, NULL, 0, NULL, &info->overlapped); + success = + ConnectEx(sock, addr, (int)addr_len, NULL, 0, NULL, &info->overlapped); /* It wouldn't be unusual to get a success immediately. But we'll still get an IOCP notification, so let's ignore it. */ diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index 55cd1a5d6e..7244606e98 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -198,7 +198,8 @@ error: return -1; } -static void decrement_active_ports_and_notify(grpc_exec_ctx *exec_ctx, server_port *sp) { +static void decrement_active_ports_and_notify(grpc_exec_ctx *exec_ctx, + server_port *sp) { int notify = 0; sp->shutting_down = 0; gpr_mu_lock(&sp->server->mu); @@ -458,9 +459,8 @@ grpc_tcp_server_get_socket(grpc_tcp_server *s, unsigned index) { return (index < s->nports) ? s->ports[index].socket->socket : INVALID_SOCKET; } -void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s, - grpc_pollset **pollset, - size_t pollset_count, +void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s, + grpc_pollset **pollset, size_t pollset_count, grpc_tcp_server_cb on_accept_cb, void *on_accept_cb_arg) { size_t i; diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index 4a531b8546..2962762679 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -176,10 +176,8 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, int success) { } } -static void win_read(grpc_exec_ctx *exec_ctx, - grpc_endpoint *ep, - gpr_slice_buffer *read_slices, - grpc_closure *cb) { +static void win_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, + gpr_slice_buffer *read_slices, grpc_closure *cb) { grpc_tcp *tcp = (grpc_tcp *)ep; grpc_winsocket *handle = tcp->socket; grpc_winsocket_callback_info *info = &handle->read_info; @@ -264,10 +262,8 @@ static void on_write(grpc_exec_ctx *exec_ctx, void *tcpp, int success) { } /* Initiates a write. */ -static void win_write(grpc_exec_ctx *exec_ctx, - grpc_endpoint *ep, - gpr_slice_buffer *slices, - grpc_closure *cb) { +static void win_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, + gpr_slice_buffer *slices, grpc_closure *cb) { grpc_tcp *tcp = (grpc_tcp *)ep; grpc_winsocket *socket = tcp->socket; grpc_winsocket_callback_info *info = &socket->write_info; @@ -344,14 +340,16 @@ static void win_write(grpc_exec_ctx *exec_ctx, grpc_socket_notify_on_write(exec_ctx, socket, &tcp->on_write); } -static void win_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset *ps) { +static void win_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, + grpc_pollset *ps) { grpc_tcp *tcp; (void)ps; tcp = (grpc_tcp *)ep; grpc_iocp_add_socket(tcp->socket); } -static void win_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset_set *pss) { +static void win_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, + grpc_pollset_set *pss) { grpc_tcp *tcp; (void)pss; tcp = (grpc_tcp *)ep; -- cgit v1.2.3