From 326749498bed4360e5a4b11fc67d5ec7cb9a3076 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Sun, 16 Jul 2023 19:31:14 +0200 Subject: [Ryujinx.HLE] Address dotnet-format issues (#5380) * dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Silence dotnet format IDE0052 warnings * Address or silence dotnet format IDE1006 warnings * Address dotnet format CA1816 warnings * Address or silence dotnet format CA2208 warnings * Address or silence dotnet format CA1806 and a few CA1854 warnings * Address dotnet format CA2211 warnings * Address dotnet format CA1822 warnings * Address or silence dotnet format CA1069 warnings * Make dotnet format succeed in style mode * Address or silence dotnet format CA2211 warnings * Address review comments * Address dotnet format CA2208 warnings properly * Make ProcessResult readonly * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Add previously silenced warnings back I have no clue how these disappeared * Revert formatting changes for while and for-loops * Format if-blocks correctly * Run dotnet format style after rebase * Run dotnet format whitespace after rebase * Run dotnet format style after rebase * Run dotnet format analyzers after rebase * Run dotnet format after rebase and remove unused usings - analyzers - style - whitespace * Disable 'prefer switch expression' rule * Add comments to disabled warnings * Fix a few disabled warnings * Fix naming rule violation, Convert shader properties to auto-property and convert values to const * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Start working on disabled warnings * Fix and silence a few dotnet-format warnings again * Run dotnet format after rebase * Use using declaration instead of block syntax * Address IDE0251 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * First dotnet format pass * Fix naming rule violations * Fix typo * Add trailing commas, use targeted new and use array initializer * Fix build issues * Fix remaining build issues * Remove SuppressMessage for CA1069 where possible * Address dotnet format issues * Address formatting issues Co-authored-by: Ac_K * Add GetHashCode implementation for RenderingSurfaceInfo * Explicitly silence CA1822 for every affected method in Syscall * Address formatting issues in Demangler.cs * Address review feedback Co-authored-by: Ac_K * Revert marking service methods as static * Next dotnet format pass * Address review feedback --------- Co-authored-by: Ac_K --- .../AndroidSurfaceComposerClient.cs | 4 ++-- .../ApplicationDisplayService/IManagerDisplayService.cs | 12 ++++++++---- .../ApplicationDisplayService/ISystemDisplayService.cs | 6 ++++-- .../Types/DestinationScalingMode.cs | 4 ++-- .../ApplicationDisplayService/Types/DisplayInfo.cs | 12 ++++++------ .../ApplicationDisplayService/Types/SourceScalingMode.cs | 4 ++-- 6 files changed, 24 insertions(+), 18 deletions(-) (limited to 'src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService') diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/AndroidSurfaceComposerClient.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/AndroidSurfaceComposerClient.cs index 1fa99e65..782bb7d7 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/AndroidSurfaceComposerClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/AndroidSurfaceComposerClient.cs @@ -1,6 +1,6 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService { - static class AndroidSurfaceComposerClient + class AndroidSurfaceComposerClient { // NOTE: This is android::SurfaceComposerClient::getDisplayInfo. public static (ulong, ulong) GetDisplayInfo(ServiceCtx context, ulong displayId = 0) @@ -16,4 +16,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs index 6093381c..3a08cdd7 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs @@ -4,7 +4,9 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService { class IManagerDisplayService : IpcService { - private IApplicationDisplayService _applicationDisplayService; +#pragma warning disable IDE0052 // Remove unread private member + private readonly IApplicationDisplayService _applicationDisplayService; +#pragma warning restore IDE0052 public IManagerDisplayService(IApplicationDisplayService applicationDisplayService) { @@ -29,8 +31,10 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // CreateManagedLayer(u32, u64, nn::applet::AppletResourceUserId) -> u64 public ResultCode CreateManagedLayer(ServiceCtx context) { - long layerFlags = context.RequestData.ReadInt64(); - long displayId = context.RequestData.ReadInt64(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment + long layerFlags = context.RequestData.ReadInt64(); + long displayId = context.RequestData.ReadInt64(); +#pragma warning restore IDE0059 long appletResourceUserId = context.RequestData.ReadInt64(); ulong pid = context.Device.System.AppletState.AppletResourceUserIds.GetData((int)appletResourceUserId); @@ -77,4 +81,4 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService return ResultCode.Success; } } -} \ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs index a24aa079..12ac2cf4 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs @@ -4,7 +4,9 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService { class ISystemDisplayService : IpcService { - private IApplicationDisplayService _applicationDisplayService; +#pragma warning disable IDE0052 // Remove unread private member + private readonly IApplicationDisplayService _applicationDisplayService; +#pragma warning restore IDE0052 public ISystemDisplayService(IApplicationDisplayService applicationDisplayService) { @@ -56,4 +58,4 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService return ResultCode.Success; } } -} \ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DestinationScalingMode.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DestinationScalingMode.cs index cf459cb2..c712bb1d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DestinationScalingMode.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DestinationScalingMode.cs @@ -6,6 +6,6 @@ ScaleToWindow, ScaleAndCrop, None, - PreserveAspectRatio + PreserveAspectRatio, } -} \ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DisplayInfo.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DisplayInfo.cs index d46206d4..eae8a800 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DisplayInfo.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/DisplayInfo.cs @@ -7,10 +7,10 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService.Type struct DisplayInfo { public Array64 Name; - public bool LayerLimitEnabled; - public Array7 Padding; - public ulong LayerLimitMax; - public ulong Width; - public ulong Height; + public bool LayerLimitEnabled; + public Array7 Padding; + public ulong LayerLimitMax; + public ulong Width; + public ulong Height; } -} \ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/SourceScalingMode.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/SourceScalingMode.cs index ac8c3e02..536c0d46 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/SourceScalingMode.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/Types/SourceScalingMode.cs @@ -6,6 +6,6 @@ Freeze, ScaleToWindow, ScaleAndCrop, - PreserveAspectRatio + PreserveAspectRatio, } -} \ No newline at end of file +} -- cgit v1.2.3