refactor(miscellaneous): renamed builtin type, add fixed-width character type

This commit is contained in:
2022-04-08 17:29:05 +08:00
parent a086f90f25
commit bb89dd6509
3 changed files with 39 additions and 36 deletions

View File

@ -14,7 +14,7 @@ FORCEINLINE constexpr T Align(T InValue, size_t Alignment)
{
static_assert(TIsIntegral<T>::Value || TIsPointer<T>::Value, "Align expects an integer or pointer type");
return (T)(((uintptr_t)(InValue) + static_cast<uintptr_t>(Alignment) - 1) & ~(static_cast<uintptr_t>(Alignment) - 1));
return (T)(((uintptr)(InValue) + static_cast<uintptr>(Alignment) - 1) & ~(static_cast<uintptr>(Alignment) - 1));
}
template <typename T>
@ -22,7 +22,7 @@ FORCEINLINE constexpr T AlignDown(T InValue, size_t Alignment)
{
static_assert(TIsIntegral<T>::Value || TIsPointer<T>::Value, "AlignDown expects an integer or pointer type");
return (T)((uintptr_t)(InValue) & ~(static_cast<uintptr_t>(Alignment) - 1));
return (T)((uintptr)(InValue) & ~(static_cast<uintptr>(Alignment) - 1));
}
template <typename T>
@ -30,7 +30,7 @@ FORCEINLINE constexpr T AlignArbitrary(T InValue, size_t Alignment)
{
static_assert(TIsIntegral<T>::Value || TIsPointer<T>::Value, "AlignArbitrary expects an integer or pointer type");
return (T)((((uintptr_t)(InValue) + static_cast<uintptr_t>(Alignment) - 1) / static_cast<uintptr_t>(Alignment)) * static_cast<uintptr_t>(Alignment));
return (T)((((uintptr)(InValue) + static_cast<uintptr>(Alignment) - 1) / static_cast<uintptr>(Alignment)) * static_cast<uintptr>(Alignment));
}
template <typename T>
@ -38,7 +38,7 @@ FORCEINLINE constexpr bool IsAligned(T InValue, size_t Alignment)
{
static_assert(TIsIntegral<T>::Value || TIsPointer<T>::Value, "IsAligned expects an integer or pointer type");
return !((uintptr_t)(InValue) & (static_cast<uintptr_t>(Alignment) - 1));
return !((uintptr)(InValue) & (static_cast<uintptr>(Alignment) - 1));
}
NAMESPACE_END(Memory)