diff options
Diffstat (limited to 'src/core/ext/filters/client_channel/subchannel.c')
-rw-r--r-- | src/core/ext/filters/client_channel/subchannel.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/core/ext/filters/client_channel/subchannel.c b/src/core/ext/filters/client_channel/subchannel.c index 6b5b383efd..05c55aaa89 100644 --- a/src/core/ext/filters/client_channel/subchannel.c +++ b/src/core/ext/filters/client_channel/subchannel.c @@ -157,7 +157,7 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *subchannel, static void connection_destroy(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_connected_subchannel *c = arg; + grpc_connected_subchannel *c = (grpc_connected_subchannel *)arg; grpc_channel_stack_destroy(exec_ctx, CHANNEL_STACK_FROM_CONNECTION(c)); gpr_free(c); } @@ -181,7 +181,7 @@ void grpc_connected_subchannel_unref(grpc_exec_ctx *exec_ctx, static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_subchannel *c = arg; + grpc_subchannel *c = (grpc_subchannel *)arg; gpr_free((void *)c->filters); grpc_channel_args_destroy(exec_ctx, c->args); grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker); @@ -290,21 +290,23 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, return c; } - c = gpr_zalloc(sizeof(*c)); + c = (grpc_subchannel *)gpr_zalloc(sizeof(*c)); c->key = key; gpr_atm_no_barrier_store(&c->ref_pair, 1 << INTERNAL_REF_BITS); c->connector = connector; grpc_connector_ref(c->connector); c->num_filters = args->filter_count; if (c->num_filters > 0) { - c->filters = gpr_malloc(sizeof(grpc_channel_filter *) * c->num_filters); + c->filters = (const grpc_channel_filter **)gpr_malloc( + sizeof(grpc_channel_filter *) * c->num_filters); memcpy((void *)c->filters, args->filters, sizeof(grpc_channel_filter *) * c->num_filters); } else { c->filters = NULL; } c->pollset_set = grpc_pollset_set_create(); - grpc_resolved_address *addr = gpr_malloc(sizeof(*addr)); + grpc_resolved_address *addr = + (grpc_resolved_address *)gpr_malloc(sizeof(*addr)); grpc_get_subchannel_address_arg(exec_ctx, args->args, addr); grpc_resolved_address *new_address = NULL; grpc_channel_args *new_args = NULL; @@ -400,7 +402,7 @@ grpc_connectivity_state grpc_subchannel_check_connectivity(grpc_subchannel *c, static void on_external_state_watcher_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - external_state_watcher *w = arg; + external_state_watcher *w = (external_state_watcher *)arg; grpc_closure *follow_up = w->notify; if (w->pollset_set != NULL) { grpc_pollset_set_del_pollset_set(exec_ctx, w->subchannel->pollset_set, @@ -416,7 +418,7 @@ static void on_external_state_watcher_done(grpc_exec_ctx *exec_ctx, void *arg, } static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_subchannel *c = arg; + grpc_subchannel *c = (grpc_subchannel *)arg; gpr_mu_lock(&c->mu); c->have_alarm = false; if (c->disconnected) { @@ -501,7 +503,7 @@ void grpc_subchannel_notify_on_state_change( } gpr_mu_unlock(&c->mu); } else { - w = gpr_malloc(sizeof(*w)); + w = (external_state_watcher *)gpr_malloc(sizeof(*w)); w->subchannel = c; w->pollset_set = interested_parties; w->notify = notify; @@ -533,7 +535,7 @@ void grpc_connected_subchannel_process_transport_op( static void subchannel_on_child_state_changed(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { - state_watcher *sw = p; + state_watcher *sw = (state_watcher *)p; grpc_subchannel *c = sw->subchannel; gpr_mu *mu = &c->mu; @@ -623,7 +625,7 @@ static bool publish_transport_locked(grpc_exec_ctx *exec_ctx, memset(&c->connecting_result, 0, sizeof(c->connecting_result)); /* initialize state watcher */ - sw_subchannel = gpr_malloc(sizeof(*sw_subchannel)); + sw_subchannel = (state_watcher *)gpr_malloc(sizeof(*sw_subchannel)); sw_subchannel->subchannel = c; sw_subchannel->connectivity_state = GRPC_CHANNEL_READY; GRPC_CLOSURE_INIT(&sw_subchannel->closure, subchannel_on_child_state_changed, @@ -660,7 +662,7 @@ static bool publish_transport_locked(grpc_exec_ctx *exec_ctx, static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_subchannel *c = arg; + grpc_subchannel *c = (grpc_subchannel *)arg; grpc_channel_args *delete_channel_args = c->connecting_result.channel_args; GRPC_SUBCHANNEL_WEAK_REF(c, "connected"); @@ -696,7 +698,7 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg, static void subchannel_call_destroy(grpc_exec_ctx *exec_ctx, void *call, grpc_error *error) { - grpc_subchannel_call *c = call; + grpc_subchannel_call *c = (grpc_subchannel_call *)call; GPR_ASSERT(c->schedule_closure_after_destroy != NULL); GPR_TIMER_BEGIN("grpc_subchannel_call_unref.destroy", 0); grpc_connected_subchannel *connection = c->connection; @@ -750,7 +752,7 @@ grpc_error *grpc_connected_subchannel_create_call( const grpc_connected_subchannel_call_args *args, grpc_subchannel_call **call) { grpc_channel_stack *chanstk = CHANNEL_STACK_FROM_CONNECTION(con); - *call = gpr_arena_alloc( + *call = (grpc_subchannel_call *)gpr_arena_alloc( args->arena, sizeof(grpc_subchannel_call) + chanstk->call_stack_size); grpc_call_stack *callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call); (*call)->connection = GRPC_CONNECTED_SUBCHANNEL_REF(con, "subchannel_call"); |