From 7e286058305b07baffb96c034c35a82b2c53d53e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 8 Apr 2024 17:07:56 +0100 Subject: [PATCH] Fix: Use reinterpret_cast instead of C-style cast to align pointers. --- src/core/math_func.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 7b457c0569..67b347f2b4 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -54,8 +54,8 @@ constexpr T Align(const T x, uint n) template constexpr T *AlignPtr(T *x, uint n) { - static_assert(sizeof(size_t) == sizeof(void *)); - return reinterpret_cast(Align((size_t)x, n)); + static_assert(sizeof(uintptr_t) == sizeof(void *)); + return reinterpret_cast(Align(reinterpret_cast(x), n)); } /**