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>()];
|
var headerB = new byte[Marshal.SizeOf<Header>()];
|
||||||
|
|
||||||
stream.EnsureRead(headerB, 0, 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;
|
if(header.srcCmp > COMPRESS_NONE) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public sealed partial class Dart
|
|||||||
var headerB = new byte[Marshal.SizeOf<Header>()];
|
var headerB = new byte[Marshal.SizeOf<Header>()];
|
||||||
|
|
||||||
stream.EnsureRead(headerB, 0, 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;
|
if(header.srcCmp > COMPRESS_NONE) return ErrorNumber.NotSupported;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using Aaru.CommonTypes.Attributes;
|
||||||
|
|
||||||
namespace Aaru.Images;
|
namespace Aaru.Images;
|
||||||
|
|
||||||
@@ -39,11 +40,12 @@ public sealed partial class Dart
|
|||||||
#region Nested type: Header
|
#region Nested type: Header
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
struct Header
|
[SwapEndian]
|
||||||
|
partial struct Header
|
||||||
{
|
{
|
||||||
public readonly byte srcCmp;
|
public byte srcCmp;
|
||||||
public readonly byte srcType;
|
public byte srcType;
|
||||||
public readonly short srcSize;
|
public short srcSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user