diff options
| author | 2020-07-11 19:28:09 -0400 | |
|---|---|---|
| committer | 2020-07-11 19:28:09 -0400 | |
| commit | 1074c87f18881ba8e6c20c1cee10ec3cbba71adb (patch) | |
| tree | f786a1f9e252b89d04664725c8b30d0c33aaa5e3 /src | |
| parent | Merge pull request #4300 from FearlessTobi/port-5441 (diff) | |
| download | yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.gz yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.xz yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.zip | |
Revert "Port citra-emu/citra#5441: "Common: remove a mod from AlignUp""
Diffstat (limited to '')
| -rw-r--r-- | src/common/alignment.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h index 516bb26c1..f8c49e079 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h | |||
| @@ -11,9 +11,7 @@ namespace Common { | |||
| 11 | template <typename T> | 11 | template <typename T> |
| 12 | constexpr T AlignUp(T value, std::size_t size) { | 12 | constexpr T AlignUp(T value, std::size_t size) { |
| 13 | static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); | 13 | static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); |
| 14 | auto mod{value % size}; | 14 | return static_cast<T>(value + (size - value % size) % size); |
| 15 | value -= mod; | ||
| 16 | return static_cast<T>(mod == T{0} ? value : value + size); | ||
| 17 | } | 15 | } |
| 18 | 16 | ||
| 19 | template <typename T> | 17 | template <typename T> |