From be82e64b3debcdb1d9ec6a149fc85af0d46bfb7e Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Fri, 9 Feb 2018 09:16:55 -0800 Subject: Autofix c casts to c++ casts --- test/core/slice/slice_test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/core/slice/slice_test.cc') diff --git a/test/core/slice/slice_test.cc b/test/core/slice/slice_test.cc index e40154dd0e..5a49793a9e 100644 --- a/test/core/slice/slice_test.cc +++ b/test/core/slice/slice_test.cc @@ -57,7 +57,7 @@ static void test_slice_malloc_returns_something_sensible(void) { } /* We must be able to write to every byte of the data */ for (i = 0; i < length; i++) { - GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i; + GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } /* And finally we must succeed in destroying the slice */ grpc_slice_unref(slice); @@ -77,7 +77,7 @@ static void test_slice_new_returns_something_sensible(void) { } /* destroy function that sets a mark to indicate it was called. */ -static void set_mark(void* p) { *((int*)p) = 1; } +static void set_mark(void* p) { *(static_cast(p)) = 1; } static void test_slice_new_with_user_data(void) { int marker = 0; @@ -143,7 +143,7 @@ static void test_slice_sub_works(unsigned length) { beginning of the slice. */ slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { - GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i; + GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } /* Ensure that for all subsets length is correct and that we start on the @@ -183,7 +183,7 @@ static void test_slice_split_head_works(size_t length) { beginning of the slice. */ slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { - GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i; + GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } /* Ensure that for all subsets length is correct and that we start on the @@ -211,7 +211,7 @@ static void test_slice_split_tail_works(size_t length) { beginning of the slice. */ slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { - GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i; + GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } /* Ensure that for all subsets length is correct and that we start on the -- cgit v1.2.3