mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-09 06:45:46 +00:00
Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)
See merge request ryubing/ryujinx!47
This commit is contained in:
@@ -233,6 +233,8 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
// Remove this pragma warning when the methods are implemented
|
||||
#pragma warning disable CA1822 // Mark members as static
|
||||
[CmifCommand(15)] // 17.0.0+
|
||||
public Result AcquireAudioOutputDeviceNotification([CopyHandle] out int eventHandle, ulong deviceId)
|
||||
{
|
||||
@@ -274,6 +276,7 @@ namespace Ryujinx.Horizon.Sdk.Audio.Detail
|
||||
|
||||
return AudioResult.NotImplemented;
|
||||
}
|
||||
#pragma warning restore CA1822 // Mark members as static
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Ryujinx.Horizon.Sdk.Codec.Detail
|
||||
OpusCodecFactory.AttemptToUseNativeLibrary = false;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
private struct OpusPacketHeader
|
||||
{
|
||||
public uint Length;
|
||||
|
||||
@@ -4,12 +4,12 @@ namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
struct AccountNotificationSettings
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
public Uid UserId;
|
||||
public uint Flags;
|
||||
public byte FriendPresenceOverlayPermission;
|
||||
public byte FriendInvitationOverlayPermission;
|
||||
public ushort Reserved;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
struct BluetoothDevicesSettings
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
public Array6<byte> BdAddr;
|
||||
public Array32<byte> DeviceName;
|
||||
public Array3<byte> ClassOfDevice;
|
||||
@@ -24,6 +24,6 @@ namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
public Array9<byte> Brr;
|
||||
public Array256<byte> Reserved;
|
||||
public Array43<byte> Reserved2;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
|
||||
struct NotificationTime
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
public uint Hour;
|
||||
public uint Minute;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x18, Pack = 0x4)]
|
||||
|
||||
@@ -2,11 +2,11 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
{
|
||||
struct CmifDomainOutHeader
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
public uint ObjectsCount;
|
||||
public uint Padding;
|
||||
public uint Padding2;
|
||||
public uint Padding3;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
{
|
||||
struct CmifOutHeader
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
public uint Magic;
|
||||
public uint Version;
|
||||
public Result Result;
|
||||
public uint Token;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
{
|
||||
struct CmifRequestFormat
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int ObjectId;
|
||||
public uint RequestId;
|
||||
public uint Context;
|
||||
@@ -19,6 +18,5 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
public int ObjectsCount;
|
||||
public int HandlesCount;
|
||||
public bool SendPid;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
{
|
||||
readonly struct HipcBufferDescriptor
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
|
||||
private readonly uint _sizeLow;
|
||||
private readonly uint _addressLow;
|
||||
private readonly uint _word2;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
public ulong Address => _addressLow | (((ulong)_word2 << 4) & 0xf00000000UL) | (((ulong)_word2 << 34) & 0x7000000000UL);
|
||||
public ulong Size => _sizeLow | ((ulong)_word2 << 8) & 0xf00000000UL;
|
||||
|
||||
@@ -2,10 +2,9 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
{
|
||||
readonly struct HipcReceiveListEntry
|
||||
{
|
||||
#pragma warning disable IDE0052 // Remove unread private member
|
||||
|
||||
private readonly uint _addressLow;
|
||||
private readonly uint _word1;
|
||||
#pragma warning restore IDE0052
|
||||
|
||||
public HipcReceiveListEntry(ulong address, ulong size)
|
||||
{
|
||||
|
||||
@@ -16,6 +16,6 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
public static Result InvalidCmifRequest => new(ModuleId, 420);
|
||||
public static Result TargetNotDomain => new(ModuleId, 491);
|
||||
public static Result DomainObjectNotFound => new(ModuleId, 492);
|
||||
#pragma warning restore IDE0055
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user