From 7bd74f100422e9aa50629f22218ceede71296509 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 8 Mar 2022 12:04:06 +1000 Subject: [PATCH] Enable SA1133 and fix noncompliance multiple attributes applied in one expression --- Common.ruleset | 2 +- .../tasproj/ZwinderStateManagerSettings.cs | 21 ++++++++++++------- src/BizHawk.Common/Win32/ShellLinkImports.cs | 15 +++++++++---- src/BizHawk.Common/Win32/Win32Imports.cs | 3 ++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Common.ruleset b/Common.ruleset index 5a5937628f..1b8c1706d9 100644 --- a/Common.ruleset +++ b/Common.ruleset @@ -423,7 +423,7 @@ - + diff --git a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs index ac4649875e..73f432e016 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManagerSettings.cs @@ -37,12 +37,14 @@ namespace BizHawk.Client.Common [DisplayName("Current - Buffer Size")] [Description("Max amount of buffer space to use in MB.\n\nThe Current buffer is the primary buffer used near the last edited frame. This should be the largest buffer to ensure minimal gaps during editing.")] - [TypeConverter(typeof(IntConverter)), Range(64, 32768)] + [Range(64, 32768)] + [TypeConverter(typeof(IntConverter))] public int CurrentBufferSize { get; set; } = 256; [DisplayName("Current - Target Frame Length")] [Description("Desired frame length (number of emulated frames you can go back before running out of buffer)\n\nThe Current buffer is the primary buffer used near the last edited frame. This should be the largest buffer to ensure minimal gaps during editing.")] - [TypeConverter(typeof(IntConverter)), Range(1, int.MaxValue)] + [Range(1, int.MaxValue)] + [TypeConverter(typeof(IntConverter))] public int CurrentTargetFrameLength { get; set; } = 500; [DisplayName("Current - Storage Type")] @@ -58,12 +60,14 @@ namespace BizHawk.Client.Common [DisplayName("Recent - Buffer Size")] [Description("Max amount of buffer space to use in MB.\n\nThe Recent buffer is where the current frames decay as the buffer fills up. The goal of this buffer is to maximize the amount of movie that can be fairly quickly navigated to. Therefore, a high target frame length is ideal here.")] - [TypeConverter(typeof(IntConverter)), Range(64, 32768)] + [Range(64, 32768)] + [TypeConverter(typeof(IntConverter))] public int RecentBufferSize { get; set; } = 128; [DisplayName("Recent - Target Frame Length")] [Description("Desired frame length (number of emulated frames you can go back before running out of buffer).\n\nThe Recent buffer is where the current frames decay as the buffer fills up. The goal of this buffer is to maximize the amount of movie that can be fairly quickly navigated to. Therefore, a high target frame length is ideal here.")] - [TypeConverter(typeof(IntConverter)), Range(1, int.MaxValue)] + [Range(1, int.MaxValue)] + [TypeConverter(typeof(IntConverter))] public int RecentTargetFrameLength { get; set; } = 2000; [DisplayName("Recent - Storage Type")] @@ -79,12 +83,14 @@ namespace BizHawk.Client.Common [DisplayName("Gaps - Buffer Size")] [Description("Max amount of buffer space to use in MB\n\nThe Gap buffer is used for temporary storage when replaying older segment of the run without editing. It is used to 're-greenzone' large gaps while navigating around in an older area of the movie. This buffer can be small, and a similar size to target frame length ratio as current is ideal.")] - [TypeConverter(typeof(IntConverter)), Range(64, 32768)] + [Range(64, 32768)] + [TypeConverter(typeof(IntConverter))] public int GapsBufferSize { get; set; } = 64; [DisplayName("Gaps - Target Frame Length")] [Description("Desired frame length (number of emulated frames you can go back before running out of buffer)\n\nThe Gap buffer is used for temporary storage when replaying older segment of the run without editing. It is used to 're-greenzone' large gaps while navigating around in an older area of the movie. This buffer can be small, and a similar size to target frame length ratio as current is ideal.")] - [TypeConverter(typeof(IntConverter)), Range(1, int.MaxValue)] + [Range(1, int.MaxValue)] + [TypeConverter(typeof(IntConverter))] public int GapsTargetFrameLength { get; set; } = 125; [DisplayName("Gaps - Storage Type")] @@ -93,7 +99,8 @@ namespace BizHawk.Client.Common [DisplayName("Ancient State Interval")] [Description("Once both the Current and Recent buffers have filled, some states are put into reserved to ensure there is always a state somewhat near a desired frame to navigate to. These states never decay but are invalidated. This number should be as high as possible without being overly cumbersome to replay this many frames.")] - [TypeConverter(typeof(IntConverter)), Range(1, int.MaxValue)] + [Range(1, int.MaxValue)] + [TypeConverter(typeof(IntConverter))] public int AncientStateInterval { get; set; } = 5000; [DisplayName("Ancient - Storage Type")] diff --git a/src/BizHawk.Common/Win32/ShellLinkImports.cs b/src/BizHawk.Common/Win32/ShellLinkImports.cs index ec1d0c5166..de3645267c 100644 --- a/src/BizHawk.Common/Win32/ShellLinkImports.cs +++ b/src/BizHawk.Common/Win32/ShellLinkImports.cs @@ -30,7 +30,9 @@ namespace BizHawk.Common public enum SLR_FLAGS {} /// The IShellLink interface allows Shell links to be created, modified, and resolved - [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("000214F9-0000-0000-C000-000000000046")] + [ComImport] + [Guid("000214F9-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IShellLinkW { /// Retrieves the path and file name of a Shell link object @@ -71,14 +73,18 @@ namespace BizHawk.Common void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile); } - [ComImport, Guid("0000010c-0000-0000-c000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + [Guid("0000010c-0000-0000-c000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IPersist { [PreserveSig] void GetClassID(out Guid pClassID); } - [ComImport, Guid("0000010b-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + [Guid("0000010b-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IPersistFile : IPersist { new void GetClassID(out Guid pClassID); @@ -100,7 +106,8 @@ namespace BizHawk.Common } /// CLSID_ShellLink from ShlGuid.h - [ComImport, Guid("00021401-0000-0000-C000-000000000046")] + [ComImport] + [Guid("00021401-0000-0000-C000-000000000046")] public class ShellLink /* : IPersistFile, IShellLinkW */ {} } } diff --git a/src/BizHawk.Common/Win32/Win32Imports.cs b/src/BizHawk.Common/Win32/Win32Imports.cs index 82c8778c74..beb12314a7 100644 --- a/src/BizHawk.Common/Win32/Win32Imports.cs +++ b/src/BizHawk.Common/Win32/Win32Imports.cs @@ -85,7 +85,8 @@ namespace BizHawk.Common } } - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00000002-0000-0000-C000-000000000046")] + [Guid("00000002-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IMalloc { [PreserveSig] IntPtr Alloc([In] int cb);