mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +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
@@ -76,11 +76,11 @@ namespace dawn_native {
|
||||
}
|
||||
template <typename T>
|
||||
T* NextCommand() {
|
||||
return reinterpret_cast<T*>(NextCommand(sizeof(T), alignof(T)));
|
||||
return static_cast<T*>(NextCommand(sizeof(T), alignof(T)));
|
||||
}
|
||||
template <typename T>
|
||||
T* NextData(size_t count) {
|
||||
return reinterpret_cast<T*>(NextData(sizeof(T) * count, alignof(T)));
|
||||
return static_cast<T*>(NextData(sizeof(T) * count, alignof(T)));
|
||||
}
|
||||
|
||||
// Needs to be called if iteration was stopped early.
|
||||
|
||||
Reference in New Issue
Block a user