From b863bba932cc75ae1cdfa10b0f57d85d800a4015 Mon Sep 17 00:00:00 2001 From: Patrick Stotko Date: Fri, 1 May 2020 15:46:45 +0200 Subject: [PATCH] iterator: Fix old-style-cast warnings --- test/stdgpu/iterator.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/stdgpu/iterator.cpp b/test/stdgpu/iterator.cpp index 4873a6bec..8a30f8e3b 100644 --- a/test/stdgpu/iterator.cpp +++ b/test/stdgpu/iterator.cpp @@ -174,7 +174,7 @@ TEST_F(stdgpu_iterator, size_device_void) const stdgpu::index_t size = 42; int* array = createDeviceArray(size); - EXPECT_EQ(stdgpu::size((void*)array), size * sizeof(int)); + EXPECT_EQ(stdgpu::size(reinterpret_cast(array)), size * sizeof(int)); destroyDeviceArray(array); } @@ -185,7 +185,7 @@ TEST_F(stdgpu_iterator, size_host_void) const stdgpu::index_t size = 42; int* array = createHostArray(size); - EXPECT_EQ(stdgpu::size((void*)array), size * sizeof(int)); + EXPECT_EQ(stdgpu::size(reinterpret_cast(array)), size * sizeof(int)); destroyHostArray(array); } @@ -193,7 +193,8 @@ TEST_F(stdgpu_iterator, size_host_void) TEST_F(stdgpu_iterator, size_nullptr_void) { - EXPECT_EQ(stdgpu::size((void*)nullptr), static_cast(0)); + int* array = nullptr; + EXPECT_EQ(stdgpu::size(reinterpret_cast(array)), static_cast(0)); } @@ -221,7 +222,8 @@ TEST_F(stdgpu_iterator, size_host) TEST_F(stdgpu_iterator, size_nullptr) { - EXPECT_EQ(stdgpu::size((int*)nullptr), static_cast(0)); + int* array = nullptr; + EXPECT_EQ(stdgpu::size(array), static_cast(0)); }