diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/bad_client/bad_client.c | 8 | ||||
-rw-r--r-- | test/core/end2end/bad_server_response_test.c | 6 | ||||
-rw-r--r-- | test/core/iomgr/endpoint_tests.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.c | 12 | ||||
-rw-r--r-- | test/core/security/secure_endpoint_test.c | 6 | ||||
-rw-r--r-- | test/core/util/mock_endpoint.c | 2 | ||||
-rw-r--r-- | test/core/util/passthru_endpoint.c | 2 | ||||
-rw-r--r-- | test/core/util/trickle_endpoint.c | 4 |
8 files changed, 25 insertions, 23 deletions
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index c3964ca84b..383d1240cb 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -45,18 +45,18 @@ typedef struct { } thd_args; static void thd_func(void *arg) { - thd_args *a = arg; + thd_args *a = (thd_args *)arg; a->validator(a->server, a->cq, a->registered_method); gpr_event_set(&a->done_thd, (void *)1); } static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - thd_args *a = arg; + thd_args *a = (thd_args *)arg; gpr_event_set(&a->done_write, (void *)1); } static void server_setup_transport(void *ts, grpc_transport *transport) { - thd_args *a = ts; + thd_args *a = (thd_args *)ts; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_server_setup_transport(&exec_ctx, a->server, transport, NULL, grpc_server_get_channel_args(a->server)); @@ -64,7 +64,7 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { } static void read_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - gpr_event *read_done = arg; + gpr_event *read_done = (gpr_event *)arg; gpr_event_set(read_done, (void *)1); } diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index 5f89058c45..eeabc769d3 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -136,7 +136,7 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, grpc_pollset *accepting_pollset, grpc_tcp_server_acceptor *acceptor) { gpr_free(acceptor); - test_tcp_server *server = arg; + test_tcp_server *server = (test_tcp_server *)arg; GRPC_CLOSURE_INIT(&on_read, handle_read, NULL, grpc_schedule_on_exec_ctx); GRPC_CLOSURE_INIT(&on_write, done_write, NULL, grpc_schedule_on_exec_ctx); grpc_slice_buffer_init(&state.temp_incoming_buffer); @@ -237,7 +237,7 @@ typedef struct { } poll_args; static void actually_poll_server(void *arg) { - poll_args *pa = arg; + poll_args *pa = (poll_args *)arg; gpr_timespec deadline = n_sec_deadline(10); while (true) { bool done = gpr_atm_acq_load(&state.done_atm) != 0; @@ -259,7 +259,7 @@ static void poll_server_until_read_done(test_tcp_server *server, gpr_atm_rel_store(&state.done_atm, 0); state.write_done = 0; gpr_thd_id id; - poll_args *pa = gpr_malloc(sizeof(*pa)); + poll_args *pa = (poll_args *)gpr_malloc(sizeof(*pa)); pa->server = server; pa->signal_when_done = signal_when_done; gpr_thd_new(&id, actually_poll_server, pa, NULL); diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 11b45e8e08..895cc0e158 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -77,7 +77,7 @@ static void end_test(grpc_endpoint_test_config config) { config.clean_up(); } static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0); - grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); + grpc_slice *slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; size_t i; size_t j; @@ -117,7 +117,8 @@ struct read_and_write_test_state { static void read_and_write_test_read_handler(grpc_exec_ctx *exec_ctx, void *data, grpc_error *error) { - struct read_and_write_test_state *state = data; + struct read_and_write_test_state *state = + (struct read_and_write_test_state *)data; state->bytes_read += count_slices( state->incoming.slices, state->incoming.count, &state->current_read_data); @@ -135,7 +136,8 @@ static void read_and_write_test_read_handler(grpc_exec_ctx *exec_ctx, static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx, void *data, grpc_error *error) { - struct read_and_write_test_state *state = data; + struct read_and_write_test_state *state = + (struct read_and_write_test_state *)data; grpc_slice *slices = NULL; size_t nslices; diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index c45068e7ec..cdaa2ce2af 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -89,7 +89,7 @@ static ssize_t fill_socket(int fd) { static size_t fill_socket_partial(int fd, size_t bytes) { ssize_t write_bytes; size_t total_bytes = 0; - unsigned char *buf = gpr_malloc(bytes); + unsigned char *buf = (unsigned char *)gpr_malloc(bytes); unsigned i; for (i = 0; i < bytes; ++i) { buf[i] = (uint8_t)(i % 256); @@ -267,7 +267,7 @@ struct write_socket_state { static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u); - grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); + grpc_slice *slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; unsigned i, j; unsigned char *buf; @@ -301,7 +301,7 @@ static void write_done(grpc_exec_ctx *exec_ctx, } void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) { - unsigned char *buf = gpr_malloc(read_size); + unsigned char *buf = (unsigned char *)gpr_malloc(read_size); ssize_t bytes_read; size_t bytes_left = num_bytes; int flags; @@ -404,7 +404,7 @@ static void write_test(size_t num_bytes, size_t slice_size) { } void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *errors) { - int *done = arg; + int *done = (int *)arg; *done = 1; GPR_ASSERT( GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, NULL))); @@ -548,7 +548,7 @@ static grpc_endpoint_test_config configs[] = { static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { - grpc_pollset_destroy(exec_ctx, p); + grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p); } int main(int argc, char **argv) { @@ -556,7 +556,7 @@ int main(int argc, char **argv) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); grpc_init(); - g_pollset = gpr_zalloc(grpc_pollset_size()); + g_pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); grpc_endpoint_tests(configs[0], g_pollset, g_mu); run_tests(); diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c index fd8af2f152..7e6c0c782d 100644 --- a/test/core/security/secure_endpoint_test.c +++ b/test/core/security/secure_endpoint_test.c @@ -60,7 +60,7 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair( size_t still_pending_size; size_t total_buffer_size = 8192; size_t buffer_size = total_buffer_size; - uint8_t *encrypted_buffer = gpr_malloc(buffer_size); + uint8_t *encrypted_buffer = (uint8_t *)gpr_malloc(buffer_size); uint8_t *cur = encrypted_buffer; grpc_slice encrypted_leftover; for (i = 0; i < leftover_nslices; i++) { @@ -170,7 +170,7 @@ static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) { static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { - grpc_pollset_destroy(exec_ctx, p); + grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p); } int main(int argc, char **argv) { @@ -179,7 +179,7 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); - g_pollset = gpr_zalloc(grpc_pollset_size()); + g_pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); grpc_endpoint_tests(configs[0], g_pollset, g_mu); test_leftover(configs[1], 1); diff --git a/test/core/util/mock_endpoint.c b/test/core/util/mock_endpoint.c index 40cf0a2652..bd386b2148 100644 --- a/test/core/util/mock_endpoint.c +++ b/test/core/util/mock_endpoint.c @@ -110,7 +110,7 @@ static const grpc_endpoint_vtable vtable = { grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice), grpc_resource_quota *resource_quota) { - grpc_mock_endpoint *m = gpr_malloc(sizeof(*m)); + grpc_mock_endpoint *m = (grpc_mock_endpoint *)gpr_malloc(sizeof(*m)); m->base.vtable = &vtable; char *name; gpr_asprintf(&name, "mock_endpoint_%" PRIxPTR, (intptr_t)m); diff --git a/test/core/util/passthru_endpoint.c b/test/core/util/passthru_endpoint.c index eef1f163f0..38a47584d5 100644 --- a/test/core/util/passthru_endpoint.c +++ b/test/core/util/passthru_endpoint.c @@ -183,7 +183,7 @@ void grpc_passthru_endpoint_create(grpc_endpoint **client, grpc_endpoint **server, grpc_resource_quota *resource_quota, grpc_passthru_endpoint_stats *stats) { - passthru_endpoint *m = gpr_malloc(sizeof(*m)); + passthru_endpoint *m = (passthru_endpoint *)gpr_malloc(sizeof(*m)); m->halves = 2; m->shutdown = 0; m->stats = stats == NULL ? &m->dummy_stats : stats; diff --git a/test/core/util/trickle_endpoint.c b/test/core/util/trickle_endpoint.c index 4f3c30dcf6..fc066f9d80 100644 --- a/test/core/util/trickle_endpoint.c +++ b/test/core/util/trickle_endpoint.c @@ -128,7 +128,7 @@ static int te_get_fd(grpc_endpoint *ep) { static void te_finish_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - trickle_endpoint *te = arg; + trickle_endpoint *te = (trickle_endpoint *)arg; gpr_mu_lock(&te->mu); te->writing = false; grpc_slice_buffer_reset_and_unref(&te->writing_buffer); @@ -142,7 +142,7 @@ static const grpc_endpoint_vtable vtable = { grpc_endpoint *grpc_trickle_endpoint_create(grpc_endpoint *wrap, double bytes_per_second) { - trickle_endpoint *te = gpr_malloc(sizeof(*te)); + trickle_endpoint *te = (trickle_endpoint *)gpr_malloc(sizeof(*te)); te->base.vtable = &vtable; te->wrapped = wrap; te->bytes_per_second = bytes_per_second; |