mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-27 01:22:02 +00:00
25 lines
596 B
C#
25 lines
596 B
C#
namespace Ryujinx.HLE.Utilities
|
|
{
|
|
internal 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);
|
|
}
|
|
}
|
|
}
|