mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Cram] Use new source generator based big endian marshaller
This commit is contained in:
@@ -83,7 +83,7 @@ public sealed partial class Cram
|
||||
|
||||
break;
|
||||
case CRAM_CIGAM:
|
||||
crSb = Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sector);
|
||||
crSb = Marshal.ByteArrayToStructureBigEndianGenerated<SuperBlock>(sector);
|
||||
littleEndian = false;
|
||||
|
||||
break;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using Aaru.CommonTypes.Attributes;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
@@ -41,20 +42,21 @@ public sealed partial class Cram
|
||||
#region Nested type: SuperBlock
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct SuperBlock
|
||||
[SwapEndian]
|
||||
partial struct SuperBlock
|
||||
{
|
||||
public readonly uint magic;
|
||||
public readonly uint size;
|
||||
public readonly uint flags;
|
||||
public readonly uint future;
|
||||
public uint magic;
|
||||
public uint size;
|
||||
public uint flags;
|
||||
public uint future;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public readonly byte[] signature;
|
||||
public readonly uint crc;
|
||||
public readonly uint edition;
|
||||
public readonly uint blocks;
|
||||
public readonly uint files;
|
||||
public byte[] signature;
|
||||
public uint crc;
|
||||
public uint edition;
|
||||
public uint blocks;
|
||||
public uint files;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public readonly byte[] name;
|
||||
public byte[] name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user