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:
Rafael Cintron
2019-05-03 00:58:27 +00:00
committed by Commit Bot service account
parent e99e2408e9
commit f54bb68f47
12 changed files with 20 additions and 21 deletions

View File

@@ -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.