Fix or mute remaining code style warnings

This commit is contained in:
YoshiRulz 2020-08-29 00:22:00 +10:00
parent 17ff66c61b
commit 14653fac0e
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
30 changed files with 96 additions and 72 deletions

View File

@ -8,8 +8,8 @@ namespace BizHawk.BizInvoke
{
public class MemoryBlock : IDisposable /*, IBinaryStateable */
{
/// <summary>allocate <paramref name="size"/> bytes starting at a particular address <paramref name="start"/></summary>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="start"/> is not aligned or <paramref name="size"/> is <c>0</c></exception>
/// <summary>allocate <paramref name="size"/> bytes</summary>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="size"/> is not aligned or is <c>0</c></exception>
public MemoryBlock(ulong size)
{
if (!WaterboxUtils.Aligned(size))

View File

@ -1,3 +1,5 @@
#pragma warning disable CA2007
using System;
using System.Collections.Generic;
using System.Net.Http;

View File

@ -121,21 +121,21 @@ __Types and notation__
sb
.Append("${")
.Append(i + 1)
.Append(":");
.Append(':');
sb.Append(parameters[i].IsOptional
? $"[{parameters[i].Name}]"
: parameters[i].Name);
sb.Append("}");
sb.Append('}');
if (i < parameters.Count - 1)
{
sb.Append(",");
sb.Append(',');
}
}
sb.Append(")");
sb.Append(')');
}
else
{

View File

@ -35,11 +35,11 @@ namespace BizHawk.Client.Common
{
var sb = new StringBuilder("subtitle ");
sb
.Append(Frame).Append(" ")
.Append(X).Append(" ")
.Append(Y).Append(" ")
.Append(Duration).Append(" ")
.Append($"{Color:X8}").Append(" ")
.Append(Frame).Append(' ')
.Append(X).Append(' ')
.Append(Y).Append(' ')
.Append(Duration).Append(' ')
.Append($"{Color:X8}").Append(' ')
.Append(Message);
return sb.ToString();
@ -49,7 +49,7 @@ namespace BizHawk.Client.Common
{
var sb = new StringBuilder();
sb.Append(index.ToString());
sb.Append(index);
sb.Append("\r\n");
// Frame timing

View File

@ -30,7 +30,7 @@ namespace BizHawk.Client.Common
foreach (var group in _source.Definition.ControlsOrdered.Where(c => c.Any()))
{
sb.Append("#");
sb.Append('#');
foreach (var button in group)
{
sb.Append(button).Append('|');

View File

@ -260,10 +260,12 @@ namespace BizHawk.Client.Common
public void InsertEmptyFrame(int frame, int count = 1)
{
#pragma warning disable CA1829 //TODO check StreamStringLog.Count is counting the same things as its enumerator
if (frame > Log.Count())
{
frame = Log.Count();
}
#pragma warning restore CA1829
var lg = LogGeneratorInstance(Session.MovieController);
Log.InsertRange(frame, Enumerable.Repeat(lg.EmptyEntry, count).ToList());

View File

@ -163,8 +163,8 @@ namespace BizHawk.Client.EmuHawk
private class ShaderWrapper
{
public int sid;
public Dictionary<string, string> MapCodeToNative;
public Dictionary<string, string> MapNativeToCode;
// public Dictionary<string, string> MapCodeToNative;
// public Dictionary<string, string> MapNativeToCode;
}
private class PipelineWrapper

View File

@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk
if (requestedExtToolDll != null)
{
var enabled = ExternalToolManager.ToolStripMenu.Where(item => item.Enabled)
.Select(item => (ValueTuple<string, string>) item.Tag)
.Select(item => ((string, string)) item.Tag)
.ToList();
try
{

View File

@ -233,7 +233,7 @@ namespace BizHawk.Client.EmuHawk
}
blob.Append(_disassemblyLines[index].Address.ToHexString(_pcRegisterSize))
.Append(" ")
.Append(' ')
.Append(_disassemblyLines[index].Mnemonic);
}

View File

@ -10,7 +10,7 @@ namespace BizHawk.Common
{
public class FFmpegService
{
public static string FFmpegPath;
public static string FFmpegPath = string.Empty; // always updated in DiscoHawk.Program/EmuHawk.Program
//could return a different version for different operating systems.. shouldnt be hard.
public static readonly string Version = "N-92462-g529debc987";

View File

@ -401,13 +401,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
if (!snip)
{
str.Append("-");
str.Append('-');
snip = true;
}
}
else
{
if (count > 0 && !snip) str.Append(",");
if (count > 0 && !snip) str.Append(',');
str.Append("D" + i);
snip = false;
}
@ -424,13 +424,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
if (!snip)
{
str.Append("-");
str.Append('-');
snip = true;
}
}
else
{
if (count > 0 && !snip) str.Append(",");
if (count > 0 && !snip) str.Append(',');
str.Append("A" + i);
snip = false;
}
@ -456,13 +456,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
if (!snip)
{
str.Append("-");
str.Append('-');
snip = true;
}
}
else
{
if (count > 0 && !snip) str.Append(",");
if (count > 0 && !snip) str.Append(',');
str.Append("D" + i);
snip = false;
}
@ -479,13 +479,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
if (!snip)
{
str.Append("-");
str.Append('-');
snip = true;
}
}
else
{
if (count > 0 && !snip) str.Append(",");
if (count > 0 && !snip) str.Append(',');
str.Append("A" + i);
snip = false;
}

View File

@ -226,11 +226,11 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
for (int i = 0; i < makeup; i++)
{
if (tLen > 4)
sb.Append("\t");
sb.Append('\t');
else
{
makeup--;
sb.Append("\t");
sb.Append('\t');
}
}
@ -258,8 +258,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
{
if (i != 0)
{
sb.Append("\t");
sb.Append("\t");
sb.Append('\t');
sb.Append('\t');
}
sb.Append(builder[i]);
@ -279,38 +279,38 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
StringBuilder sb = new StringBuilder();
sb.Append(m.Name);
sb.Append("\n");
sb.AppendLine();
sb.Append("-----------------------------------------------------------------\n");
// Release
sb.Append("Released:");
sb.Append(" ");
sb.Append(' ');
sb.Append(m.Released);
sb.Append("\n");
sb.AppendLine();
// CPU
sb.Append("CPU:");
sb.Append(" ");
sb.Append(m.CPU);
sb.Append("\n");
sb.AppendLine();
// Memory
sb.Append("Memory:");
sb.Append(" ");
sb.Append(m.Memory);
sb.Append("\n");
sb.AppendLine();
// Video
sb.Append("Video:");
sb.Append(" ");
sb.Append(m.Video);
sb.Append("\n");
sb.AppendLine();
// Audio
sb.Append("Audio:");
sb.Append(" ");
sb.Append(m.Audio);
sb.Append("\n");
sb.AppendLine();
// Audio
sb.Append("Media:");
sb.Append(" ");
sb.Append(m.Media);
sb.Append("\n");
sb.AppendLine();
sb.Append("-----------------------------------------------------------------\n");
// description

View File

@ -304,7 +304,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
var bl = _dataBlocks[targetBlockId];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((targetBlockId + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
//sbd.Append("ID" + bl.BlockID.ToString("X2") + " - ");
@ -313,7 +313,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
{
sbd.Append(" - ");
sbd.Append(bl.MetaData.First().Key + ": " + bl.MetaData.First().Value);
//sbd.Append("\n");
//sbd.AppendLine();
//sbd.Append(bl.MetaData.Skip(1).First().Key + ": " + bl.MetaData.Skip(1).First().Value);
}
@ -485,7 +485,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
var bl = _dataBlocks[_currentDataBlockIndex];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((_currentDataBlockIndex + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
//sbd.Append("ID" + bl.BlockID.ToString("X2") + " - ");
@ -511,7 +511,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// notify about the current block (we are skipping it because its empty)
var bl = _dataBlocks[_currentDataBlockIndex];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((_currentDataBlockIndex + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
//sbd.Append("ID" + bl.BlockID.ToString("X2") + " - ");

View File

@ -44,19 +44,19 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
for (int i = 0; i < 3; i++)
{
sb.Append(workingArr[i]);
sb.Append(",");
sb.Append(',');
workingArr[i] = "";
}
sb.Append(ActiveCommand.CommandCode).Append(",");
sb.Append(ActiveCommand.CommandCode).Append(',');
sb.Append(CMD_FLAG_MT).Append(",");
sb.Append(CMD_FLAG_MF).Append(",");
sb.Append(CMD_FLAG_SK).Append(",");
sb.Append(CMD_FLAG_MT).Append(',');
sb.Append(CMD_FLAG_MF).Append(',');
sb.Append(CMD_FLAG_SK).Append(',');
sb.Append(CommCounter).Append(",");
sb.Append(ResCounter).Append(",");
sb.Append(ExecCounter).Append(",");
sb.Append(CommCounter).Append(',');
sb.Append(ResCounter).Append(',');
sb.Append(ExecCounter).Append(',');
sb.Append(ExecLength);
//sb.Append("\r\n");

View File

@ -1733,7 +1733,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
sb.Append(type + ": ");
sb.Append(fileName + " ");
sb.Append(GetWordValue(blockdata, 14));
sb.Append(":");
sb.Append(':');
sb.Append(GetWordValue(blockdata, 12));
description = sb.ToString();
}

View File

@ -275,7 +275,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
var bl = _dataBlocks[targetBlockId];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((targetBlockId + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
sbd.Append(bl.BlockDescription);
@ -491,7 +491,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
var bl = _dataBlocks[_currentDataBlockIndex];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((_currentDataBlockIndex + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
sbd.Append(bl.BlockDescription);
@ -514,7 +514,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// notify about the current block (we are skipping it because its empty)
var bl = _dataBlocks[_currentDataBlockIndex];
StringBuilder sbd = new StringBuilder();
sbd.Append("(");
sbd.Append('(');
sbd.Append((_currentDataBlockIndex + 1) + " of " + _dataBlocks.Count);
sbd.Append(") : ");
sbd.Append(bl.BlockDescription);

View File

@ -44,19 +44,19 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
for (int i = 0; i < 3; i++)
{
sb.Append(workingArr[i]);
sb.Append(",");
sb.Append(',');
workingArr[i] = "";
}
sb.Append(ActiveCommand.CommandCode).Append(",");
sb.Append(ActiveCommand.CommandCode).Append(',');
sb.Append(CMD_FLAG_MT).Append(",");
sb.Append(CMD_FLAG_MF).Append(",");
sb.Append(CMD_FLAG_SK).Append(",");
sb.Append(CMD_FLAG_MT).Append(',');
sb.Append(CMD_FLAG_MF).Append(',');
sb.Append(CMD_FLAG_SK).Append(',');
sb.Append(CommCounter).Append(",");
sb.Append(ResCounter).Append(",");
sb.Append(ExecCounter).Append(",");
sb.Append(CommCounter).Append(',');
sb.Append(ResCounter).Append(',');
sb.Append(ExecCounter).Append(',');
sb.Append(ExecLength);
//sb.Append("\r\n");

View File

@ -243,7 +243,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
sb.Append(type + ": ");
sb.Append(fileName + " ");
sb.Append(GetWordValue(blockdata, 14));
sb.Append(":");
sb.Append(':');
sb.Append(GetWordValue(blockdata, 12));
description = sb.ToString();
}

View File

@ -1629,7 +1629,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
sb.Append(type + ": ");
sb.Append(fileName + " ");
sb.Append(GetWordValue(blockdata, 14));
sb.Append(":");
sb.Append(':');
sb.Append(GetWordValue(blockdata, 12));
description = sb.ToString();
}

View File

@ -369,11 +369,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
for (int i = 0; i < makeup; i++)
{
if (tLen > 4)
sb.Append("\t");
sb.Append('\t');
else
{
makeup--;
sb.Append("\t");
sb.Append('\t');
}
}
@ -402,8 +402,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
{
if (i != 0)
{
sb.Append("\t");
sb.Append("\t");
sb.Append('\t');
sb.Append('\t');
}
sb.Append(builder[i]);

View File

@ -17,11 +17,13 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
private int tone = 0;
private double[] tone_freqs = { 0, 1000, 500, 120 };
#pragma warning disable CS0414
private double amplitude = 0;
private double decay = 0.998;
private double time = 0;
private double cycles = 0;
private int samplePos = 0;
#pragma warning restore CS0414
private int lastCycle = 0;
private BlipBuffer _blip;

View File

@ -53,8 +53,10 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
}
private int _frame;
#pragma warning disable CS0414
private int _lagcount;
private bool _islag;
#pragma warning restore CS0414
public void ResetCounters()
{

View File

@ -298,7 +298,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
public string Disassemble(ushort addr, Func<ushort, byte> read, out int size)
{
ushort start_addr = addr;
ushort extra_inc = 0;
// ushort extra_inc = 0;
byte A = read(addr++);
string format;
format = mnemonics[A];

View File

@ -42,6 +42,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
Data = 0x04
}
#pragma warning disable CS0649
private struct CDLog_MapResults
{
public CDLog_AddrType Type;
@ -50,6 +51,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
private delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
private MapMemoryDelegate MapMemory;
#pragma warning restore CS0649
private ICodeDataLog CDL;
private void RunCDL(ushort address, CDLog_Flags flags)

View File

@ -288,7 +288,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
}
}
#pragma warning disable CS0414
private PrinterCallback _printerCallback = null;
#pragma warning restore CS0414
public void SetPrinterCallback(PrinterCallback callback)
{

View File

@ -10,8 +10,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
private int _reg;
private bool IsPrg16Mode => _reg.Bit(7);
#pragma warning disable CS0649
[MapperProp]
public int Mapper60_DipSwitch;
#pragma warning restore CS0169
private const int DipSwitchMask = 3;

View File

@ -56,6 +56,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
Data = 0x04
}
#pragma warning disable CS0649
private struct CDLog_MapResults
{
public CDLog_AddrType Type;
@ -64,6 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
private delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
private MapMemoryDelegate MapMemory;
#pragma warning restore CS0649
private ICodeDataLog CDL;
private void RunCDL(ushort address, CDLog_Flags flags)

View File

@ -23,7 +23,9 @@ namespace BizHawk.Emulation.Cores.Libretro
public sbyte* valid_extensions;
public bool need_fullpath;
public bool block_extract;
#pragma warning disable CS0169
short _pad;
#pragma warning restore CS0169
}
public struct retro_system_timing

View File

@ -56,7 +56,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
//not sure if we need this...
private class TrackInfo
{
public int Length;
// public int Length;
public CompiledCueTrack CompiledCueTrack;
}

View File

@ -11,8 +11,14 @@ namespace BizHawk.Emulation.DiscSystem
/// </summary>
internal class Synthesize_LeadoutJob
{
public int Length;
public Disc Disc;
private readonly int Length;
private readonly Disc Disc;
public Synthesize_LeadoutJob(int length, Disc disc)
{
Length = length;
Disc = disc;
}
public void Run()
{