Ryujinx/Ryujinx.HLE/Utilities/IntUtils.cs
2018-12-01 14:03:56 -06:00

25 lines
587 B
C#

namespace Ryujinx.HLE.Utilities
{
static class IntUtils
{
public static int AlignUp(int value, int size)
{
return (value + (size - 1)) & ~(size - 1);
}
public static long AlignUp(long value, int size)
{
return (value + (size - 1)) & ~((long)size - 1);
}
public static int AlignDown(int value, int size)
{
return value & ~(size - 1);
}
public static long AlignDown(long value, int size)
{
return value & ~((long)size - 1);
}
}
}