mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: Use reinterpret_cast instead of C-style cast to align pointers.
This commit is contained in:
parent
4daf95b878
commit
7e28605830
|
@ -54,8 +54,8 @@ constexpr T Align(const T x, uint n)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr T *AlignPtr(T *x, uint n)
|
constexpr T *AlignPtr(T *x, uint n)
|
||||||
{
|
{
|
||||||
static_assert(sizeof(size_t) == sizeof(void *));
|
static_assert(sizeof(uintptr_t) == sizeof(void *));
|
||||||
return reinterpret_cast<T *>(Align((size_t)x, n));
|
return reinterpret_cast<T *>(Align(reinterpret_cast<uintptr_t>(x), n));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue