mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[DART] Use new source generator based big endian marshaller
This commit is contained in:
@@ -51,7 +51,7 @@ public sealed partial class Dart
|
||||
var headerB = new byte[Marshal.SizeOf<Header>()];
|
||||
|
||||
stream.EnsureRead(headerB, 0, Marshal.SizeOf<Header>());
|
||||
Header header = Marshal.ByteArrayToStructureBigEndian<Header>(headerB);
|
||||
Header header = Marshal.ByteArrayToStructureBigEndianGenerated<Header>(headerB);
|
||||
|
||||
if(header.srcCmp > COMPRESS_NONE) return false;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public sealed partial class Dart
|
||||
var headerB = new byte[Marshal.SizeOf<Header>()];
|
||||
|
||||
stream.EnsureRead(headerB, 0, Marshal.SizeOf<Header>());
|
||||
Header header = Marshal.ByteArrayToStructureBigEndian<Header>(headerB);
|
||||
Header header = Marshal.ByteArrayToStructureBigEndianGenerated<Header>(headerB);
|
||||
|
||||
if(header.srcCmp > COMPRESS_NONE) return ErrorNumber.NotSupported;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using Aaru.CommonTypes.Attributes;
|
||||
|
||||
namespace Aaru.Images;
|
||||
|
||||
@@ -39,11 +40,12 @@ public sealed partial class Dart
|
||||
#region Nested type: Header
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct Header
|
||||
[SwapEndian]
|
||||
partial struct Header
|
||||
{
|
||||
public readonly byte srcCmp;
|
||||
public readonly byte srcType;
|
||||
public readonly short srcSize;
|
||||
public byte srcCmp;
|
||||
public byte srcType;
|
||||
public short srcSize;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user