diff options
author | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:16:55 -0800 |
---|---|---|
committer | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:16:55 -0800 |
commit | be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e (patch) | |
tree | cc5e1234073eb250a2c319b5a4db2919fce060ea /test/core/iomgr/endpoint_tests.cc | |
parent | 194436342137924b4fb7429bede037a4b5ec7edb (diff) |
Autofix c casts to c++ casts
Diffstat (limited to 'test/core/iomgr/endpoint_tests.cc')
-rw-r--r-- | test/core/iomgr/endpoint_tests.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc index 842be8fc92..9719a90e82 100644 --- a/test/core/iomgr/endpoint_tests.cc +++ b/test/core/iomgr/endpoint_tests.cc @@ -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 = (grpc_slice*)gpr_malloc(sizeof(grpc_slice) * nslices); + grpc_slice* slices = static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nslices)); size_t num_bytes_left = num_bytes; size_t i; size_t j; @@ -117,7 +117,7 @@ struct read_and_write_test_state { static void read_and_write_test_read_handler(void* data, grpc_error* error) { struct read_and_write_test_state* state = - (struct read_and_write_test_state*)data; + static_cast<struct read_and_write_test_state*>(data); state->bytes_read += count_slices( state->incoming.slices, state->incoming.count, &state->current_read_data); @@ -134,7 +134,7 @@ static void read_and_write_test_read_handler(void* data, grpc_error* error) { static void read_and_write_test_write_handler(void* data, grpc_error* error) { struct read_and_write_test_state* state = - (struct read_and_write_test_state*)data; + static_cast<struct read_and_write_test_state*>(data); grpc_slice* slices = nullptr; size_t nslices; @@ -246,7 +246,7 @@ static void read_and_write_test(grpc_endpoint_test_config config, static void inc_on_failure(void* arg, grpc_error* error) { gpr_mu_lock(g_mu); - *(int*)arg += (error != GRPC_ERROR_NONE); + *static_cast<int*>(arg) += (error != GRPC_ERROR_NONE); GPR_ASSERT(GRPC_LOG_IF_ERROR("kick", grpc_pollset_kick(g_pollset, nullptr))); gpr_mu_unlock(g_mu); } |