Fix: Use reinterpret_cast instead of C-style cast to align pointers.

This commit is contained in:
Peter Nelson 2024-04-08 17:07:56 +01:00 committed by Peter Nelson
parent 4daf95b878
commit 7e28605830
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ constexpr T Align(const T x, uint n)
template <typename T>
constexpr T *AlignPtr(T *x, uint n)
{
static_assert(sizeof(size_t) == sizeof(void *));
return reinterpret_cast<T *>(Align((size_t)x, n));
static_assert(sizeof(uintptr_t) == sizeof(void *));
return reinterpret_cast<T *>(Align(reinterpret_cast<uintptr_t>(x), n));
}
/**