Skip to content

Commit

Permalink
iterator: Fix old-style-cast warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stotko committed May 1, 2020
1 parent 52abff7 commit b863bba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/stdgpu/iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ TEST_F(stdgpu_iterator, size_device_void)
const stdgpu::index_t size = 42;
int* array = createDeviceArray<int>(size);

EXPECT_EQ(stdgpu::size((void*)array), size * sizeof(int));
EXPECT_EQ(stdgpu::size(reinterpret_cast<void*>(array)), size * sizeof(int));

destroyDeviceArray<int>(array);
}
Expand All @@ -185,15 +185,16 @@ TEST_F(stdgpu_iterator, size_host_void)
const stdgpu::index_t size = 42;
int* array = createHostArray<int>(size);

EXPECT_EQ(stdgpu::size((void*)array), size * sizeof(int));
EXPECT_EQ(stdgpu::size(reinterpret_cast<void*>(array)), size * sizeof(int));

destroyHostArray<int>(array);
}


TEST_F(stdgpu_iterator, size_nullptr_void)
{
EXPECT_EQ(stdgpu::size((void*)nullptr), static_cast<std::size_t>(0));
int* array = nullptr;
EXPECT_EQ(stdgpu::size(reinterpret_cast<void*>(array)), static_cast<std::size_t>(0));
}


Expand Down Expand Up @@ -221,7 +222,8 @@ TEST_F(stdgpu_iterator, size_host)

TEST_F(stdgpu_iterator, size_nullptr)
{
EXPECT_EQ(stdgpu::size((int*)nullptr), static_cast<std::size_t>(0));
int* array = nullptr;
EXPECT_EQ(stdgpu::size(array), static_cast<std::size_t>(0));
}


Expand Down

0 comments on commit b863bba

Please sign in to comment.