1
0
Fork 0

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

pull/12454/head
Peter Nelson 2024-04-08 17:07:56 +01:00
parent 7a31bdab0f
commit 90a3a06371
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
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));
}
/**