[Squash] Use new source generator based big endian marshaller

This commit is contained in:
2025-10-21 10:52:51 +01:00
parent 6d3e8515f9
commit ebc971a02a
2 changed files with 23 additions and 21 deletions

View File

@@ -78,7 +78,7 @@ public sealed partial class Squash
break;
case SQUASH_CIGAM:
sqSb = Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sector);
sqSb = Marshal.ByteArrayToStructureBigEndianGenerated<SuperBlock>(sector);
littleEndian = false;
break;

View File

@@ -27,6 +27,7 @@
// ****************************************************************************/
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Attributes;
namespace Aaru.Filesystems;
@@ -37,27 +38,28 @@ public sealed partial class Squash
#region Nested type: SuperBlock
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SuperBlock
[SwapEndian]
partial struct SuperBlock
{
public readonly uint magic;
public readonly uint inodes;
public readonly uint mkfs_time;
public readonly uint block_size;
public readonly uint fragments;
public readonly ushort compression;
public readonly ushort block_log;
public readonly ushort flags;
public readonly ushort no_ids;
public readonly ushort s_major;
public readonly ushort s_minor;
public readonly ulong root_inode;
public readonly ulong bytes_used;
public readonly ulong id_table_start;
public readonly ulong xattr_id_table_start;
public readonly ulong inode_table_start;
public readonly ulong directory_table_start;
public readonly ulong fragment_table_start;
public readonly ulong lookup_table_start;
public uint magic;
public uint inodes;
public uint mkfs_time;
public uint block_size;
public uint fragments;
public ushort compression;
public ushort block_log;
public ushort flags;
public ushort no_ids;
public ushort s_major;
public ushort s_minor;
public ulong root_inode;
public ulong bytes_used;
public ulong id_table_start;
public ulong xattr_id_table_start;
public ulong inode_table_start;
public ulong directory_table_start;
public ulong fragment_table_start;
public ulong lookup_table_start;
}
#endregion