From 9ab63341449c22a9348043640ddace012339e9e3 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sat, 1 Dec 2018 14:49:36 -0600 Subject: [PATCH] Remove unneeded casts --- Ryujinx.HLE/DeviceMemory.cs | 4 ++-- Ryujinx.HLE/HOS/Horizon.cs | 2 +- Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs | 2 +- Ryujinx.HLE/HOS/Kernel/KHandleTable.cs | 2 +- Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Ryujinx.HLE/DeviceMemory.cs b/Ryujinx.HLE/DeviceMemory.cs index abf79f05e0..e5726fc8c2 100644 --- a/Ryujinx.HLE/DeviceMemory.cs +++ b/Ryujinx.HLE/DeviceMemory.cs @@ -40,7 +40,7 @@ namespace Ryujinx.HLE public unsafe byte ReadByte(long position) { - return *((byte*)(_ramPtr + position)); + return *(_ramPtr + position); } public unsafe ushort ReadUInt16(long position) @@ -80,7 +80,7 @@ namespace Ryujinx.HLE public unsafe void WriteByte(long position, byte value) { - *((byte*)(_ramPtr + position)) = value; + *(_ramPtr + position) = value; } public unsafe void WriteUInt16(long position, ushort value) diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 0160c1672a..a5ea535471 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -502,7 +502,7 @@ namespace Ryujinx.HLE.HOS { IExecutable staticObject = isNro ? (IExecutable)new NxRelocatableObject(input) - : (IExecutable)new NxStaticObject(input); + : new NxStaticObject(input); ProgramLoader.LoadStaticObjects(this, metaData, new IExecutable[] { staticObject }); } diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs index 856329c09d..0b99f5ee2e 100644 --- a/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs +++ b/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs @@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Ipc if (HasPId) { - writer.Write((long)PId); + writer.Write(PId); } foreach (int handle in ToCopy) diff --git a/Ryujinx.HLE/HOS/Kernel/KHandleTable.cs b/Ryujinx.HLE/HOS/Kernel/KHandleTable.cs index d808fba3da..86ecea2628 100644 --- a/Ryujinx.HLE/HOS/Kernel/KHandleTable.cs +++ b/Ryujinx.HLE/HOS/Kernel/KHandleTable.cs @@ -83,7 +83,7 @@ namespace Ryujinx.HLE.HOS.Kernel _activeSlotsCount++; - handle = (int)((_idCounter << 15) & (uint)0xffff8000) | entry.Index; + handle = (int)((_idCounter << 15) & 0xffff8000) | entry.Index; if ((short)(_idCounter + 1) >= 0) { diff --git a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs index 5674eed5dc..d497acaa3d 100644 --- a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs @@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Pl { int offset = (int)type * 4; - if (!AddFontToOrderOfPriorityList(context, (SharedFontType)type, offset)) + if (!AddFontToOrderOfPriorityList(context, type, offset)) { break; }