diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-09-08 16:04:12 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-09-08 16:50:07 -0700 |
commit | 7cdd99c86ecd47f2662d9be4cc77461336d1a3ea (patch) | |
tree | c32cc3d2d28e64089d707c542ac5c052f213c8a6 /test/core/end2end | |
parent | cc86cb75606ffc9d5a689b7adc3a5ee4fe8be7b7 (diff) |
Adding more pointer type conversions
Diffstat (limited to 'test/core/end2end')
-rw-r--r-- | test/core/end2end/fixtures/proxy.c | 36 | ||||
-rw-r--r-- | test/core/end2end/tests/connectivity.c | 2 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_causes_close.c | 6 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_latency.c | 2 | ||||
-rw-r--r-- | test/core/end2end/tests/payload.c | 2 | ||||
-rw-r--r-- | test/core/end2end/tests/resource_quota_server.c | 15 | ||||
-rw-r--r-- | test/core/end2end/tests/shutdown_finishes_tags.c | 2 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_payload.c | 2 |
8 files changed, 35 insertions, 32 deletions
diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index d457aeefe8..9ad862728f 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -80,7 +80,7 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, int proxy_port = grpc_pick_unused_port_or_die(); int server_port = grpc_pick_unused_port_or_die(); - grpc_end2end_proxy *proxy = gpr_malloc(sizeof(*proxy)); + grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)gpr_malloc(sizeof(*proxy)); memset(proxy, 0, sizeof(*proxy)); gpr_join_host_port(&proxy->proxy_port, "localhost", proxy_port); @@ -106,14 +106,14 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, } static closure *new_closure(void (*func)(void *arg, int success), void *arg) { - closure *cl = gpr_malloc(sizeof(*cl)); + closure *cl = (closure *)gpr_malloc(sizeof(*cl)); cl->func = func; cl->arg = arg; return cl; } static void shutdown_complete(void *arg, int success) { - grpc_end2end_proxy *proxy = arg; + grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; proxy->shutdown = 1; grpc_completion_queue_shutdown(proxy->cq); } @@ -146,12 +146,12 @@ static void unrefpc(proxy_call *pc, const char *reason) { static void refpc(proxy_call *pc, const char *reason) { gpr_ref(&pc->refs); } static void on_c2p_sent_initial_metadata(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; unrefpc(pc, "on_c2p_sent_initial_metadata"); } static void on_p2s_recv_initial_metadata(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -172,14 +172,14 @@ static void on_p2s_recv_initial_metadata(void *arg, int success) { } static void on_p2s_sent_initial_metadata(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; unrefpc(pc, "on_p2s_sent_initial_metadata"); } static void on_c2p_recv_msg(void *arg, int success); static void on_p2s_sent_message(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -199,12 +199,12 @@ static void on_p2s_sent_message(void *arg, int success) { } static void on_p2s_sent_close(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; unrefpc(pc, "on_p2s_sent_close"); } static void on_c2p_recv_msg(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -235,7 +235,7 @@ static void on_c2p_recv_msg(void *arg, int success) { static void on_p2s_recv_msg(void *arg, int success); static void on_c2p_sent_message(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -255,7 +255,7 @@ static void on_c2p_sent_message(void *arg, int success) { } static void on_p2s_recv_msg(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -275,12 +275,12 @@ static void on_p2s_recv_msg(void *arg, int success) { } static void on_c2p_sent_status(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; unrefpc(pc, "on_c2p_sent_status"); } static void on_p2s_status(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; grpc_op op; grpc_call_error err; @@ -305,18 +305,18 @@ static void on_p2s_status(void *arg, int success) { } static void on_c2p_closed(void *arg, int success) { - proxy_call *pc = arg; + proxy_call *pc = (proxy_call *)arg; unrefpc(pc, "on_c2p_closed"); } static void on_new_call(void *arg, int success) { - grpc_end2end_proxy *proxy = arg; + grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; grpc_call_error err; if (success) { grpc_op op; memset(&op, 0, sizeof(op)); - proxy_call *pc = gpr_malloc(sizeof(*pc)); + proxy_call *pc = (proxy_call *)gpr_malloc(sizeof(*pc)); memset(pc, 0, sizeof(*pc)); pc->proxy = proxy; GPR_SWAP(grpc_metadata_array, pc->c2p_initial_metadata, @@ -404,7 +404,7 @@ static void request_call(grpc_end2end_proxy *proxy) { } static void thread_main(void *arg) { - grpc_end2end_proxy *proxy = arg; + grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; closure *cl; for (;;) { grpc_event ev = grpc_completion_queue_next( @@ -416,7 +416,7 @@ static void thread_main(void *arg) { case GRPC_QUEUE_SHUTDOWN: return; case GRPC_OP_COMPLETE: - cl = ev.tag; + cl = (closure *)ev.tag; cl->func(cl->arg, ev.success); gpr_free(cl); break; diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.c index a5af46e09e..610243ee3a 100644 --- a/test/core/end2end/tests/connectivity.c +++ b/test/core/end2end/tests/connectivity.c @@ -34,7 +34,7 @@ typedef struct { } child_events; static void child_thread(void *arg) { - child_events *ce = arg; + child_events *ce = (child_events *)arg; grpc_event ev; gpr_event_set(&ce->started, (void *)1); gpr_log(GPR_DEBUG, "verifying"); diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 5a8c96d121..ee7aeb3f33 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -195,8 +195,8 @@ typedef struct { uint8_t unused; } channel_data; static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_call_element *elem = arg; - call_data *calld = elem->call_data; + grpc_call_element *elem = (grpc_call_element *)arg; + call_data *calld = (call_data *)elem->call_data; GRPC_CLOSURE_RUN( exec_ctx, calld->recv_im_ready, grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( @@ -208,7 +208,7 @@ static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, static void start_transport_stream_op_batch( grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_transport_stream_op_batch *op) { - call_data *calld = elem->call_data; + call_data *calld = (call_data *)elem->call_data; if (op->recv_initial_metadata) { calld->recv_im_ready = op->payload->recv_initial_metadata.recv_initial_metadata_ready; diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c index 8918c3b2f6..c24934f05d 100644 --- a/test/core/end2end/tests/filter_latency.c +++ b/test/core/end2end/tests/filter_latency.c @@ -312,7 +312,7 @@ static const grpc_channel_filter test_server_filter = { static bool maybe_add_filter(grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) { - grpc_channel_filter *filter = arg; + grpc_channel_filter *filter = (grpc_channel_filter *)arg; if (g_enable_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 19fb4d9769..d98eed68e0 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -91,7 +91,7 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char *output; const size_t output_size = 1024 * 1024; - output = gpr_malloc(output_size); + output = (char *)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 34a6a80a31..57018628ce 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -91,7 +91,7 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char *output; const size_t output_size = 1024 * 1024; - output = gpr_malloc(output_size); + output = (char *)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } @@ -131,8 +131,10 @@ void resource_quota_server(grpc_end2end_test_config config) { * will be verified on completion. */ grpc_slice request_payload_slice = generate_random_slice(); - grpc_call **client_calls = malloc(sizeof(grpc_call *) * NUM_CALLS); - grpc_call **server_calls = malloc(sizeof(grpc_call *) * NUM_CALLS); + grpc_call **client_calls = + (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS); + grpc_call **server_calls = + (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS); grpc_metadata_array *initial_metadata_recv = malloc(sizeof(grpc_metadata_array) * NUM_CALLS); grpc_metadata_array *trailing_metadata_recv = @@ -141,13 +143,14 @@ void resource_quota_server(grpc_end2end_test_config config) { malloc(sizeof(grpc_metadata_array) * NUM_CALLS); grpc_call_details *call_details = malloc(sizeof(grpc_call_details) * NUM_CALLS); - grpc_status_code *status = malloc(sizeof(grpc_status_code) * NUM_CALLS); - grpc_slice *details = malloc(sizeof(grpc_slice) * NUM_CALLS); + grpc_status_code *status = + (grpc_status_code *)malloc(sizeof(grpc_status_code) * NUM_CALLS); + grpc_slice *details = (grpc_slice *)malloc(sizeof(grpc_slice) * NUM_CALLS); grpc_byte_buffer **request_payload = malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS); grpc_byte_buffer **request_payload_recv = malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS); - int *was_cancelled = malloc(sizeof(int) * NUM_CALLS); + int *was_cancelled = (int *)malloc(sizeof(int) * NUM_CALLS); grpc_call_error error; int pending_client_calls = 0; int pending_server_start_calls = 0; diff --git a/test/core/end2end/tests/shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.c index f9b8e4c955..7914cc95ba 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.c +++ b/test/core/end2end/tests/shutdown_finishes_tags.c @@ -78,7 +78,7 @@ static void test_early_server_shutdown_finishes_tags( grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_tags", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_call *s = (void *)1; + grpc_call *s = (grpc_call *)(uintptr_t)1; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/stream_compression_payload.c b/test/core/end2end/tests/stream_compression_payload.c index 5135df81ed..e47d2aa93c 100644 --- a/test/core/end2end/tests/stream_compression_payload.c +++ b/test/core/end2end/tests/stream_compression_payload.c @@ -95,7 +95,7 @@ static grpc_slice generate_random_slice() { static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; char *output; const size_t output_size = 1024 * 1024; - output = gpr_malloc(output_size); + output = (char *)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } |