aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
authorZoltan Csizmadia <zcsizmadia@gmail.com>2023-11-15 10:41:31 -0600
committerGitHub <noreply@github.com>2023-11-15 17:41:31 +0100
commit29e192f241136ce910071ff4fdedda5bd1d9b838 (patch)
tree4d729880c4e4a7693d9d6255490642771ed2ef09 /src/Ryujinx.HLE/HOS/Services
parent5b3662b793b3a34acc12c45c3c1691b7302d4b1d (diff)
Migrate to .NET 8 (#5887)
* Change TargetFramework to net8.0 * Disable info messages * Fix warings * Disable additional analyzer messages * Fix typo * Add whitespace * Fix ref vs in warnings * Use explicit [In] on array parameters * No need to guard Remove with Contains * Use 'ArgumentOutOfRangeException.ThrowIf...' instead of explicitly throwing a new exception instance * Bump .NET SDK version * Enable JsonSerializerIsReflectionEnabledByDefault * Use 8.0.100 GA release * Bump System package versions --------- Co-authored-by: Zoltan Csizmadia <Zoltan.Csizmadia@vericast.com>
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs5
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdMsgHdr.cs12
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs2
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfoSerialized.cs6
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs4
5 files changed, 13 insertions, 16 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs b/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs
index 9c6d025e..b83c642e 100644
--- a/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs
@@ -85,10 +85,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
public void SetSyncpointMinEqualSyncpointMax(uint id)
{
- if (id >= SynchronizationManager.MaxHardwareSyncpoints)
- {
- throw new ArgumentOutOfRangeException(nameof(id));
- }
+ ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(id, (uint)SynchronizationManager.MaxHardwareSyncpoints);
int value = (int)ReadSyncpointValue(id);
diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdMsgHdr.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdMsgHdr.cs
index 07c97182..62a7ccb5 100644
--- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdMsgHdr.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdMsgHdr.cs
@@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
int controlLength = message.Control == null ? 0 : message.Control.Length;
BsdSocketFlags flags = message.Flags;
- if (!MemoryMarshal.TryWrite(rawData, ref msgNameLength))
+ if (!MemoryMarshal.TryWrite(rawData, in msgNameLength))
{
return LinuxError.EFAULT;
}
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
rawData = rawData[msgNameLength..];
}
- if (!MemoryMarshal.TryWrite(rawData, ref iovCount))
+ if (!MemoryMarshal.TryWrite(rawData, in iovCount))
{
return LinuxError.EFAULT;
}
@@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
{
ulong iovLength = (ulong)message.Iov[index].Length;
- if (!MemoryMarshal.TryWrite(rawData, ref iovLength))
+ if (!MemoryMarshal.TryWrite(rawData, in iovLength))
{
return LinuxError.EFAULT;
}
@@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
}
}
- if (!MemoryMarshal.TryWrite(rawData, ref controlLength))
+ if (!MemoryMarshal.TryWrite(rawData, in controlLength))
{
return LinuxError.EFAULT;
}
@@ -96,14 +96,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
rawData = rawData[controlLength..];
}
- if (!MemoryMarshal.TryWrite(rawData, ref flags))
+ if (!MemoryMarshal.TryWrite(rawData, in flags))
{
return LinuxError.EFAULT;
}
rawData = rawData[sizeof(BsdSocketFlags)..];
- if (!MemoryMarshal.TryWrite(rawData, ref message.Length))
+ if (!MemoryMarshal.TryWrite(rawData, in message.Length))
{
return LinuxError.EFAULT;
}
diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
index d0fb6675..39af9038 100644
--- a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
@@ -654,7 +654,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
}
uint sentinel = 0;
- MemoryMarshal.Write(data, ref sentinel);
+ MemoryMarshal.Write(data, in sentinel);
data = data[sizeof(uint)..];
return region.Memory.Span.Length - data.Length;
diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfoSerialized.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfoSerialized.cs
index a0613d7b..b57b0d5c 100644
--- a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfoSerialized.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfoSerialized.cs
@@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
Header.ToNetworkOrder();
- MemoryMarshal.Write(buffer, ref Header);
+ MemoryMarshal.Write(buffer, in Header);
buffer = buffer[Unsafe.SizeOf<AddrInfoSerializedHeader>()..];
@@ -103,7 +103,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
AddrInfo4 socketAddress = SocketAddress.Value;
socketAddress.ToNetworkOrder();
- MemoryMarshal.Write(buffer, ref socketAddress);
+ MemoryMarshal.Write(buffer, in socketAddress);
buffer = buffer[Unsafe.SizeOf<AddrInfo4>()..];
}
@@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
Array4<byte> rawIPv4Address = RawIPv4Address.Value;
AddrInfo4.RawIpv4AddressNetworkEndianSwap(ref rawIPv4Address);
- MemoryMarshal.Write(buffer, ref rawIPv4Address);
+ MemoryMarshal.Write(buffer, in rawIPv4Address);
buffer = buffer[Unsafe.SizeOf<Array4<byte>>()..];
}
diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
index dab099aa..e3c05df5 100644
--- a/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
@@ -161,7 +161,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
}
else
{
- throw exception;
+ throw;
}
}
finally
@@ -206,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
}
else
{
- throw exception;
+ throw;
}
}
finally