2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Revert "Port citra-emu/citra#5441: "Common: remove a mod from AlignUp""

This commit is contained in:
bunnei 2020-07-11 19:28:09 -04:00 committed by GitHub
parent 7a051c4973
commit 1074c87f18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,9 +11,7 @@ namespace Common {
template <typename T> template <typename T>
constexpr T AlignUp(T value, std::size_t size) { constexpr T AlignUp(T value, std::size_t size) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
auto mod{value % size}; return static_cast<T>(value + (size - value % size) % size);
value -= mod;
return static_cast<T>(mod == T{0} ? value : value + size);
} }
template <typename T> template <typename T>