Enable Analyzer rules re: blank doc comments and fix noncompliance

This commit is contained in:
YoshiRulz 2024-07-08 01:27:08 +10:00
parent 9a82dfd05f
commit 5e5f5772c6
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
19 changed files with 9 additions and 106 deletions

View File

@ -579,11 +579,11 @@ dotnet_diagnostic.SA1610.severity = silent
# Element parameter documentation should match element parameters
dotnet_diagnostic.SA1612.severity = silent
# Element parameter documentation should have text
dotnet_diagnostic.SA1614.severity = silent
dotnet_diagnostic.SA1614.severity = warning
# Element return value documentation should have text
dotnet_diagnostic.SA1616.severity = silent
dotnet_diagnostic.SA1616.severity = warning
# Generic type parameter documentation should have text
dotnet_diagnostic.SA1622.severity = silent
dotnet_diagnostic.SA1622.severity = warning
# Property summary documentation should match accessors
dotnet_diagnostic.SA1623.severity = silent
# Element documentation should not be copied and pasted

View File

@ -22,7 +22,7 @@
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);IDE0005;SA1514</NoWarn>
<NoWarn>$(NoWarn);IDE0005;SA1514;SA1614;SA1616</NoWarn>
<Nullable>disable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

View File

@ -55,14 +55,12 @@ namespace BizHawk.BizInvoke
/// <summary>
/// Computes the byte offset of the first field of any class relative to a class pointer.
/// </summary>
/// <returns></returns>
public static int ComputeClassFirstFieldOffset()
=> ComputeFieldOffset(typeof(CF).GetField("FirstField"));
/// <summary>
/// Compute the byte offset of the first byte of string data (UTF16) relative to a pointer to the string.
/// </summary>
/// <returns></returns>
public static int ComputeStringOffset()
{
var s = new string(Array.Empty<char>());
@ -78,7 +76,6 @@ namespace BizHawk.BizInvoke
/// <summary>
/// Compute the offset to the 0th element of an array of value types
/// </summary>
/// <returns></returns>
public static int ComputeValueArrayElementOffset()
{
var arr = new int[4];
@ -96,7 +93,6 @@ namespace BizHawk.BizInvoke
/// Compute the offset to the 0th element of an array of object types
/// Slow, so cache it if you need it.
/// </summary>
/// <returns></returns>
public static int ComputeObjectArrayElementOffset()
{
var obj = new object[4];

View File

@ -24,16 +24,12 @@ namespace BizHawk.BizInvoke
/// managed wrapper involved. Called "arrival" because it is to be used when the foreign code is calling
/// back into host code.
/// </summary>
/// <returns></returns>
IntPtr GetArrivalFunctionPointer(IntPtr p, InvokerParameterInfo pp, object lifetime);
/// <summary>
/// Like Marshal.GetDelegateForFunctionPointer(), but wraps a thunk around the passed native pointer
/// to adjust the calling convention appropriately
/// </summary>
/// <param name="p"></param>
/// <param name="delegateType"></param>
/// <returns></returns>
Delegate GetDelegateForFunctionPointer(IntPtr p, Type delegateType);
/// <summary>
@ -41,10 +37,6 @@ namespace BizHawk.BizInvoke
/// managed wrapper involved.static Called "departure" beause it is to be used when first leaving host
/// code for foreign code.
/// </summary>
/// <param name="p"></param>
/// <param name="pp"></param>
/// <param name="lifetime"></param>
/// <returns></returns>
IntPtr GetDepartureFunctionPointer(IntPtr p, InvokerParameterInfo pp, object lifetime);
}
@ -137,7 +129,6 @@ namespace BizHawk.BizInvoke
/// This is very unsafe; any attempts by the guest to call syscalls will crash, and stack hygiene will be all wrong.
/// DO NOT USE THIS.
/// </summary>
/// <returns></returns>
public static ICallingConventionAdapter GetWaterboxUnsafeUnwrapped()
=> WaterboxAdapter.WaterboxWrapper;

View File

@ -39,8 +39,6 @@ namespace BizHawk.Client.Common
/// <summary>
/// Returns the core settings for a core
/// </summary>
/// <param name="config"></param>
/// <param name="coreType"></param>
/// <returns>null if no settings were saved, or there was an error deserializing</returns>
public static object GetCoreSettings(this Config config, Type coreType, Type settingsType)
{
@ -61,9 +59,7 @@ namespace BizHawk.Client.Common
/// <summary>
/// saves the core settings for a core
/// </summary>
/// <param name="config"></param>
/// <param name="o">null to remove settings for that core instead</param>
/// <param name="coreType"></param>
public static void PutCoreSettings(this Config config, object o, Type coreType)
{
if (o != null)
@ -79,8 +75,6 @@ namespace BizHawk.Client.Common
/// <summary>
/// Returns the core syncsettings for a core
/// </summary>
/// <param name="config"></param>
/// <param name="coreType"></param>
/// <returns>null if no settings were saved, or there was an error deserializing</returns>
public static object GetCoreSyncSettings(this Config config, Type coreType, Type syncSettingsType)
{
@ -101,9 +95,7 @@ namespace BizHawk.Client.Common
/// <summary>
/// saves the core syncsettings for a core
/// </summary>
/// <param name="config"></param>
/// <param name="o">null to remove settings for that core instead</param>
/// <param name="coreType"></param>
public static void PutCoreSyncSettings(this Config config, object o, Type coreType)
{
if (o != null)

View File

@ -41,20 +41,13 @@ namespace BizHawk.Client.Common
/// Get a nearby state. The returned frame must be less than or equal to the passed frame.
/// This may not fail; the StateManager strongly holds a frame 0 state to ensure there's always a possible result.
/// </summary>
/// <param name="frame"></param>
/// <returns>This stream may be consumed only once, and before any other calls to statemanager occur</returns>
KeyValuePair<int, Stream> GetStateClosestToFrame(int frame);
/// <summary>
/// Returns the total number of states currently held by the state manager
/// </summary>
/// <value></value>
/// <value>the total number of states currently held by the state manager</value>
int Count { get; }
/// <summary>
/// Returns the most recent frame number that the state manager possesses
/// </summary>
/// <value></value>
/// <value>the most recent frame number that the state manager possesses</value>
int Last { get; }
/// <summary>
@ -71,7 +64,6 @@ namespace BizHawk.Client.Common
/// Enables the instance to be used. An instance of <see cref="IStateManager"/> should not
/// be useable until this method is called
/// </summary>
/// <param name="frameZeroState"></param>
void Engage(byte[] frameZeroState);
}
}

View File

@ -85,10 +85,7 @@ namespace BizHawk.Client.Common
/// </summary>
public int Count => (_nextStateIndex - _firstStateIndex) & STATEMASK;
/// <summary>
/// total number of bytes used
/// </summary>
/// <value></value>
/// <value>total number of bytes used</value>
public long Used => Count == 0
? 0
: (_states[HeadStateIndex].Start
@ -96,10 +93,7 @@ namespace BizHawk.Client.Common
- _states[_firstStateIndex].Start
) & _sizeMask;
/// <summary>
/// Total size of the _buffer
/// </summary>
/// <value></value>
/// <value>Total size of the buffer</value>
public long Size { get; }
private readonly long _sizeMask;
@ -282,8 +276,6 @@ namespace BizHawk.Client.Common
/// Retrieve information about a state from 0..Count - 1.
/// The information contained within is valid only until the collection is modified.
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public StateInformation GetState(int index)
{
if ((uint) index >= (uint) Count) throw new ArgumentOutOfRangeException(paramName: nameof(index), index, message: "index out of range");
@ -293,7 +285,6 @@ namespace BizHawk.Client.Common
/// <summary>
/// Invalidate states from GetState(index) on to the end of the buffer, so that Count == index afterwards
/// </summary>
/// <param name="index"></param>
public void InvalidateEnd(int index)
{
if ((uint) index > (uint) Count) // intentionally allows index == Count (e.g. clearing an empty buffer)

View File

@ -477,7 +477,6 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
/// <param name="condition">The condition to check for</param>
/// <typeparam name="T">Type of tools to check</typeparam>
/// <returns></returns>
public T FirstOrNull<T>(Predicate<T> condition) where T : class
{
foreach (var tool in _tools)

View File

@ -42,9 +42,7 @@ namespace BizHawk.Common.IOExtensions
/// <summary>
/// Read a string from a binary reader using utf8 encoding and known byte length
/// </summary>
/// <param name="r"></param>
/// <param name="bytes">exact number of bytes to read</param>
/// <returns></returns>
public static string ReadStringFixedUtf8(this BinaryReader r, int bytes)
{
var read = new byte[bytes];
@ -55,8 +53,6 @@ namespace BizHawk.Common.IOExtensions
/// <summary>
/// Read a null terminated string from a binary reader using utf8 encoding
/// </summary>
/// <param name="br"></param>
/// <returns></returns>
public static string ReadStringUtf8NullTerminated(this BinaryReader br)
{
using var ms = new MemoryStream();

View File

@ -14,7 +14,6 @@ namespace BizHawk.Common
/// <summary>
/// Map some bytes
/// </summary>
/// <param name="size"></param>
/// <exception cref="InvalidOperationException">
/// failed to mmap
/// </exception>

View File

@ -13,11 +13,7 @@ namespace BizHawk.Common
}
public static class SpanStream
{
/// <summary>
/// Returns a stream in spanstream mode, or creates a wrapper that provides that functionality
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
/// <returns>a stream in spanstream mode, or a newly-created wrapper which provides that functionality</returns>
public static ISpanStream GetOrBuild(Stream s)
{
return s as ISpanStream

View File

@ -26,8 +26,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// Helper method moving from IO pins to accumulator
/// (complement and flags set)
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void LR_A_IO_Func(byte dest, byte src)
{
// overflow and carry unconditionally reset
@ -46,8 +44,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// Helper method moving from accumulator to IO pins
/// (complement)
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void OUT_Func(byte dest, byte src)
{
// data is complemented between accumulator and I/O pins (because PINs are active-low)
@ -66,8 +62,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// Helper function for transferring data between registers
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void LR_Func(byte dest, byte src)
{
if (dest == DB)
@ -94,8 +88,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// Right shift 'src' 'shift' positions (zero fill)
/// </summary>
/// <param name="src"></param>
/// <param name="shift"></param>
public void SR_Func(byte src, byte shift)
{
// overflow and carry unconditionally reset
@ -111,8 +103,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// Left shift 'src' 'shift' positions (zero fill)
/// </summary>
/// <param name="src"></param>
/// <param name="shift"></param>
public void SL_Func(byte src, byte shift)
{
// overflow and carry unconditionally reset
@ -130,8 +120,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// Statuses modified: OVF, ZERO, CARRY, SIGN
/// Statuses unaffected: ICB
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void ADD_Func(byte dest, byte src, byte src2 = ZERO)
{
ushort res = (ushort)(Regs[dest] + Regs[src] + Regs[src2]);
@ -152,8 +140,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// Decimal Add
/// http://www.bitsavers.org/components/fairchild/f8/67095664_F8_Guide_To_Programming_1976.pdf - page 40
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void ADDD_Func(byte dest, byte src)
{
// The accumulator and the memory location addressed by the DCO registers are assumed to contain two BCD digits.
@ -237,8 +223,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// Logical AND regs[dest] with regs[src] and store the result in regs[dest]
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void AND_Func(byte dest, byte src)
{
// overflow and carry unconditionally reset
@ -254,8 +238,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// Logical OR regs[dest] with regs[src] and store the result in regs[dest]
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void OR_Func(byte dest, byte src)
{
// overflow and carry unconditionally reset
@ -271,8 +253,6 @@ namespace BizHawk.Emulation.Cores.Components.FairchildF8
/// <summary>
/// The destination (regs[dest]) is XORed with (regs[src]).
/// </summary>
/// <param name="dest"></param>
/// <param name="src"></param>
public void XOR_Func(byte dest, byte src)
{
// overflow and carry unconditionally reset

View File

@ -396,7 +396,6 @@
/// Statuses reset: OVF, CARRY
/// Statuses unaffected: ICB
/// </summary>
/// <param name="index"></param>
private void SR(byte index)
{
PopulateCURINSTR(
@ -414,7 +413,6 @@
/// Statuses reset: OVF, CARRY
/// Statuses unaffected: ICB
/// </summary>
/// <param name="index"></param>
private void SL(byte index)
{
PopulateCURINSTR(
@ -998,7 +996,6 @@
/// Statuses modified: OVF, ZERO, CARRY, SIGN
/// Statuses unaffected: ICB
/// </summary>
/// <param name="rIndex"></param>
private void DS(byte rIndex)
{
// only scratch registers 0-16
@ -1190,7 +1187,6 @@
/// A 3-bit value provided by the LlSU instruction operand is loaded into the three most significant bits of the ISAR. The three least significant bits of the ISAR are not altered.
/// No status bits are affected.
/// </summary>
/// <param name="octal"></param>
private void LISU(byte octal)
{
PopulateCURINSTR(
@ -1206,7 +1202,6 @@
/// A 3-bit value provided by the USL instruction operand is loaded into the three least significant bits of the ISAR. The three most significant bits of the ISAR are not altered.
/// No status bits are modified.
/// </summary>
/// <param name="octal"></param>
private void LISL(byte octal)
{
PopulateCURINSTR(
@ -1223,7 +1218,6 @@
/// The most significant four bits of the accumulator are set to "0".
/// No status bits are modified.
/// </summary>
/// <param name="index"></param>
private void LIS(byte index)
{
PopulateCURINSTR(
@ -1448,7 +1442,6 @@
/// Statuses reset: OVF, CARRY
/// Statuses unaffected: ICB
/// </summary>
/// <param name="index"></param>
private void INS_0(byte index)
{
Regs[IO] = index; // latch port index early
@ -1474,7 +1467,6 @@
/// Statuses reset: OVF, CARRY
/// Statuses unaffected: ICB
/// </summary>
/// <param name="index"></param>
private void INS_1(byte index)
{
Regs[IO] = index; // latch port index early
@ -1507,7 +1499,6 @@
/// I/O ports with addresses from 0 to 1 may be accessed by this instruction. (Outs O or 1 is CPU port only.)
/// No status bits are modified.
/// </summary>
/// <param name="index"></param>
private void OUTS_0(byte index)
{
Regs[IO] = index; // latch port index early
@ -1531,7 +1522,6 @@
/// I/O ports with addresses from 3 to 15 may be accessed by this instruction.
/// No status bits are modified.
/// </summary>
/// <param name="index"></param>
private void OUTS_1(byte index)
{
Regs[IO] = index; // latch port index early
@ -1566,7 +1556,6 @@
/// Statuses modified: OVF, ZERO, CARRY, SIGN
/// Statuses unaffected: ICB
/// </summary>
/// <param name="rIndex"></param>
private void AS(byte rIndex)
{
// only scratch registers 0-15
@ -1641,7 +1630,6 @@
/// Statuses not significant: OVF, SIGN
/// Statuses unaffected: ICB
/// </summary>
/// <param name="rIndex"></param>
private void ASD(byte rIndex)
{
// only scratch registers 0-15
@ -1738,7 +1726,6 @@
/// Statuses reset: OVF, CARRY
/// Statuses unaffected: ICB
/// </summary>
/// <param name="rIndex"></param>
private void XS(byte rIndex)
{
// only scratch registers 0-15
@ -1813,7 +1800,6 @@
/// Statuses modified: ZERO, SIGN
/// Statuses unaffected: ICB
/// </summary>
/// <param name="rIndex"></param>
private void NS(byte rIndex)
{
// only scratch registers 0-15

View File

@ -51,7 +51,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <summary>
/// |11-- ---- ---- --0-| - IN - Read value of currently selected register
/// </summary>
/// <returns></returns>
public bool ReadPort(ushort port, ref int value)
{
if (!port.Bit(1))
@ -72,7 +71,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// |11-- ---- ---- --0-| - OUT - Register Select
/// |10-- ---- ---- --0-| - OUT - Write value to currently selected register
/// </summary>
/// <returns></returns>
public bool WritePort(ushort port, int value)
{
if (!port.Bit(1))

View File

@ -147,9 +147,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <summary>
/// Caluclate a data block XOR checksum
/// </summary>
/// <param name="buf"></param>
/// <param name="len"></param>
/// <returns></returns>
public static bool CheckChecksum(byte[] buf, int len)
{
byte c = 0;

View File

@ -48,10 +48,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// </summary>
private readonly DatacorderDevice _datacorder;
/// <summary>
/// Constructor
/// </summary>
/// <param name="_tapeDevice"></param>
public TzxConverter(DatacorderDevice _tapeDevice)
{
_datacorder = _tapeDevice;

View File

@ -11,8 +11,6 @@
/// <summary>
/// Simulates reading a byte of data from the address space
/// </summary>
/// <param name="addr"></param>
/// <returns></returns>
public byte ReadBus(ushort addr)
{
if (addr < 0x400)
@ -36,7 +34,6 @@
/// Simulates writing a byte of data to the address space (in its default configuration, there is no writeable RAM in the
/// Channel F addressable through the address space)
/// </summary>
/// <param name="addr"></param>
public void WriteBus(ushort addr, byte value)
{
Cartridge.WriteBus(addr, value);

View File

@ -31,7 +31,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy
/// Acquire GPU memory for inspection. The returned object must be disposed as soon as the frontend
/// tool is done inspecting it, and the pointers become invalid once it is disposed.
/// </summary>
/// <returns></returns>
IGPUMemoryAreas LockGPU();
/// <summary>

View File

@ -181,7 +181,6 @@ namespace BizHawk.Emulation.Cores.Waterbox
/// <summary>
/// Set a callback to be called whenever the core calls MDFN_MakeFName for a firmware, so that we can load firmwares on demand
/// </summary>
/// <param name="cb"></param>
[BizImport(CC)]
public abstract void SetFrontendFirmwareNotify(FrontendFirmwareNotify cb);
@ -207,7 +206,6 @@ namespace BizHawk.Emulation.Cores.Waterbox
/// <summary>
/// Callback to receive a disk TOC
/// </summary>
/// <param name="disk"></param>
/// <param name="dest">Deposit a LibNymaCore.TOC here</param>
[UnmanagedFunctionPointer(CC)]
public delegate void CDTOCCallback(int disk, IntPtr dest);