aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs2
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs2
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs4
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationInfo.cs2
-rw-r--r--Ryujinx.HLE/HOS/ModLoader.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs31
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs2
-rw-r--r--Ryujinx.HLE/HOS/Tamper/OperationBlock.cs2
-rw-r--r--Ryujinx.HLE/Ui/ThemeColor.cs2
9 files changed, 12 insertions, 37 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs b/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs
index 1949df31..9829ae03 100644
--- a/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Common/KernelInit.cs
@@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
{
static class KernelInit
{
- private struct MemoryRegion
+ private readonly struct MemoryRegion
{
public ulong Address { get; }
public ulong Size { get; }
diff --git a/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs b/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs
index 098d83d1..d805a4e1 100644
--- a/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs
@@ -2,7 +2,7 @@
namespace Ryujinx.HLE.HOS.Kernel.Common
{
- struct OnScopeExit : IDisposable
+ readonly struct OnScopeExit : IDisposable
{
private readonly Action _action;
public OnScopeExit(Action action) => _action = action;
diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs
index e28677ff..dc5ad717 100644
--- a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs
@@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
(MemoryState)0xfffce5d4 //This is invalid, shouldn't be accessed.
};
- private struct Message
+ private readonly struct Message
{
public ulong Address { get; }
public ulong Size { get; }
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
request.CustomCmdBuffSize) { }
}
- private struct MessageHeader
+ private readonly struct MessageHeader
{
public uint Word0 { get; }
public uint Word1 { get; }
diff --git a/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationInfo.cs b/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationInfo.cs
index 26c23b3b..c05bb574 100644
--- a/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationInfo.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationInfo.cs
@@ -1,6 +1,6 @@
namespace Ryujinx.HLE.HOS.Kernel.Process
{
- struct ProcessCreationInfo
+ readonly struct ProcessCreationInfo
{
public string Name { get; }
diff --git a/Ryujinx.HLE/HOS/ModLoader.cs b/Ryujinx.HLE/HOS/ModLoader.cs
index c24f0f74..3b269517 100644
--- a/Ryujinx.HLE/HOS/ModLoader.cs
+++ b/Ryujinx.HLE/HOS/ModLoader.cs
@@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS
private const string AmsNroPatchDir = "nro_patches";
private const string AmsKipPatchDir = "kip_patches";
- public struct Mod<T> where T : FileSystemInfo
+ public readonly struct Mod<T> where T : FileSystemInfo
{
public readonly string Name;
public readonly T Path;
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs
index 8cf4bff1..1793067d 100644
--- a/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs
+++ b/Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
[StructLayout(LayoutKind.Sequential)]
- public struct UserId : IEquatable<UserId>
+ public readonly record struct UserId
{
public readonly long High;
public readonly long Low;
@@ -50,37 +50,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return High.ToString("x16") + Low.ToString("x16");
}
- public static bool operator ==(UserId x, UserId y)
- {
- return x.Equals(y);
- }
-
- public static bool operator !=(UserId x, UserId y)
- {
- return !x.Equals(y);
- }
-
- public override bool Equals(object obj)
- {
- return obj is UserId userId && Equals(userId);
- }
-
- public bool Equals(UserId cmpObj)
- {
- return Low == cmpObj.Low && High == cmpObj.High;
- }
-
- public override int GetHashCode()
- {
- return HashCode.Combine(Low, High);
- }
-
- public readonly Uid ToLibHacUid()
+ public Uid ToLibHacUid()
{
return new Uid((ulong)High, (ulong)Low);
}
- public readonly UInt128 ToUInt128()
+ public UInt128 ToUInt128()
{
return new UInt128((ulong)High, (ulong)Low);
}
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
index a1ad1c94..0e0fe7f2 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
@@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
private const ulong SmallRegionLimit = 0x400000000UL; // 16 GiB
private const ulong DefaultUserSize = 1UL << 37;
- private struct VmRegion
+ private readonly struct VmRegion
{
public ulong Start { get; }
public ulong Limit { get; }
diff --git a/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs b/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs
index db439946..c16c2812 100644
--- a/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs
+++ b/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Tamper
{
- struct OperationBlock
+ readonly struct OperationBlock
{
public byte[] BaseInstruction { get; }
public List<IOperation> Operations { get; }
diff --git a/Ryujinx.HLE/Ui/ThemeColor.cs b/Ryujinx.HLE/Ui/ThemeColor.cs
index 1a42b167..c594c370 100644
--- a/Ryujinx.HLE/Ui/ThemeColor.cs
+++ b/Ryujinx.HLE/Ui/ThemeColor.cs
@@ -1,6 +1,6 @@
namespace Ryujinx.HLE.Ui
{
- public struct ThemeColor
+ public readonly struct ThemeColor
{
public float A { get; }
public float R { get; }