aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-09-25 13:38:03 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2017-10-02 16:29:41 -0700
commitd8b84a249edd8d6f3f42ca40ec17668e67f38dff (patch)
treeae03ebf093a0063f032a3b3680b18ef1c33ae2d9 /src/core/lib/surface
parent840844bd1cacc57aca2df4ad0675333a7972ef84 (diff)
Removing few more build errors
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r--src/core/lib/surface/call.cc29
-rw-r--r--src/core/lib/surface/completion_queue.cc45
2 files changed, 27 insertions, 47 deletions
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index 173e800f0d..4055d656bd 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -94,13 +94,11 @@ static gpr_atm pack_received_status(received_status r) {
}
static received_status unpack_received_status(gpr_atm atm) {
- return (atm & 1) == 0
- ? (received_status){false, /* is_set */
- GRPC_ERROR_NONE /*error */
- }
- : (received_status){true, /* is_set */
- (grpc_error *)(atm & ~(gpr_atm)1) /* error */
- };
+ if ((atm & 1) == 0) {
+ return {false, GRPC_ERROR_NONE};
+ } else {
+ return {true, (grpc_error *)(atm & ~(gpr_atm)1)};
+ }
}
#define MAX_ERRORS_PER_BATCH 4
@@ -443,15 +441,14 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");
/* initial refcount dropped by grpc_call_unref */
- grpc_call_element_args call_args = {
- .call_stack = CALL_STACK_FROM_CALL(call),
- .server_transport_data = args->server_transport_data,
- .context = call->context,
- .path = path,
- .start_time = call->start_time,
- .deadline = send_deadline,
- .arena = call->arena,
- .call_combiner = &call->call_combiner};
+ grpc_call_element_args call_args = {CALL_STACK_FROM_CALL(call),
+ args->server_transport_data,
+ call->context,
+ path,
+ call->start_time,
+ send_deadline,
+ call->arena,
+ &call->call_combiner};
add_init_error(&error, grpc_call_stack_init(exec_ctx, channel_stack, 1,
destroy_call, call, &call_args));
if (error != GRPC_ERROR_NONE) {
diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc
index fed66e3a20..d332e841a3 100644
--- a/src/core/lib/surface/completion_queue.cc
+++ b/src/core/lib/surface/completion_queue.cc
@@ -164,32 +164,15 @@ static void non_polling_poller_shutdown(grpc_exec_ctx *exec_ctx,
static const cq_poller_vtable g_poller_vtable_by_poller_type[] = {
/* GRPC_CQ_DEFAULT_POLLING */
- {.can_get_pollset = true,
- .can_listen = true,
- .size = grpc_pollset_size,
- .init = grpc_pollset_init,
- .kick = grpc_pollset_kick,
- .work = grpc_pollset_work,
- .shutdown = grpc_pollset_shutdown,
- .destroy = grpc_pollset_destroy},
+ {true, true, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick,
+ grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy},
/* GRPC_CQ_NON_LISTENING */
- {.can_get_pollset = true,
- .can_listen = false,
- .size = grpc_pollset_size,
- .init = grpc_pollset_init,
- .kick = grpc_pollset_kick,
- .work = grpc_pollset_work,
- .shutdown = grpc_pollset_shutdown,
- .destroy = grpc_pollset_destroy},
+ {true, false, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick,
+ grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy},
/* GRPC_CQ_NON_POLLING */
- {.can_get_pollset = false,
- .can_listen = false,
- .size = non_polling_poller_size,
- .init = non_polling_poller_init,
- .kick = non_polling_poller_kick,
- .work = non_polling_poller_work,
- .shutdown = non_polling_poller_shutdown,
- .destroy = non_polling_poller_destroy},
+ {false, false, non_polling_poller_size, non_polling_poller_init,
+ non_polling_poller_kick, non_polling_poller_work,
+ non_polling_poller_shutdown, non_polling_poller_destroy},
};
typedef struct cq_vtable {
@@ -838,13 +821,13 @@ static grpc_event cq_next(grpc_completion_queue *cq, gpr_timespec deadline,
GRPC_CQ_INTERNAL_REF(cq, "next");
cq_is_finished_arg is_finished_arg = {
- .last_seen_things_queued_ever =
- gpr_atm_no_barrier_load(&cqd->things_queued_ever),
- .cq = cq,
- .deadline = deadline,
- .stolen_completion = NULL,
- .tag = NULL,
- .first_loop = true};
+
+ gpr_atm_no_barrier_load(&cqd->things_queued_ever),
+ cq,
+ deadline,
+ NULL,
+ NULL,
+ true};
grpc_exec_ctx exec_ctx =
GRPC_EXEC_CTX_INITIALIZER(0, cq_is_next_finished, &is_finished_arg);