From 467e8369a896397d40abf7c3e9141c1e7440a2e4 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Tue, 14 Nov 2017 14:59:37 -0800 Subject: [PATCH] clang fmt --- .../client_channel/lb_policy/grpclb/grpclb.cc | 8 ++--- .../lb_policy/pick_first/pick_first.cc | 3 +- .../lb_policy/subchannel_list.cc | 3 +- .../ext/transport/inproc/inproc_transport.cc | 33 +++++++++++-------- src/core/lib/iomgr/tcp_posix.cc | 3 +- src/core/lib/surface/call.cc | 4 +-- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 005df3c6d1f..9b0cf585118 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1178,8 +1178,8 @@ static int glb_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol, bool pick_done = false; if (glb_policy->rr_policy != nullptr) { const grpc_connectivity_state rr_connectivity_state = - grpc_lb_policy_check_connectivity_locked(exec_ctx, - glb_policy->rr_policy, nullptr); + grpc_lb_policy_check_connectivity_locked( + exec_ctx, glb_policy->rr_policy, nullptr); // The glb_policy->rr_policy may have transitioned to SHUTDOWN but the // callback registered to capture this event // (glb_rr_connectivity_changed_locked) may not have been invoked yet. We @@ -1525,8 +1525,8 @@ static void query_for_backends_locked(grpc_exec_ctx* exec_ctx, op->flags = 0; op->reserved = nullptr; op++; - call_error = grpc_call_start_batch_and_execute(exec_ctx, glb_policy->lb_call, - ops, (size_t)(op - ops), nullptr); + call_error = grpc_call_start_batch_and_execute( + exec_ctx, glb_policy->lb_call, ops, (size_t)(op - ops), nullptr); GPR_ASSERT(GRPC_CALL_OK == call_error); op = ops; diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 0f0d245f82f..54866f2a5db 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -154,7 +154,8 @@ static void pf_cancel_picks_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol, static void start_picking_locked(grpc_exec_ctx* exec_ctx, pick_first_lb_policy* p) { p->started_picking = true; - if (p->subchannel_list != nullptr && p->subchannel_list->num_subchannels > 0) { + if (p->subchannel_list != nullptr && + p->subchannel_list->num_subchannels > 0) { p->subchannel_list->checking_subchannel = 0; grpc_lb_subchannel_list_ref_for_connectivity_watch( p->subchannel_list, "connectivity_watch+start_picking"); diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc index 7d39cc009fd..b6fce4d2075 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc @@ -240,7 +240,8 @@ static void subchannel_data_cancel_connectivity_watch( (size_t)(sd - sd->subchannel_list->subchannels), sd->subchannel_list->num_subchannels, sd->subchannel, reason); } - grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, nullptr, nullptr, + grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, nullptr, + nullptr, &sd->connectivity_changed_closure); } diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index cf6418a66c1..25790608116 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -410,10 +410,11 @@ static void fail_helper_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s, grpc_metadata_batch_init(&fake_md); inproc_stream* other = s->other_side; - grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md - : &other->to_read_trailing_md; + grpc_metadata_batch* dest = (other == nullptr) + ? &s->write_buffer_trailing_md + : &other->to_read_trailing_md; bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled - : &other->to_read_trailing_md_filled; + : &other->to_read_trailing_md_filled; fill_in_metadata(exec_ctx, s, &fake_md, 0, dest, nullptr, destfilled); grpc_metadata_batch_destroy(exec_ctx, &fake_md); @@ -612,10 +613,11 @@ static void op_state_machine(grpc_exec_ctx* exec_ctx, void* arg, (!s->send_message_op || (s->t->is_client && (s->trailing_md_recvd || s->to_read_trailing_md_filled)))) { - grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md - : &other->to_read_trailing_md; + grpc_metadata_batch* dest = (other == nullptr) + ? &s->write_buffer_trailing_md + : &other->to_read_trailing_md; bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled - : &other->to_read_trailing_md_filled; + : &other->to_read_trailing_md_filled; if (*destfilled || s->trailing_md_sent) { // The buffer is already in use; that's an error! INPROC_LOG(GPR_DEBUG, "Extra trailing metadata %p", s); @@ -827,10 +829,11 @@ static bool cancel_stream_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s, grpc_metadata_batch_init(&cancel_md); inproc_stream* other = s->other_side; - grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md - : &other->to_read_trailing_md; + grpc_metadata_batch* dest = (other == nullptr) + ? &s->write_buffer_trailing_md + : &other->to_read_trailing_md; bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled - : &other->to_read_trailing_md_filled; + : &other->to_read_trailing_md_filled; fill_in_metadata(exec_ctx, s, &cancel_md, 0, dest, nullptr, destfilled); grpc_metadata_batch_destroy(exec_ctx, &cancel_md); @@ -914,12 +917,14 @@ static void perform_stream_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt, error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown"); } if (error == GRPC_ERROR_NONE && op->send_initial_metadata) { - grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_initial_md - : &other->to_read_initial_md; - uint32_t* destflags = (other == nullptr) ? &s->write_buffer_initial_md_flags - : &other->to_read_initial_md_flags; + grpc_metadata_batch* dest = (other == nullptr) + ? &s->write_buffer_initial_md + : &other->to_read_initial_md; + uint32_t* destflags = (other == nullptr) + ? &s->write_buffer_initial_md_flags + : &other->to_read_initial_md_flags; bool* destfilled = (other == nullptr) ? &s->write_buffer_initial_md_filled - : &other->to_read_initial_md_filled; + : &other->to_read_initial_md_filled; if (*destfilled || s->initial_md_sent) { // The buffer is already in use; that's an error! INPROC_LOG(GPR_DEBUG, "Extra initial metadata %p", s); diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index ff78480a1ab..6d9e044fa2e 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -198,7 +198,8 @@ static void cover_self(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) { grpc_executor_scheduler(GRPC_EXECUTOR_LONG)), GRPC_ERROR_NONE); } else { - while ((p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller)) == nullptr) { + while ((p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller)) == + nullptr) { // spin waiting for backup poller } } diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 4aec3247976..a83c95c8dc3 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -1909,8 +1909,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx, if (!prepare_application_metadata( exec_ctx, call, (int)op->data.send_status_from_server.trailing_metadata_count, - op->data.send_status_from_server.trailing_metadata, 1, 1, nullptr, - 0)) { + op->data.send_status_from_server.trailing_metadata, 1, 1, + nullptr, 0)) { for (int n = 0; n < call->send_extra_metadata_count; n++) { GRPC_MDELEM_UNREF(exec_ctx, call->send_extra_metadata[n].md); }