Skip to content

Commit c84d292

Browse files
committed
Remove unused helpers Util.{Memcmp,Memset}
1 parent e5d641f commit c84d292

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

src/BizHawk.Common/Util.cs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace BizHawk.Common
1414
{
15-
public static unsafe class Util
15+
public static class Util
1616
{
1717
[Conditional("DEBUG")]
1818
public static void BreakDebuggerIfAttached()
@@ -147,26 +147,6 @@ static int CharToNybble(char c)
147147
return ms.ToArray();
148148
}
149149

150-
public static int Memcmp(void* a, void* b, int len)
151-
{
152-
var ba = (byte*) a;
153-
var bb = (byte*) b;
154-
for (var i = 0; i != len; i++)
155-
{
156-
var _a = ba[i];
157-
var _b = bb[i];
158-
var c = _a - _b;
159-
if (c != 0) return c;
160-
}
161-
return 0;
162-
}
163-
164-
public static void Memset(void* ptr, int val, int len)
165-
{
166-
var bptr = (byte*) ptr;
167-
for (var i = 0; i != len; i++) bptr[i] = (byte) val;
168-
}
169-
170150
public static byte[]? ReadByteBuffer(this BinaryReader br, bool returnNull)
171151
{
172152
var len = br.ReadInt32();
@@ -308,7 +288,7 @@ static bool TryWaitForFileToVanish(string path)
308288

309289
/// <summary>creates span over <paramref name="length"/> octets starting at <paramref name="ptr"/></summary>
310290
[MethodImpl(MethodImplOptions.AggressiveInlining)]
311-
public static Span<byte> UnsafeSpanFromPointer(IntPtr ptr, int length)
291+
public static unsafe Span<byte> UnsafeSpanFromPointer(IntPtr ptr, int length)
312292
{
313293
return new(pointer: ptr.ToPointer(), length: length);
314294
}
@@ -319,7 +299,7 @@ public static Span<byte> UnsafeSpanFromPointer(IntPtr ptr, int length)
319299
/// </summary>
320300
/// <remarks>uses native endianness</remarks>
321301
[MethodImpl(MethodImplOptions.AggressiveInlining)]
322-
public static Span<T> UnsafeSpanFromPointer<T>(IntPtr ptr, int count)
302+
public static unsafe Span<T> UnsafeSpanFromPointer<T>(IntPtr ptr, int count)
323303
where T : unmanaged
324304
{
325305
return new(pointer: ptr.ToPointer(), length: count * sizeof(T));

0 commit comments

Comments
 (0)