From 333e41eac6daf60c6aa9df0496a39c57d74b9c87 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Sep 2022 17:38:25 +1000 Subject: Cleanup: replace C-style casts with functional casts for numeric types Use function style casts in C++ headers & source. --- source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh | 2 +- source/blender/blenlib/tests/BLI_vector_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/tests') diff --git a/source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh b/source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh index 63943e48f0e..367d8508a20 100644 --- a/source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh +++ b/source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh @@ -87,7 +87,7 @@ class ExceptionThrower { uint64_t hash() const { - return static_cast(value); + return uint64_t(value); } friend bool operator==(const ExceptionThrower &a, const ExceptionThrower &b) diff --git a/source/blender/blenlib/tests/BLI_vector_test.cc b/source/blender/blenlib/tests/BLI_vector_test.cc index 2dd220f562b..c603f5dff27 100644 --- a/source/blender/blenlib/tests/BLI_vector_test.cc +++ b/source/blender/blenlib/tests/BLI_vector_test.cc @@ -317,7 +317,7 @@ TEST(vector, BecomeLarge) } EXPECT_EQ(vec.size(), 100); for (int i = 0; i < 100; i++) { - EXPECT_EQ(vec[i], static_cast(i * 5)); + EXPECT_EQ(vec[i], int(i * 5)); } } -- cgit v1.2.3