mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Improve usage of static_casts over reinterpret_casts
Static_casts are prefered over reinterpret_casts for better type safety Change-Id: I190cbee293591ebf8ab8035e900c081848eb1f30 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6921 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
e99e2408e9
commit
f54bb68f47
@@ -545,7 +545,7 @@ void DawnTest::ResolveExpectations() {
|
||||
|
||||
// Get a pointer to the mapped copy of the data for the expectation.
|
||||
const char* data =
|
||||
reinterpret_cast<const char*>(mReadbackSlots[expectation.readbackSlot].mappedData);
|
||||
static_cast<const char*>(mReadbackSlots[expectation.readbackSlot].mappedData);
|
||||
data += expectation.readbackOffset;
|
||||
|
||||
uint32_t size;
|
||||
@@ -652,7 +652,7 @@ namespace detail {
|
||||
testing::AssertionResult ExpectEq<T>::Check(const void* data, size_t size) {
|
||||
DAWN_ASSERT(size == sizeof(T) * mExpected.size());
|
||||
|
||||
const T* actual = reinterpret_cast<const T*>(data);
|
||||
const T* actual = static_cast<const T*>(data);
|
||||
|
||||
testing::AssertionResult failure = testing::AssertionFailure();
|
||||
for (size_t i = 0; i < mExpected.size(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user