diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-12-13 04:30:27 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 08:30:27 +0100 |
commit | 19d18662ea3ed5470898ed2b7bbb06d45f6004dd (patch) | |
tree | 21ceeba0aee0fca1729ced4cf7c86bd9c7ff7ad2 /Ryujinx.Common/Utilities/BitUtils.cs | |
parent | ef157bbe263e60b2e9c3259e5aee20a297c5f5bc (diff) |
Correct type of executable sizes (#1802)
Diffstat (limited to 'Ryujinx.Common/Utilities/BitUtils.cs')
-rw-r--r-- | Ryujinx.Common/Utilities/BitUtils.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Common/Utilities/BitUtils.cs b/Ryujinx.Common/Utilities/BitUtils.cs index 5f70f742..4ce7da6b 100644 --- a/Ryujinx.Common/Utilities/BitUtils.cs +++ b/Ryujinx.Common/Utilities/BitUtils.cs @@ -4,6 +4,11 @@ namespace Ryujinx.Common { private static readonly byte[] ClzNibbleTbl = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }; + public static uint AlignUp(uint value, int size) + { + return (uint)AlignUp((int)value, size); + } + public static int AlignUp(int value, int size) { return (value + (size - 1)) & -size; @@ -19,6 +24,11 @@ namespace Ryujinx.Common return (value + (size - 1)) & -(long)size; } + public static uint AlignDown(uint value, int size) + { + return (uint)AlignDown((int)value, size); + } + public static int AlignDown(int value, int size) { return value & -size; |