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

@@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Applets
{
#pragma warning disable CS0649 // Field is never assigned to
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ControllerSupportArgHeader
{
@@ -14,5 +14,4 @@ namespace Ryujinx.HLE.HOS.Applets
public byte EnableSingleMode;
public byte EnableIdentificationColor;
}
#pragma warning restore CS0649
}

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.HLE.HOS.Applets
{
#pragma warning disable CS0649 // Field is never assigned to
struct ControllerSupportArgPrivate
{
public uint PrivateSize;
@@ -12,5 +12,4 @@ namespace Ryujinx.HLE.HOS.Applets
public uint NpadStyleSet;
public uint NpadJoyHoldType;
}
#pragma warning restore CS0649
}

View File

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Applets
{
#pragma warning disable CS0649 // Field is never assigned to
// (8.0.0+ version)
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ControllerSupportArgV7
@@ -22,5 +22,4 @@ namespace Ryujinx.HLE.HOS.Applets
public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref element, 8 * 0x81);
}
}
#pragma warning restore CS0649
}

View File

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Applets
{
#pragma warning disable CS0649 // Field is never assigned to
// (1.0.0+ version)
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ControllerSupportArgVPre7
@@ -22,5 +22,4 @@ namespace Ryujinx.HLE.HOS.Applets
public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref element, 4 * 0x81);
}
}
#pragma warning restore CS0649
}

View File

@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Applets
{
#pragma warning disable CS0649 // Field is never assigned to
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ControllerSupportResultInfo
{
@@ -12,5 +12,4 @@ namespace Ryujinx.HLE.HOS.Applets
public uint SelectedId;
public uint Result;
}
#pragma warning restore CS0649
}

View File

@@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
{
return systemLanguage switch
{
#pragma warning disable IDE0055 // Disable formatting
#pragma warning disable IDE0055 // Disable formatting
SystemLanguage.Japanese => "ja",
SystemLanguage.AmericanEnglish => "en-US",
SystemLanguage.French => "fr",

View File

@@ -12,9 +12,8 @@ namespace Ryujinx.HLE.HOS.Applets
private readonly Horizon _system;
private AppletSession _normalSession;
#pragma warning disable IDE0052 // Remove unread private member
private AppletSession _interactiveSession;
#pragma warning restore IDE0052
public event EventHandler AppletStateChanged;

View File

@@ -43,11 +43,11 @@ namespace Ryujinx.HLE.HOS.Applets
private SoftwareKeyboardConfig _keyboardForegroundConfig;
// Configuration for background (inline) mode.
#pragma warning disable IDE0052 // Remove unread private member
private SoftwareKeyboardInitialize _keyboardBackgroundInitialize;
private SoftwareKeyboardCustomizeDic _keyboardBackgroundDic;
private SoftwareKeyboardDictSet _keyboardBackgroundDictSet;
#pragma warning restore IDE0052
private SoftwareKeyboardUserWord[] _keyboardBackgroundUserWords;
private byte[] _transferMemory;