Fix TODOs and code cleanup.

This commit is contained in:
2019-07-31 19:53:47 +01:00
parent 62e14f275e
commit c51847b734
11 changed files with 143 additions and 150 deletions

View File

@@ -39,10 +39,10 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct AmigaEntry
{
public ushort signature;
public byte length;
public byte version;
public AmigaFlags flags;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly AmigaFlags flags;
// Followed by AmigaProtection if present
// Followed by length-prefixed string for comment if present
}
@@ -50,10 +50,10 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct AmigaProtection
{
public byte User;
public byte Reserved;
public AmigaMultiuser Multiuser;
public AmigaAttributes Protection;
public readonly byte User;
public readonly byte Reserved;
public readonly AmigaMultiuser Multiuser;
public readonly AmigaAttributes Protection;
}
}
}

View File

@@ -39,77 +39,77 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoBootRecord
{
public byte type;
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] id;
public byte version;
public readonly byte[] id;
public readonly byte version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] system_id;
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] boot_id;
public uint catalog_sector;
public readonly byte[] boot_id;
public readonly uint catalog_sector;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1974)]
public byte[] boot_use;
public readonly byte[] boot_use;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoValidationEntry
{
public ElToritoIndicator header_id;
public ElToritoPlatform platform_id;
public ushort reserved;
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public byte[] developer_id;
public ushort checksum;
public ushort signature;
public readonly byte[] developer_id;
public readonly ushort checksum;
public readonly ushort signature;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoInitialEntry
{
public ElToritoIndicator bootable;
public ElToritoEmulation boot_type;
public ushort load_seg;
public byte system_type;
public byte reserved1;
public ushort sector_count;
public uint load_rba;
public readonly ElToritoIndicator bootable;
public ElToritoEmulation boot_type;
public readonly ushort load_seg;
public readonly byte system_type;
public readonly byte reserved1;
public readonly ushort sector_count;
public readonly uint load_rba;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] reserved2;
public readonly byte[] reserved2;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionHeaderEntry
{
public ElToritoIndicator header_id;
public ElToritoPlatform platform_id;
public ushort entries;
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort entries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public byte[] identifier;
public readonly byte[] identifier;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionEntry
{
public ElToritoIndicator bootable;
public ElToritoEmulation boot_type;
public ushort load_seg;
public byte system_type;
public byte reserved1;
public ushort sector_count;
public uint load_rba;
public byte selection_criteria_type;
public readonly ElToritoIndicator bootable;
public readonly ElToritoEmulation boot_type;
public readonly ushort load_seg;
public readonly byte system_type;
public readonly byte reserved1;
public readonly ushort sector_count;
public readonly uint load_rba;
public readonly byte selection_criteria_type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
public byte[] selection_criterias;
public readonly byte[] selection_criterias;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionEntryExtension
{
public ElToritoIndicator extension_indicator;
public ElToritoFlags extension_flags;
public readonly ElToritoIndicator extension_indicator;
public readonly ElToritoFlags extension_flags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
public byte[] selection_criterias;
public readonly byte[] selection_criterias;
}
}
}

View File

@@ -39,53 +39,53 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ContinuationArea
{
public ushort signature;
public byte length;
public byte version;
public uint block;
public uint block_be;
public uint offset;
public uint offset_be;
public uint ca_length;
public uint ca_length_be;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint block;
public readonly uint block_be;
public readonly uint offset;
public readonly uint offset_be;
public readonly uint ca_length;
public readonly uint ca_length_be;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct PaddingArea
{
public ushort signature;
public byte length;
public byte version;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct IndicatorArea
{
public ushort signature;
public byte length;
public byte version;
public ushort magic;
public byte skipped;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly ushort magic;
public readonly byte skipped;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct TerminatorArea
{
public ushort signature;
public byte length;
public byte version;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ReferenceArea
{
public ushort signature;
public byte length;
public byte version;
public byte id_len;
public byte des_len;
public byte src_len;
public byte ext_ver;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly byte id_len;
public readonly byte des_len;
public readonly byte src_len;
public readonly byte ext_ver;
// Follows extension identifier for id_len bytes
// Follows extension descriptor for des_len bytes
// Follows extension source for src_len bytes
@@ -94,10 +94,10 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct SelectorArea
{
public ushort signature;
public byte length;
public byte version;
public byte sequence;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly byte sequence;
}
}
}

View File

@@ -40,13 +40,13 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct CdromXa
{
public XaAttributes attributes;
public byte filenumber;
public ushort group;
public readonly XaAttributes attributes;
public readonly byte filenumber;
public readonly ushort group;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] reserved;
public ushort signature;
public ushort user;
public readonly byte[] reserved;
public readonly ushort signature;
public readonly ushort user;
}
}
}

View File

@@ -39,24 +39,24 @@ namespace DiscImageChef.Filesystems.ISO9660
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ZisofsHeader
{
public ulong magic;
public uint uncomp_len;
public uint uncomp_len_be;
public byte header_size; // Shifted >> 2
public byte block_size_log; // log2(block_size)
public readonly ulong magic;
public readonly uint uncomp_len;
public readonly uint uncomp_len_be;
public readonly byte header_size; // Shifted >> 2
public readonly byte block_size_log; // log2(block_size)
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ZisofsEntry
{
public ushort signature;
public byte length;
public byte version;
public ushort alogirhtm;
public byte header_size; // Shifted >> 2
public byte block_size_log; // log2(block_size)
public uint uncomp_len;
public uint uncomp_len_be;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly ushort alogirhtm;
public readonly byte header_size; // Shifted >> 2
public readonly byte block_size_log; // log2(block_size)
public readonly uint uncomp_len;
public readonly uint uncomp_len_be;
}
}
}