diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-23 10:09:42 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-23 10:09:42 -0700 |
commit | 565b18b69c4fa112ef87b85cb4be1c4945a75831 (patch) | |
tree | c23fadb53f41b4fc5c433cbc670eb740dedf4bbc | |
parent | 64db1580f891f9b89e1653804a3f20a1a979a8f9 (diff) |
clang-format all core files
-rw-r--r-- | src/core/client_config/subchannel.c | 14 | ||||
-rw-r--r-- | src/core/iomgr/exec_ctx.h | 4 | ||||
-rw-r--r-- | src/core/iomgr/iocp_windows.c | 6 | ||||
-rw-r--r-- | src/core/iomgr/iocp_windows.h | 4 | ||||
-rw-r--r-- | src/core/iomgr/pollset_set_windows.c | 4 | ||||
-rw-r--r-- | src/core/iomgr/pollset_windows.c | 6 | ||||
-rw-r--r-- | src/core/iomgr/sockaddr_utils.c | 3 | ||||
-rw-r--r-- | src/core/iomgr/tcp_client_windows.c | 5 | ||||
-rw-r--r-- | src/core/iomgr/tcp_server_windows.c | 8 | ||||
-rw-r--r-- | src/core/iomgr/tcp_windows.c | 18 | ||||
-rw-r--r-- | src/core/security/security_connector.c | 8 | ||||
-rw-r--r-- | src/core/support/stack_lockfree.c | 2 | ||||
-rw-r--r-- | src/core/surface/server.c | 6 | ||||
-rw-r--r-- | src/core/surface/version.c | 4 | ||||
-rw-r--r-- | test/core/util/port_windows.c | 9 |
15 files changed, 50 insertions, 51 deletions
diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c index d9dc5ae39d..740389003a 100644 --- a/src/core/client_config/subchannel.c +++ b/src/core/client_config/subchannel.c @@ -258,7 +258,7 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { if (c->active != NULL) { connection_destroy(exec_ctx, c->active); } - gpr_free((void*)c->filters); + gpr_free((void *)c->filters); grpc_channel_args_destroy(c->args); gpr_free(c->addr); grpc_mdctx_unref(c->mdctx); @@ -294,7 +294,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_connector *connector, grpc_connector_ref(c->connector); c->num_filters = args->filter_count; c->filters = gpr_malloc(sizeof(grpc_channel_filter *) * c->num_filters); - memcpy((void*)c->filters, args->filters, + memcpy((void *)c->filters, args->filters, sizeof(grpc_channel_filter *) * c->num_filters); c->addr = gpr_malloc(args->addr_len); memcpy(c->addr, args->addr, args->addr_len); @@ -531,8 +531,8 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { /* build final filter list */ num_filters = c->num_filters + c->connecting_result.num_filters + 1; filters = gpr_malloc(sizeof(*filters) * num_filters); - memcpy((void*)filters, c->filters, sizeof(*filters) * c->num_filters); - memcpy((void*)(filters + c->num_filters), c->connecting_result.filters, + memcpy((void *)filters, c->filters, sizeof(*filters) * c->num_filters); + memcpy((void *)(filters + c->num_filters), c->connecting_result.filters, sizeof(*filters) * c->connecting_result.num_filters); filters[num_filters - 1] = &grpc_connected_channel_filter; @@ -545,7 +545,7 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { grpc_channel_stack_init(exec_ctx, filters, num_filters, c->master, c->args, c->mdctx, stk); grpc_connected_channel_bind_transport(stk, c->connecting_result.transport); - gpr_free((void*)c->connecting_result.filters); + gpr_free((void *)c->connecting_result.filters); memset(&c->connecting_result, 0, sizeof(c->connecting_result)); /* initialize state watcher */ @@ -559,7 +559,7 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { if (c->disconnected) { gpr_mu_unlock(&c->mu); gpr_free(sw); - gpr_free((void*)filters); + gpr_free((void *)filters); grpc_channel_stack_destroy(exec_ctx, stk); GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, c->master, "connecting"); GRPC_SUBCHANNEL_UNREF(exec_ctx, c, "connecting"); @@ -601,7 +601,7 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { w4c = next; } - gpr_free((void*)filters); + gpr_free((void *)filters); if (destroy_connection != NULL) { connection_destroy(exec_ctx, destroy_connection); 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; diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c index ea07d49acb..7c4cf6f04d 100644 --- a/src/core/security/security_connector.c +++ b/src/core/security/security_connector.c @@ -648,12 +648,12 @@ grpc_security_status grpc_ssl_channel_security_connector_create( goto error; } *sc = &c->base; - gpr_free((void*)alpn_protocol_strings); + gpr_free((void *)alpn_protocol_strings); gpr_free(alpn_protocol_string_lengths); return GRPC_SECURITY_OK; error: - gpr_free((void*)alpn_protocol_strings); + gpr_free((void *)alpn_protocol_strings); gpr_free(alpn_protocol_string_lengths); return GRPC_SECURITY_ERROR; } @@ -703,12 +703,12 @@ grpc_security_status grpc_ssl_server_security_connector_create( goto error; } *sc = &c->base; - gpr_free((void*)alpn_protocol_strings); + gpr_free((void *)alpn_protocol_strings); gpr_free(alpn_protocol_string_lengths); return GRPC_SECURITY_OK; error: - gpr_free((void*)alpn_protocol_strings); + gpr_free((void *)alpn_protocol_strings); gpr_free(alpn_protocol_string_lengths); return GRPC_SECURITY_ERROR; } diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c index 7e6beec0c2..df9a09894c 100644 --- a/src/core/support/stack_lockfree.c +++ b/src/core/support/stack_lockfree.c @@ -67,7 +67,7 @@ typedef union lockfree_node { #define ENTRY_ALIGNMENT_BITS 3 /* make sure that entries aligned to 8-bytes */ #define INVALID_ENTRY_INDEX \ ((1 << 16) - 1) /* reserve this entry as invalid \ - */ + */ struct gpr_stack_lockfree { lockfree_node *entries; diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 28d0e8938d..b6d33066a9 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -183,7 +183,7 @@ typedef struct { struct grpc_server { size_t channel_filter_count; - grpc_channel_filter const**channel_filters; + grpc_channel_filter const **channel_filters; grpc_channel_args *channel_args; grpc_completion_queue **cqs; @@ -356,7 +356,7 @@ static void server_delete(grpc_exec_ctx *exec_ctx, grpc_server *server) { grpc_channel_args_destroy(server->channel_args); gpr_mu_destroy(&server->mu_global); gpr_mu_destroy(&server->mu_call); - gpr_free((void*)server->channel_filters); + gpr_free((void *)server->channel_filters); while ((rm = server->registered_methods) != NULL) { server->registered_methods = rm->next; request_matcher_destroy(&rm->request_matcher); @@ -988,7 +988,7 @@ void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s, chand->next->prev = chand->prev->next = chand; gpr_mu_unlock(&s->mu_global); - gpr_free((void*)filters); + gpr_free((void *)filters); GRPC_CHANNEL_INTERNAL_REF(channel, "connectivity"); memset(&op, 0, sizeof(op)); diff --git a/src/core/surface/version.c b/src/core/surface/version.c index 4b90e06a04..e559d51448 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,6 +36,4 @@ #include <grpc/grpc.h> -const char *grpc_version_string(void) { - return "0.11.0.0"; -} +const char *grpc_version_string(void) { return "0.11.0.0"; } diff --git a/test/core/util/port_windows.c b/test/core/util/port_windows.c index 3d2567757a..60ad9b4f2a 100644 --- a/test/core/util/port_windows.c +++ b/test/core/util/port_windows.c @@ -151,7 +151,8 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, gpr_mu_unlock(GRPC_POLLSET_MU(&pr->pollset)); } -static void destroy_pollset_and_shutdown(grpc_exec_ctx *exec_ctx, void *p, int success) { +static void destroy_pollset_and_shutdown(grpc_exec_ctx *exec_ctx, void *p, + int success) { grpc_pollset_destroy(p); grpc_shutdown(); } @@ -180,7 +181,8 @@ static int pick_port_using_server(char *server) { gpr_mu_lock(GRPC_POLLSET_MU(&pr.pollset)); while (pr.port == -1) { grpc_pollset_worker worker; - grpc_pollset_work(&exec_ctx, &pr.pollset, &worker, gpr_now(GPR_CLOCK_MONOTONIC), + grpc_pollset_work(&exec_ctx, &pr.pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset)); grpc_exec_ctx_flush(&exec_ctx); @@ -189,7 +191,8 @@ static int pick_port_using_server(char *server) { gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset)); grpc_httpcli_context_destroy(&context); - grpc_closure_init(&destroy_pollset_closure, destroy_pollset_and_shutdown, &pr.pollset); + grpc_closure_init(&destroy_pollset_closure, destroy_pollset_and_shutdown, + &pr.pollset); grpc_pollset_shutdown(&exec_ctx, &pr.pollset, &destroy_pollset_closure); grpc_exec_ctx_finish(&exec_ctx); |