mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-03 01:36:25 +02:00
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>
This commit is contained in:
parent
5b3662b793
commit
29e192f241
57 changed files with 121 additions and 123 deletions
|
@ -35,8 +35,6 @@ namespace Ryujinx.HLE.Exceptions
|
|||
Request = context.Request;
|
||||
}
|
||||
|
||||
protected ServiceNotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
|
|
|
@ -420,10 +420,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
|
||||
if (locationList != null)
|
||||
{
|
||||
if (locationList.Contains(entry))
|
||||
{
|
||||
locationList.Remove(entry);
|
||||
}
|
||||
locationList.Remove(entry);
|
||||
|
||||
locationList.AddLast(entry);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>>()..];
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue