chore: applets: Cleanup redundant ReadStruct implementations & provide a default implementation for IApplet#GetResult.

This commit is contained in:
Evan Husted
2024-12-04 02:24:40 -06:00
parent 08b7257be5
commit 07690e4527
10 changed files with 7 additions and 53 deletions

View File

@@ -125,19 +125,6 @@ namespace Ryujinx.HLE.HOS.Applets.Cabinet
return bytes;
}
public static T ReadStruct<T>(byte[] data) where T : unmanaged
{
if (data.Length < Unsafe.SizeOf<T>())
{
throw new ArgumentException("Not enough data to read the struct");
}
fixed (byte* dataPtr = data)
{
return Unsafe.Read<T>(dataPtr);
}
}
#region Structs
[StructLayout(LayoutKind.Sequential, Pack = 1)]