Commit 298024d9 authored by Marc Gravell's avatar Marc Gravell

Fix (or suppress) code analysis warnings

parent 13e6ec5b
......@@ -5,6 +5,8 @@
using System.Threading.Tasks;
using StackExchange.Redis;
[assembly: System.Reflection.AssemblyVersion("1.0.0")]
namespace BasicTest
{
class Program
......
static class Program
[assembly: System.Reflection.AssemblyVersion("1.0.0")]
static class Program
{
static void Main() { System.Console.WriteLine("This is a place-holder project just to make file management easier"); }
}
......@@ -30,6 +30,8 @@ protected TestBase()
{
socketManager = new SocketManager(GetType().Name);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
public void Dispose()
{
socketManager.Dispose();
......
......@@ -78,5 +78,19 @@ public bool Equals(HashEntry value)
{
return this.name == value.name && this.value == value.value;
}
/// <summary>
/// Compares two values for equality
/// </summary>
public static bool operator ==(HashEntry x, HashEntry y)
{
return x.name == y.name && x.value == y.value;
}
/// <summary>
/// Compares two values for non-equality
/// </summary>
public static bool operator !=(HashEntry x, HashEntry y)
{
return x.name != y.name || x.value != y.value;
}
}
}
......@@ -31,6 +31,7 @@ partial class SocketManager
private int readerCount;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
[DllImport("ws2_32.dll", SetLastError = true)]
internal static extern int select([In] int ignoredParameter, [In, Out] IntPtr[] readfds, [In, Out] IntPtr[] writefds, [In, Out] IntPtr[] exceptfds, [In] ref TimeValue timeout);
......
......@@ -194,6 +194,7 @@ private void EndConnect(IAsyncResult ar)
partial void OnDispose();
partial void OnShutdown(Socket socket);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
private void Shutdown(Socket socket)
{
if (socket != null)
......
......@@ -102,5 +102,20 @@ public int CompareTo(object value)
return value is SortedSetEntry ? CompareTo((SortedSetEntry)value) : -1;
}
/// <summary>
/// Compares two values for equality
/// </summary>
public static bool operator ==(SortedSetEntry x, SortedSetEntry y)
{
return x.score == y.score && x.element == y.element;
}
/// <summary>
/// Compares two values for non-equality
/// </summary>
public static bool operator !=(SortedSetEntry x, SortedSetEntry y)
{
return x.score != y.score || x.element != y.element;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment