diff options
| author | Ac_K <Acoustik666@gmail.com> | 2019-11-23 03:15:15 +0100 |
|---|---|---|
| committer | jduncanator <1518948+jduncanator@users.noreply.github.com> | 2019-11-23 13:15:15 +1100 |
| commit | bb74aeae54e4579008ac23216b8b175d64c9f10f (patch) | |
| tree | 0f773f5f84c05c663f4a81eb7fd26a2f54384845 /Ryujinx.Common | |
| parent | cfcc360d0610c66e9b9986f7aab96f79df0da79e (diff) | |
Use BinaryPrimitives.ReverseEndianness instead EndianSwap class (#832)
This PR remove the `EndianSwap` class who isn't needed anymore since .NET Core 3.0 got a buildin method `BinaryPrimitives.ReverseEndianness` who did the same thing.
Diffstat (limited to 'Ryujinx.Common')
| -rw-r--r-- | Ryujinx.Common/Utilities/EndianSwap.cs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Ryujinx.Common/Utilities/EndianSwap.cs b/Ryujinx.Common/Utilities/EndianSwap.cs deleted file mode 100644 index 049570e3..00000000 --- a/Ryujinx.Common/Utilities/EndianSwap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Ryujinx.Common -{ - public static class EndianSwap - { - public static ushort Swap16(ushort value) => (ushort)(((value >> 8) & 0xff) | (value << 8)); - - public static int Swap32(int value) - { - uint uintVal = (uint)value; - - return (int)(((uintVal >> 24) & 0x000000ff) | - ((uintVal >> 8) & 0x0000ff00) | - ((uintVal << 8) & 0x00ff0000) | - ((uintVal << 24) & 0xff000000)); - } - - public static uint FromBigEndianToPlatformEndian(uint value) - { - uint result = value; - - if (BitConverter.IsLittleEndian) - { - result = (uint)EndianSwap.Swap32((int)result); - } - - return result; - } - } -} |
