[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 <acoustik666@gmail.com>

* 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 <acoustik666@gmail.com>

* Revert marking service methods as static

* Next dotnet format pass

* Address review feedback

---------

Co-authored-by: Ac_K <acoustik666@gmail.com>
This commit is contained in:
TSRBerry
2023-07-16 19:31:14 +02:00
committed by GitHub
parent fec8291c17
commit 326749498b
1015 changed files with 8173 additions and 7615 deletions

View File

@@ -5,4 +5,4 @@
{
public IBoardPowerControlManager(ServiceCtx context) { }
}
}
}

View File

@@ -6,32 +6,33 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager
{
class IClkrstSession : IpcService
{
private DeviceCode _deviceCode;
private uint _unknown;
private uint _clockRate;
private readonly DeviceCode _deviceCode;
#pragma warning disable IDE0052 // Remove unread private member
private readonly uint _unknown;
#pragma warning restore IDE0052
private uint _clockRate;
private DeviceCode[] allowedDeviceCodeTable = new DeviceCode[]
{
private readonly DeviceCode[] _allowedDeviceCodeTable = {
DeviceCode.Cpu, DeviceCode.Gpu, DeviceCode.Disp1, DeviceCode.Disp2,
DeviceCode.Tsec, DeviceCode.Mselect, DeviceCode.Sor1, DeviceCode.Host1x,
DeviceCode.Vic, DeviceCode.Nvenc, DeviceCode.Nvjpg, DeviceCode.Nvdec,
DeviceCode.Ape, DeviceCode.AudioDsp, DeviceCode.Emc, DeviceCode.Dsi,
DeviceCode.SysBus, DeviceCode.XusbSs, DeviceCode.XusbHost, DeviceCode.XusbDevice,
DeviceCode.Gpuaux, DeviceCode.Pcie, DeviceCode.Apbdma, DeviceCode.Sdmmc1,
DeviceCode.Sdmmc2, DeviceCode.Sdmmc4
DeviceCode.Gpuaux, DeviceCode.Pcie, DeviceCode.Apbdma, DeviceCode.Sdmmc1,
DeviceCode.Sdmmc2, DeviceCode.Sdmmc4,
};
public IClkrstSession(DeviceCode deviceCode, uint unknown)
{
_deviceCode = deviceCode;
_unknown = unknown;
_unknown = unknown;
}
[CommandCmif(7)]
// SetClockRate(u32 hz)
public ResultCode SetClockRate(ServiceCtx context)
{
if (!allowedDeviceCodeTable.Contains(_deviceCode))
if (!_allowedDeviceCodeTable.Contains(_deviceCode))
{
return ResultCode.InvalidArgument;
}
@@ -47,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager
// GetClockRate() -> u32 hz
public ResultCode GetClockRate(ServiceCtx context)
{
if (!allowedDeviceCodeTable.Contains(_deviceCode))
if (!_allowedDeviceCodeTable.Contains(_deviceCode))
{
return ResultCode.InvalidArgument;
}
@@ -59,4 +60,4 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager
return ResultCode.Success;
}
}
}
}

View File

@@ -5,4 +5,4 @@
{
public IArbitrationManager(ServiceCtx context) { }
}
}
}

View File

@@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst
public ResultCode OpenSession(ServiceCtx context)
{
DeviceCode deviceCode = (DeviceCode)context.RequestData.ReadUInt32();
uint unknown = context.RequestData.ReadUInt32();
uint unknown = context.RequestData.ReadUInt32();
// TODO: Service checks the deviceCode and the unk value.
@@ -54,4 +54,4 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst
return ResultCode.Success;
}
}
}
}

View File

@@ -5,4 +5,4 @@
{
public IPcvService(ServiceCtx context) { }
}
}
}

View File

@@ -2,11 +2,11 @@ namespace Ryujinx.HLE.HOS.Services.Pcv
{
enum ResultCode
{
ModuleId = 30,
ModuleId = 30,
ErrorCodeShift = 9,
Success = 0,
InvalidArgument = (5 << ErrorCodeShift) | ModuleId
InvalidArgument = (5 << ErrorCodeShift) | ModuleId,
}
}
}

View File

@@ -5,4 +5,4 @@
{
public IRegulatorManager(ServiceCtx context) { }
}
}
}

View File

@@ -5,4 +5,4 @@
{
public IRtcManager(ServiceCtx context) { }
}
}
}

View File

@@ -2,93 +2,93 @@
{
enum DeviceCode
{
Cpu = 0x40000001,
Gpu = 0x40000002,
I2s1 = 0x40000003,
I2s2 = 0x40000004,
I2s3 = 0x40000005,
Pwm = 0x40000006,
I2c1 = 0x02000001,
I2c2 = 0x02000002,
I2c3 = 0x02000003,
I2c4 = 0x02000004,
I2c5 = 0x02000005,
I2c6 = 0x02000006,
Spi1 = 0x07000000,
Spi2 = 0x07000001,
Spi3 = 0x07000002,
Spi4 = 0x07000003,
Disp1 = 0x40000011,
Disp2 = 0x40000012,
Isp = 0x40000013,
Vi = 0x40000014,
Sdmmc1 = 0x40000015,
Sdmmc2 = 0x40000016,
Sdmmc3 = 0x40000017,
Sdmmc4 = 0x40000018,
Owr = 0x40000019,
Csite = 0x4000001A,
Tsec = 0x4000001B,
Mselect = 0x4000001C,
Hda2codec2x = 0x4000001D,
Actmon = 0x4000001E,
I2cSlow = 0x4000001F,
Sor1 = 0x40000020,
Sata = 0x40000021,
Hda = 0x40000022,
Cpu = 0x40000001,
Gpu = 0x40000002,
I2s1 = 0x40000003,
I2s2 = 0x40000004,
I2s3 = 0x40000005,
Pwm = 0x40000006,
I2c1 = 0x02000001,
I2c2 = 0x02000002,
I2c3 = 0x02000003,
I2c4 = 0x02000004,
I2c5 = 0x02000005,
I2c6 = 0x02000006,
Spi1 = 0x07000000,
Spi2 = 0x07000001,
Spi3 = 0x07000002,
Spi4 = 0x07000003,
Disp1 = 0x40000011,
Disp2 = 0x40000012,
Isp = 0x40000013,
Vi = 0x40000014,
Sdmmc1 = 0x40000015,
Sdmmc2 = 0x40000016,
Sdmmc3 = 0x40000017,
Sdmmc4 = 0x40000018,
Owr = 0x40000019,
Csite = 0x4000001A,
Tsec = 0x4000001B,
Mselect = 0x4000001C,
Hda2codec2x = 0x4000001D,
Actmon = 0x4000001E,
I2cSlow = 0x4000001F,
Sor1 = 0x40000020,
Sata = 0x40000021,
Hda = 0x40000022,
XusbCoreHostSrc = 0x40000023,
XusbFalconSrc = 0x40000024,
XusbFsSrc = 0x40000025,
XusbCoreDevSrc = 0x40000026,
XusbSsSrc = 0x40000027,
UartA = 0x03000001,
UartB = 0x35000405,
UartC = 0x3500040F,
UartD = 0x37000001,
Host1x = 0x4000002C,
Entropy = 0x4000002D,
SocTherm = 0x4000002E,
Vic = 0x4000002F,
Nvenc = 0x40000030,
Nvjpg = 0x40000031,
Nvdec = 0x40000032,
Qspi = 0x40000033,
ViI2c = 0x40000034,
Tsecb = 0x40000035,
Ape = 0x40000036,
AudioDsp = 0x40000037,
AudioUart = 0x40000038,
Emc = 0x40000039,
Plle = 0x4000003A,
PlleHwSeq = 0x4000003B,
Dsi = 0x4000003C,
Maud = 0x4000003D,
Dpaux1 = 0x4000003E,
MipiCal = 0x4000003F,
UartFstMipiCal = 0x40000040,
Osc = 0x40000041,
SysBus = 0x40000042,
SorSafe = 0x40000043,
XusbSs = 0x40000044,
XusbHost = 0x40000045,
XusbDevice = 0x40000046,
Extperiph1 = 0x40000047,
Ahub = 0x40000048,
Hda2hdmicodec = 0x40000049,
Gpuaux = 0x4000004A,
UsbD = 0x4000004B,
Usb2 = 0x4000004C,
Pcie = 0x4000004D,
Afi = 0x4000004E,
PciExClk = 0x4000004F,
PExUsbPhy = 0x40000050,
XUsbPadCtl = 0x40000051,
Apbdma = 0x40000052,
Usb2TrkClk = 0x40000053,
XUsbIoPll = 0x40000054,
XUsbIoPllHwSeq = 0x40000055,
Cec = 0x40000056,
Extperiph2 = 0x40000057,
OscClk = 0x40000080
XusbFalconSrc = 0x40000024,
XusbFsSrc = 0x40000025,
XusbCoreDevSrc = 0x40000026,
XusbSsSrc = 0x40000027,
UartA = 0x03000001,
UartB = 0x35000405,
UartC = 0x3500040F,
UartD = 0x37000001,
Host1x = 0x4000002C,
Entropy = 0x4000002D,
SocTherm = 0x4000002E,
Vic = 0x4000002F,
Nvenc = 0x40000030,
Nvjpg = 0x40000031,
Nvdec = 0x40000032,
Qspi = 0x40000033,
ViI2c = 0x40000034,
Tsecb = 0x40000035,
Ape = 0x40000036,
AudioDsp = 0x40000037,
AudioUart = 0x40000038,
Emc = 0x40000039,
Plle = 0x4000003A,
PlleHwSeq = 0x4000003B,
Dsi = 0x4000003C,
Maud = 0x4000003D,
Dpaux1 = 0x4000003E,
MipiCal = 0x4000003F,
UartFstMipiCal = 0x40000040,
Osc = 0x40000041,
SysBus = 0x40000042,
SorSafe = 0x40000043,
XusbSs = 0x40000044,
XusbHost = 0x40000045,
XusbDevice = 0x40000046,
Extperiph1 = 0x40000047,
Ahub = 0x40000048,
Hda2hdmicodec = 0x40000049,
Gpuaux = 0x4000004A,
UsbD = 0x4000004B,
Usb2 = 0x4000004C,
Pcie = 0x4000004D,
Afi = 0x4000004E,
PciExClk = 0x4000004F,
PExUsbPhy = 0x40000050,
XUsbPadCtl = 0x40000051,
Apbdma = 0x40000052,
Usb2TrkClk = 0x40000053,
XUsbIoPll = 0x40000054,
XUsbIoPllHwSeq = 0x40000055,
Cec = 0x40000056,
Extperiph2 = 0x40000057,
OscClk = 0x40000080,
}
}
}