From 1c090699da0ba779e001cc9bc13af42d7716f7ce Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 21 Aug 2015 13:07:01 -0700 Subject: [PATCH] clang-format --- src/core/iomgr/tcp_windows.c | 12 +++++---- src/core/transport/chttp2_transport.c | 37 +++++++++++++-------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index a63123c6c9d..1cf2ca2131e 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -169,7 +169,9 @@ static void on_read_cb(void *tcpp, int from_iocp) { cb->cb(cb->cb_arg, success); } -static grpc_endpoint_op_status win_read(grpc_endpoint *ep, gpr_slice_buffer *read_slices, grpc_iomgr_closure *cb) { +static grpc_endpoint_op_status win_read(grpc_endpoint *ep, + gpr_slice_buffer *read_slices, + grpc_iomgr_closure *cb) { grpc_tcp *tcp = (grpc_tcp *)ep; grpc_winsocket *handle = tcp->socket; grpc_winsocket_callback_info *info = &handle->read_info; @@ -275,8 +277,8 @@ static void on_write(void *tcpp, int from_iocp) { /* Initiates a write. */ static grpc_endpoint_op_status win_write(grpc_endpoint *ep, - gpr_slice_buffer *slices, - grpc_iomgr_closure *cb) { + gpr_slice_buffer *slices, + grpc_iomgr_closure *cb) { grpc_tcp *tcp = (grpc_tcp *)ep; grpc_winsocket *socket = tcp->socket; grpc_winsocket_callback_info *info = &socket->write_info; @@ -398,8 +400,8 @@ static char *win_get_peer(grpc_endpoint *ep) { } static grpc_endpoint_vtable vtable = { - win_read, win_write, win_add_to_pollset, win_add_to_pollset_set, - win_shutdown, win_destroy, win_get_peer}; + win_read, win_write, win_add_to_pollset, win_add_to_pollset_set, + win_shutdown, win_destroy, win_get_peer}; grpc_endpoint *grpc_tcp_create(grpc_winsocket *socket, char *peer_string) { grpc_tcp *tcp = (grpc_tcp *)gpr_malloc(sizeof(grpc_tcp)); diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 46ab0a585f9..8caa10c9389 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -1074,12 +1074,12 @@ static int recv_data_loop(grpc_chttp2_transport *t, int *success) { t->parsing_active = 1; /* merge stream lists */ grpc_chttp2_stream_map_move_into(&t->new_stream_map, - &t->parsing_stream_map); + &t->parsing_stream_map); grpc_chttp2_prepare_to_read(&t->global, &t->parsing); gpr_mu_unlock(&t->mu); for (; i < t->read_buffer.count && - grpc_chttp2_perform_read(&t->parsing, t->read_buffer.slices[i]); - i++) + grpc_chttp2_perform_read(&t->parsing, t->read_buffer.slices[i]); + i++) ; gpr_mu_lock(&t->mu); if (i != t->read_buffer.count) { @@ -1087,12 +1087,12 @@ static int recv_data_loop(grpc_chttp2_transport *t, int *success) { } /* merge stream lists */ grpc_chttp2_stream_map_move_into(&t->new_stream_map, - &t->parsing_stream_map); + &t->parsing_stream_map); t->global.concurrent_stream_count = - grpc_chttp2_stream_map_size(&t->parsing_stream_map); + grpc_chttp2_stream_map_size(&t->parsing_stream_map); if (t->parsing.initial_window_update != 0) { grpc_chttp2_stream_map_for_each(&t->parsing_stream_map, - update_global_window, t); + update_global_window, t); t->parsing.initial_window_update = 0; } /* handle higher level things */ @@ -1102,8 +1102,7 @@ static int recv_data_loop(grpc_chttp2_transport *t, int *success) { if (!*success || i != t->read_buffer.count) { drop_connection(t); read_error_locked(t); - } - else { + } else { keep_reading = 1; } gpr_slice_buffer_reset_and_unref(&t->read_buffer); @@ -1111,17 +1110,16 @@ static int recv_data_loop(grpc_chttp2_transport *t, int *success) { if (keep_reading) { switch (grpc_endpoint_read(t->ep, &t->read_buffer, &t->recv_data)) { - case GRPC_ENDPOINT_DONE: - *success = 1; - return 1; - case GRPC_ENDPOINT_ERROR: - *success = 0; - return 1; - case GRPC_ENDPOINT_PENDING: - return 0; + case GRPC_ENDPOINT_DONE: + *success = 1; + return 1; + case GRPC_ENDPOINT_ERROR: + *success = 0; + return 1; + case GRPC_ENDPOINT_PENDING: + return 0; } - } - else { + } else { UNREF_TRANSPORT(t, "recv_data"); return 0; } @@ -1133,7 +1131,8 @@ static int recv_data_loop(grpc_chttp2_transport *t, int *success) { static void recv_data(void *tp, int success) { grpc_chttp2_transport *t = tp; - while (recv_data_loop(t, &success)); + while (recv_data_loop(t, &success)) + ; } /*