Correct type of executable sizes (#1802)

This commit is contained in:
gdkchan
2020-12-13 04:30:27 -03:00
committed by GitHub
parent ef157bbe26
commit 19d18662ea
9 changed files with 95 additions and 77 deletions

View File

@ -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;