Browse Source

Merge pull request #4300 from FearlessTobi/port-5441

Port citra-emu/citra#5441: "Common: remove a mod from AlignUp"
nce_cpp
bunnei 6 years ago
committed by GitHub
parent
commit
f5c026dd2d
  1. 4
      src/common/alignment.h

4
src/common/alignment.h

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

Loading…
Cancel
Save