Skip to content

Commit

Permalink
Disable warning for Big Endian method names
Browse files Browse the repository at this point in the history
  • Loading branch information
csinkers committed Nov 2, 2024
1 parent 7394958 commit 91f5689
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ISerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static ulong SwapBytes64(ulong x)
return ((x & 0xFF00FF00FF00FF00) >> 8) | ((x & 0x00FF00FF00FF00FF) << 8);
}

// ReSharper disable InconsistentNaming
public static short Int16BE(this ISerializer s, int n, short value) => SwapBytes16(s.Int16(n, SwapBytes16(value)));
public static int Int32BE(this ISerializer s, int n, int value) => SwapBytes32(s.Int32(n, SwapBytes32(value)));
public static long Int64BE(this ISerializer s, int n, long value) => SwapBytes64(s.Int64(n, SwapBytes64(value)));
Expand Down Expand Up @@ -182,6 +183,8 @@ public static T EnumU16BE<T>(this ISerializer s, string name, T value) where T
public static T EnumU32BE<T>(this ISerializer s, string name, T value) where T : unmanaged, Enum
=> (T)(object)SwapBytes32(s.UInt32(name, SwapBytes32((uint)(object)value)));

// ReSharper restore InconsistentNaming

public static T Object<T>(this ISerializer s, int n, T value, SerdesMethod<T> serdes)
{
s.Begin($"{n}");
Expand Down

0 comments on commit 91f5689

Please sign in to comment.