aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-03-05 09:58:05 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-03-05 16:35:10 -0800
commit7fed69b7ad10a06c2eedaaf0279f44f2bab0d85c (patch)
treecab05136a7422d5ce317fe7e7aa4f959f7e9f125 /test/cpp/util
parent673439d5bd2d1711c10e8c4d29ceee3e67d585fd (diff)
Use static_cast rather than reinterpret_cast whenever possible
Diffstat (limited to 'test/cpp/util')
-rw-r--r--test/cpp/util/slice_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cpp/util/slice_test.cc b/test/cpp/util/slice_test.cc
index c2e55f3374..5f0b9c17cc 100644
--- a/test/cpp/util/slice_test.cc
+++ b/test/cpp/util/slice_test.cc
@@ -67,7 +67,7 @@ TEST_F(SliceTest, StaticBuf) {
TEST_F(SliceTest, SliceNew) {
char* x = new char[strlen(kContent) + 1];
strcpy(x, kContent);
- Slice spp(x, strlen(x), [](void* p) { delete[] reinterpret_cast<char*>(p); });
+ Slice spp(x, strlen(x), [](void* p) { delete[] static_cast<char*>(p); });
CheckSlice(spp, kContent);
}
@@ -86,7 +86,7 @@ TEST_F(SliceTest, SliceNewWithUserData) {
strcpy(t->x, kContent);
Slice spp(t->x, strlen(t->x),
[](void* p) {
- auto* t = reinterpret_cast<stest*>(p);
+ auto* t = static_cast<stest*>(p);
delete[] t->x;
delete t;
},