Skip to content

Commit

Permalink
fix another couple warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ZingBallyhoo committed Dec 2, 2023
1 parent e032381 commit 892250e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions TACTLib/Helpers/UInt16BE.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Buffers.Binary;
using System.Runtime.InteropServices;

namespace TACTLib.Helpers {
[StructLayout(LayoutKind.Sequential)]
public struct UInt16BE
{
private ushort m_data;
Expand Down
15 changes: 11 additions & 4 deletions TACTLib/Helpers/UInt24BE.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
using System.Runtime.CompilerServices;
using System;
using System.Runtime.InteropServices;

namespace TACTLib.Helpers
{
[InlineArray(3)]
[StructLayout(LayoutKind.Sequential)]
public struct UInt24BE
{
private byte m_first;
private byte m_a;
private byte m_b;
private byte m_c;

public readonly int ToInt()
{
return this[2] | (this[1] << 8) | (this[0] << 16);
if (BitConverter.IsLittleEndian)
{
return m_c | (m_b << 8) | (m_a << 16);
}
throw new NotImplementedException();
}
}
}

0 comments on commit 892250e

Please sign in to comment.