mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
common/alignment: Address feedback
This commit is contained in:
parent
d1812316e1
commit
de982deb25
1 changed files with 3 additions and 2 deletions
|
@ -20,8 +20,9 @@ constexpr T AlignDown(T value, std::size_t size) {
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr T AlignBits(T value, T align) {
|
||||
return (value + ((1 << align) - 1)) >> align << align;
|
||||
constexpr T AlignBits(T value, std::size_t align) {
|
||||
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
|
||||
return static_cast<T>((value + ((1ULL << align) - 1)) >> align << align);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
|
Loading…
Reference in a new issue