From 761374839095e89f67470d8d626509cde5a56780 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 19 May 2020 23:33:16 +1000 Subject: [PATCH] Fix some code flagged by StyleCop SA1106 x4, SA1113 x2, SA1142 x2, SA1206 --- src/BizHawk.Client.Common/movie/bk2/Bk2Controller.cs | 2 +- src/BizHawk.Client.EmuHawk/Input/OTK_Gamepad.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 4 ++-- .../tools/Lua/Libraries/SavestateLuaLibrary.cs | 6 ++---- src/BizHawk.Emulation.Cores/Arcades/MAME/LibMAME.cs | 2 +- src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs | 2 +- .../Consoles/Nintendo/GBA/LibmGBA.cs | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Controller.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Controller.cs index f3c9562a35..b4246da210 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Controller.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Controller.cs @@ -23,7 +23,7 @@ namespace BizHawk.Client.Common _type.ControlsFromLog = groups .Select(group => group.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList()) - .ToList();; + .ToList(); } } diff --git a/src/BizHawk.Client.EmuHawk/Input/OTK_Gamepad.cs b/src/BizHawk.Client.EmuHawk/Input/OTK_Gamepad.cs index 82b99c672b..6b4ad1a640 100644 --- a/src/BizHawk.Client.EmuHawk/Input/OTK_Gamepad.cs +++ b/src/BizHawk.Client.EmuHawk/Input/OTK_Gamepad.cs @@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk private static readonly List Devices = new List(); - volatile static bool initialized = false; + private static volatile bool initialized = false; /// Initialization is only called once when MainForm loads public static void Initialize() diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 2bc2dfec67..4869d4ca0d 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -947,9 +947,9 @@ namespace BizHawk.Client.EmuHawk var floats = Input.Instance.GetAxisValues(); foreach (var f in Input.Instance.GetAxisValues()) { - if (f.Item1 == "WMouse X") + if (f.AxisID == "WMouse X") mouseX = f; - else if (f.Item1 == "WMouse Y") + else if (f.AxisID == "WMouse Y") mouseY = f; else conInput.AcceptNewAxes(f); } diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/SavestateLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/SavestateLuaLibrary.cs index 9d1b31d83f..52c8afdf10 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/SavestateLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/SavestateLuaLibrary.cs @@ -17,8 +17,7 @@ namespace BizHawk.Client.EmuHawk public override string Name => "savestate"; [LuaMethodExample("savestate.load( \"C:\\state.bin\" );")] - [LuaMethod("load" - , "Loads a savestate with the given path. If EmuHawk is deferring quicksaves, to TAStudio for example, that form will do what it likes (and the path is ignored).")] + [LuaMethod("load", "Loads a savestate with the given path. If EmuHawk is deferring quicksaves, to TAStudio for example, that form will do what it likes (and the path is ignored).")] public void Load(string path, bool suppressOSD = false) { // TODO: find a non-global way to access LuaImp from Lua libraries! @@ -37,8 +36,7 @@ namespace BizHawk.Client.EmuHawk } [LuaMethodExample("savestate.loadslot( 7 );")] - [LuaMethod("loadslot" - , "Loads the savestate at the given slot number (must be an integer between 0 and 9). If EmuHawk is deferring quicksaves, to TAStudio for example, that form will do what it likes with the slot number.")] + [LuaMethod("loadslot", "Loads the savestate at the given slot number (must be an integer between 0 and 9). If EmuHawk is deferring quicksaves, to TAStudio for example, that form will do what it likes with the slot number.")] public void LoadSlot(int slotNum, bool suppressOSD = false) { // TODO: find a non-global way to access LuaImp from Lua libraries! diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/LibMAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/LibMAME.cs index 3e44733124..f56bcd6c3f 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/LibMAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/LibMAME.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME public enum SaveError { NONE, NOT_FOUND, ILLEGAL_REGISTRATIONS, INVALID_HEADER, READ_ERROR, WRITE_ERROR, DISABLED - }; + } // main launcher [DllImport(dll, CallingConvention = cc)] diff --git a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs index 7e76474994..9c38706ddf 100644 --- a/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs +++ b/src/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Execute.cs @@ -714,7 +714,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502 rdy_freeze = !RDY; if (RDY) { - _link.DummyReadMemory(PC); ; Y--; NZ_Y(); + _link.DummyReadMemory(PC); Y--; NZ_Y(); } } void Imp_INX() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs index d395d60e90..c4a433a94e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA WATCHPOINT_READ = 2, WATCHPOINT_RW = 3, WATCHPOINT_WRITE_CHANGE = 4, - }; + } [StructLayout(LayoutKind.Sequential)] public class OverrideInfo