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;
|
break;
|
||||||
case CRAM_CIGAM:
|
case CRAM_CIGAM:
|
||||||
crSb = Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sector);
|
crSb = Marshal.ByteArrayToStructureBigEndianGenerated<SuperBlock>(sector);
|
||||||
littleEndian = false;
|
littleEndian = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using Aaru.CommonTypes.Attributes;
|
||||||
|
|
||||||
namespace Aaru.Filesystems;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
@@ -41,20 +42,21 @@ public sealed partial class Cram
|
|||||||
#region Nested type: SuperBlock
|
#region Nested type: SuperBlock
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
readonly struct SuperBlock
|
[SwapEndian]
|
||||||
|
partial struct SuperBlock
|
||||||
{
|
{
|
||||||
public readonly uint magic;
|
public uint magic;
|
||||||
public readonly uint size;
|
public uint size;
|
||||||
public readonly uint flags;
|
public uint flags;
|
||||||
public readonly uint future;
|
public uint future;
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||||
public readonly byte[] signature;
|
public byte[] signature;
|
||||||
public readonly uint crc;
|
public uint crc;
|
||||||
public readonly uint edition;
|
public uint edition;
|
||||||
public readonly uint blocks;
|
public uint blocks;
|
||||||
public readonly uint files;
|
public uint files;
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||||
public readonly byte[] name;
|
public byte[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user