From f48df486e20255cbb78ef8af78ba1ea7361c6eb2 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Fri, 20 Sep 2019 06:41:57 +0200 Subject: [PATCH] Remove IntUtils and use BitUtils instead. (#774) --- .../Nv/NvDrvServices/NvMap/NvMapIoctl.cs | 6 ++--- Ryujinx.HLE/Utilities/IntUtils.cs | 25 ------------------- 2 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 Ryujinx.HLE/Utilities/IntUtils.cs diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapIoctl.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapIoctl.cs index 0b5be6e8a4..e46da4fde3 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapIoctl.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapIoctl.cs @@ -1,8 +1,8 @@ using ARMeilleure.Memory; +using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.Graphics.Memory; using Ryujinx.HLE.HOS.Kernel.Process; -using Ryujinx.HLE.Utilities; using System.Collections.Concurrent; namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap @@ -49,7 +49,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap return NvResult.InvalidInput; } - int size = IntUtils.AlignUp(args.Size, NvGpuVmm.PageSize); + int size = BitUtils.AlignUp(args.Size, NvGpuVmm.PageSize); args.Handle = AddNvMap(context, new NvMapHandle(size)); @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap map.Align = args.Align; map.Kind = (byte)args.Kind; - int size = IntUtils.AlignUp(map.Size, NvGpuVmm.PageSize); + int size = BitUtils.AlignUp(map.Size, NvGpuVmm.PageSize); long address = args.Address; diff --git a/Ryujinx.HLE/Utilities/IntUtils.cs b/Ryujinx.HLE/Utilities/IntUtils.cs deleted file mode 100644 index a7178d80cb..0000000000 --- a/Ryujinx.HLE/Utilities/IntUtils.cs +++ /dev/null @@ -1,25 +0,0 @@ -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); - } - } -}