Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)

See merge request ryubing/ryujinx!47
This commit is contained in:
MrKev
2025-06-11 17:58:27 -05:00
committed by LotP
parent d03ae9c164
commit ea027d65a7
309 changed files with 1018 additions and 1247 deletions

View File

@@ -50,10 +50,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
{
private const uint ValidMagic = 0x546C7373;
#pragma warning disable CS0649 // Field is never assigned to
public uint Magic;
public uint EntriesCount;
#pragma warning restore CS0649
public readonly bool IsValid()
{
@@ -63,12 +61,12 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
private struct CertStoreFileEntry
{
#pragma warning disable CS0649 // Field is never assigned to
public CaCertificateId Id;
public TrustedCertStatus Status;
public uint DataSize;
public uint DataOffset;
#pragma warning restore CS0649
}
public class CertStoreEntry

View File

@@ -21,9 +21,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
public ResultCode CreateContext(ServiceCtx context)
{
SslVersion sslVersion = (SslVersion)context.RequestData.ReadUInt32();
#pragma warning disable IDE0059 // Remove unnecessary value assignment
ulong pidPlaceholder = context.RequestData.ReadUInt64();
#pragma warning restore IDE0059
_ = context.RequestData.ReadUInt64(); // pid
MakeObject(context, new ISslContext(context.Request.HandleDesc.PId, sslVersion));

View File

@@ -47,11 +47,6 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
{
CertificateFormat certificateFormat = (CertificateFormat)context.RequestData.ReadUInt32();
#pragma warning disable IDE0059 // Remove unnecessary value assignment
ulong certificateDataPosition = context.Request.SendBuff[0].Position;
ulong certificateDataSize = context.Request.SendBuff[0].Size;
#pragma warning restore IDE0059
context.ResponseData.Write(_serverCertificateId++);
Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { certificateFormat });
@@ -63,11 +58,6 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
// ImportClientPki(buffer<bytes, 5> certificate, buffer<bytes, 5> ascii_password) -> u64 certificateId
public ResultCode ImportClientPki(ServiceCtx context)
{
#pragma warning disable IDE0059 // Remove unnecessary value assignment
ulong certificateDataPosition = context.Request.SendBuff[0].Position;
ulong certificateDataSize = context.Request.SendBuff[0].Size;
#pragma warning restore IDE0059
ulong asciiPasswordDataPosition = context.Request.SendBuff[1].Position;
ulong asciiPasswordDataSize = context.Request.SendBuff[1].Size;

View File

@@ -69,8 +69,6 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
EndSslOperation();
}
// NOTE: We silence warnings about TLS 1.0 and 1.1 as games will likely use it.
#pragma warning disable SYSLIB0039
private SslProtocols TranslateSslVersion(SslVersion version)
{
return (version & SslVersion.VersionMask) switch
@@ -83,7 +81,6 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
_ => throw new NotImplementedException(version.ToString()),
};
}
#pragma warning restore SYSLIB0039
/// <summary>
/// Retrieve the hostname of the current remote in case the provided hostname is null or empty.