From bfa21358af1affd868e37344b11f95dcea817a54 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Sun, 22 Dec 2024 10:25:11 -0300 Subject: [PATCH] Do not initialize unnecessarily --- .../CodeGen/Arm64/HardwareCapabilities.cs | 6 ++--- .../RegisterAllocators/CopyResolver.cs | 6 ++--- .../CodeGen/X86/HardwareCapabilities.cs | 6 ++--- src/ARMeilleure/Decoders/OpCode32.cs | 2 +- src/ARMeilleure/Optimizations.cs | 2 +- src/ARMeilleure/State/NativeContext.cs | 2 +- .../Translation/ArmEmitterContext.cs | 2 +- src/ARMeilleure/Translation/IntervalTree.cs | 10 ++++---- .../PreciseSleep/WindowsSleepEvent.cs | 2 +- .../Utilities/XCIFileTrimmer.cs | 4 ++-- src/Ryujinx.Cpu/AppleHv/HvVcpu.cs | 2 +- .../LightningJit/State/NativeContext.cs | 2 +- .../Multithreading/BufferMap.cs | 2 +- .../Multithreading/ThreadedRenderer.cs | 2 +- .../Engine/Threed/ConstantBufferUpdater.cs | 8 +++---- .../Engine/Threed/DrawState.cs | 2 +- src/Ryujinx.Graphics.Gpu/GraphicsConfig.cs | 4 ++-- src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 4 ++-- .../Memory/MultiRangeBuffer.cs | 2 +- src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs | 2 +- .../Queries/CounterQueueEvent.cs | 2 +- src/Ryujinx.Graphics.OpenGL/Sync.cs | 2 +- src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs | 2 +- .../FileSystem/VirtualFileSystem.cs | 2 +- .../SoftwareKeyboardApplet.cs | 12 +++++----- .../SoftwareKeyboardRendererBase.cs | 14 +++++------ .../SoftwareKeyboardUIState.cs | 14 +++++------ .../Applets/SoftwareKeyboard/TimedAction.cs | 4 ++-- .../SystemAppletProxy/ISelfController.cs | 24 +++++++++---------- .../HOS/Services/Apm/PerformanceState.cs | 2 +- .../Services/Fs/FileSystemProxy/LazyFile.cs | 2 +- .../Services/Hid/HidDevices/NpadDevices.cs | 2 +- .../HOS/Services/Hid/Irs/IIrSensorServer.cs | 2 +- .../Services/Ldn/Lp2p/ISfServiceMonitor.cs | 4 ++-- .../Ldn/UserServiceCreator/AccessPoint.cs | 2 +- .../LdnRyu/LdnMasterProxyClient.cs | 2 +- .../LdnRyu/RyuLdnProtocol.cs | 2 +- .../Ldn/UserServiceCreator/Station.cs | 2 +- .../HOS/Services/Mii/MiiDatabaseManager.cs | 4 ++-- .../Nifm/StaticService/IGeneralService.cs | 6 ++--- .../HOS/Services/Nv/INvDrvServices.cs | 4 ++-- .../IParentalControlService.cs | 8 +++---- .../HOS/Services/Pcv/Clkrst/IClkrstManager.cs | 2 +- src/Ryujinx.HLE/HOS/Services/ServerBase.cs | 4 ++-- .../Sockets/Bsd/Impl/ManagedSocket.cs | 2 +- .../HOS/Services/Sockets/Nsd/IManager.cs | 2 +- .../SurfaceFlinger/HOSBinderDriverServer.cs | 2 +- .../HOS/Services/Time/IStaticServiceForPsc.cs | 2 +- .../HOS/Tamper/AtmosphereProgram.cs | 2 +- src/Ryujinx.HLE/HOS/Tamper/Register.cs | 2 +- .../HOS/Tamper/TamperedKProcess.cs | 2 +- src/Ryujinx.HLE/HOS/TamperMachine.cs | 4 ++-- src/Ryujinx.HLE/Switch.cs | 2 +- src/Ryujinx.Headless.SDL2/WindowBase.cs | 2 +- src/Ryujinx.Memory/Tracking/RegionHandle.cs | 4 ++-- .../MockVirtualMemoryManager.cs | 2 +- src/Ryujinx.Tests/Cpu/CpuTest.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestMisc.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimd.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs | 6 ++--- src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs | 6 ++--- src/Ryujinx/AppHost.cs | 4 ++-- src/Ryujinx/UI/Models/CheatNode.cs | 2 +- .../DownloadableContentManagerViewModel.cs | 2 +- .../UI/ViewModels/TitleUpdateViewModel.cs | 2 +- 72 files changed, 153 insertions(+), 153 deletions(-) diff --git a/src/ARMeilleure/CodeGen/Arm64/HardwareCapabilities.cs b/src/ARMeilleure/CodeGen/Arm64/HardwareCapabilities.cs index 639e4476b..d1d22904b 100644 --- a/src/ARMeilleure/CodeGen/Arm64/HardwareCapabilities.cs +++ b/src/ARMeilleure/CodeGen/Arm64/HardwareCapabilities.cs @@ -119,8 +119,8 @@ namespace ARMeilleure.CodeGen.Arm64 Sve2p1 = 1UL << 36, } - public static LinuxFeatureFlagsHwCap LinuxFeatureInfoHwCap { get; } = 0; - public static LinuxFeatureFlagsHwCap2 LinuxFeatureInfoHwCap2 { get; } = 0; + public static LinuxFeatureFlagsHwCap LinuxFeatureInfoHwCap { get; } + public static LinuxFeatureFlagsHwCap2 LinuxFeatureInfoHwCap2 { get; } #endregion @@ -167,7 +167,7 @@ namespace ARMeilleure.CodeGen.Arm64 Sha256 = 1 << 8, } - public static MacOsFeatureFlags MacOsFeatureInfo { get; } = 0; + public static MacOsFeatureFlags MacOsFeatureInfo { get; } #endregion diff --git a/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs b/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs index af10330ba..cf3b128af 100644 --- a/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs +++ b/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs @@ -146,9 +146,9 @@ namespace ARMeilleure.CodeGen.RegisterAllocators } } - private Queue _fillQueue = null; - private Queue _spillQueue = null; - private ParallelCopy _parallelCopy = null; + private Queue _fillQueue; + private Queue _spillQueue; + private ParallelCopy _parallelCopy; public bool HasCopy { get; private set; } diff --git a/src/ARMeilleure/CodeGen/X86/HardwareCapabilities.cs b/src/ARMeilleure/CodeGen/X86/HardwareCapabilities.cs index 4f6f1e87b..bcc984705 100644 --- a/src/ARMeilleure/CodeGen/X86/HardwareCapabilities.cs +++ b/src/ARMeilleure/CodeGen/X86/HardwareCapabilities.cs @@ -111,9 +111,9 @@ namespace ARMeilleure.CodeGen.X86 public static FeatureFlags1Edx FeatureInfo1Edx { get; } public static FeatureFlags1Ecx FeatureInfo1Ecx { get; } - public static FeatureFlags7Ebx FeatureInfo7Ebx { get; } = 0; - public static FeatureFlags7Ecx FeatureInfo7Ecx { get; } = 0; - public static Xcr0FlagsEax Xcr0InfoEax { get; } = 0; + public static FeatureFlags7Ebx FeatureInfo7Ebx { get; } + public static FeatureFlags7Ecx FeatureInfo7Ecx { get; } + public static Xcr0FlagsEax Xcr0InfoEax { get; } public static bool SupportsSse => FeatureInfo1Edx.HasFlag(FeatureFlags1Edx.Sse); public static bool SupportsSse2 => FeatureInfo1Edx.HasFlag(FeatureFlags1Edx.Sse2); diff --git a/src/ARMeilleure/Decoders/OpCode32.cs b/src/ARMeilleure/Decoders/OpCode32.cs index a2be01e9a..2fcf10077 100644 --- a/src/ARMeilleure/Decoders/OpCode32.cs +++ b/src/ARMeilleure/Decoders/OpCode32.cs @@ -13,7 +13,7 @@ namespace ARMeilleure.Decoders Cond = (Condition)((uint)opCode >> 28); } - public bool IsThumb { get; protected init; } = false; + public bool IsThumb { get; protected init; } public uint GetPc() { diff --git a/src/ARMeilleure/Optimizations.cs b/src/ARMeilleure/Optimizations.cs index 18390de31..ea97e6086 100644 --- a/src/ARMeilleure/Optimizations.cs +++ b/src/ARMeilleure/Optimizations.cs @@ -6,7 +6,7 @@ namespace ARMeilleure public static class Optimizations { // low-core count PPTC - public static bool LowPower { get; set; } = false; + public static bool LowPower { get; set; } public static bool FastFP { get; set; } = true; diff --git a/src/ARMeilleure/State/NativeContext.cs b/src/ARMeilleure/State/NativeContext.cs index 140b6f7a7..d2a2782a3 100644 --- a/src/ARMeilleure/State/NativeContext.cs +++ b/src/ARMeilleure/State/NativeContext.cs @@ -24,7 +24,7 @@ namespace ARMeilleure.State public long Tpidr2El0; } - private static NativeCtxStorage _dummyStorage = new(); + private static NativeCtxStorage _dummyStorage; private readonly IJitMemoryBlock _block; diff --git a/src/ARMeilleure/Translation/ArmEmitterContext.cs b/src/ARMeilleure/Translation/ArmEmitterContext.cs index 82f12bb02..3424eb018 100644 --- a/src/ARMeilleure/Translation/ArmEmitterContext.cs +++ b/src/ARMeilleure/Translation/ArmEmitterContext.cs @@ -54,7 +54,7 @@ namespace ARMeilleure.Translation public bool HasPtc { get; } public Aarch32Mode Mode { get; } - private int _ifThenBlockStateIndex = 0; + private int _ifThenBlockStateIndex; private Condition[] _ifThenBlockState = Array.Empty(); public bool IsInIfThenBlock => _ifThenBlockStateIndex < _ifThenBlockState.Length; public Condition CurrentIfThenBlockCond => _ifThenBlockState[_ifThenBlockStateIndex]; diff --git a/src/ARMeilleure/Translation/IntervalTree.cs b/src/ARMeilleure/Translation/IntervalTree.cs index a5f9b5d5e..f46c9a3e2 100644 --- a/src/ARMeilleure/Translation/IntervalTree.cs +++ b/src/ARMeilleure/Translation/IntervalTree.cs @@ -14,8 +14,8 @@ namespace ARMeilleure.Translation private const bool Black = true; private const bool Red = false; - private IntervalTreeNode _root = null; - private int _count = 0; + private IntervalTreeNode _root; + private int _count; public int Count => _count; @@ -709,9 +709,9 @@ namespace ARMeilleure.Translation class IntervalTreeNode { public bool Color = true; - public IntervalTreeNode Left = null; - public IntervalTreeNode Right = null; - public IntervalTreeNode Parent = null; + public IntervalTreeNode Left; + public IntervalTreeNode Right; + public IntervalTreeNode Parent; /// /// The start of the range. diff --git a/src/Ryujinx.Common/PreciseSleep/WindowsSleepEvent.cs b/src/Ryujinx.Common/PreciseSleep/WindowsSleepEvent.cs index 87c10d18e..4010ef5fb 100644 --- a/src/Ryujinx.Common/PreciseSleep/WindowsSleepEvent.cs +++ b/src/Ryujinx.Common/PreciseSleep/WindowsSleepEvent.cs @@ -34,7 +34,7 @@ namespace Ryujinx.Common.PreciseSleep /// /// Set to true to disable timepoint realignment. /// - public bool Precise { get; set; } = false; + public bool Precise { get; set; } public long AdjustTimePoint(long timePoint, long timeoutNs) { diff --git a/src/Ryujinx.Common/Utilities/XCIFileTrimmer.cs b/src/Ryujinx.Common/Utilities/XCIFileTrimmer.cs index 050e78d1e..246b52e26 100644 --- a/src/Ryujinx.Common/Utilities/XCIFileTrimmer.cs +++ b/src/Ryujinx.Common/Utilities/XCIFileTrimmer.cs @@ -70,8 +70,8 @@ namespace Ryujinx.Common.Utilities private BinaryReader _binaryReader; private long _offsetB, _dataSizeB, _cartSizeB, _fileSizeB; private bool _fileOK = true; - private bool _freeSpaceChecked = false; - private bool _freeSpaceValid = false; + private bool _freeSpaceChecked; + private bool _freeSpaceValid; public enum OperationOutcome { diff --git a/src/Ryujinx.Cpu/AppleHv/HvVcpu.cs b/src/Ryujinx.Cpu/AppleHv/HvVcpu.cs index ee91c478b..1b7b96b0f 100644 --- a/src/Ryujinx.Cpu/AppleHv/HvVcpu.cs +++ b/src/Ryujinx.Cpu/AppleHv/HvVcpu.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Cpu.AppleHv { private const ulong InterruptIntervalNs = 16 * 1000000; // 16 ms - private static ulong _interruptTimeDeltaTicks = 0; + private static ulong _interruptTimeDeltaTicks; public readonly ulong Handle; public readonly HvVcpuExit* ExitInfo; diff --git a/src/Ryujinx.Cpu/LightningJit/State/NativeContext.cs b/src/Ryujinx.Cpu/LightningJit/State/NativeContext.cs index 9895c78c2..0111ea5f2 100644 --- a/src/Ryujinx.Cpu/LightningJit/State/NativeContext.cs +++ b/src/Ryujinx.Cpu/LightningJit/State/NativeContext.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Cpu.LightningJit.State public int Running; } - private static NativeCtxStorage _dummyStorage = new(); + private static NativeCtxStorage _dummyStorage; private readonly IJitMemoryBlock _block; diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs b/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs index e8eec123a..6b82ae528 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs @@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading /// class BufferMap { - private ulong _bufferHandle = 0; + private ulong _bufferHandle; private readonly Dictionary _bufferMap = new(); private readonly HashSet _inFlight = new(); diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs b/src/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs index 6375d290c..8a23f4d88 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs @@ -55,7 +55,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading private int _refProducerPtr; private int _refConsumerPtr; - public uint ProgramCount { get; set; } = 0; + public uint ProgramCount { get; set; } private Action _interruptAction; private readonly Lock _interruptLock = new(); diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/ConstantBufferUpdater.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/ConstantBufferUpdater.cs index 2095fcd7a..b7fffac64 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/ConstantBufferUpdater.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/ConstantBufferUpdater.cs @@ -15,10 +15,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed // State associated with direct uniform buffer updates. // This state is used to attempt to batch together consecutive updates. - private ulong _ubBeginCpuAddress = 0; - private ulong _ubFollowUpAddress = 0; - private ulong _ubByteCount = 0; - private int _ubIndex = 0; + private ulong _ubBeginCpuAddress; + private ulong _ubFollowUpAddress; + private ulong _ubByteCount; + private int _ubIndex; private readonly int[] _ubData = new int[UniformDataCacheSize]; /// diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/DrawState.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/DrawState.cs index 03b5e3f3b..12d76655b 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/DrawState.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/DrawState.cs @@ -61,7 +61,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed /// /// Index buffer data streamer for inline index buffer updates, such as those used in legacy OpenGL. /// - public IbStreamer IbStreamer = new(); + public IbStreamer IbStreamer; /// /// If the vertex shader is emulated on compute, this should be set to the compute program, otherwise it should be null. diff --git a/src/Ryujinx.Graphics.Gpu/GraphicsConfig.cs b/src/Ryujinx.Graphics.Gpu/GraphicsConfig.cs index fbb7399ca..6ae9c9be1 100644 --- a/src/Ryujinx.Graphics.Gpu/GraphicsConfig.cs +++ b/src/Ryujinx.Graphics.Gpu/GraphicsConfig.cs @@ -66,12 +66,12 @@ namespace Ryujinx.Graphics.Gpu /// /// Enables or disables recompression of compressed textures that are not natively supported by the host. /// - public static bool EnableTextureRecompression = false; + public static bool EnableTextureRecompression; /// /// Enables or disables color space passthrough, if available. /// - public static bool EnableColorSpacePassthrough = false; + public static bool EnableColorSpacePassthrough; } #pragma warning restore CA2211 } diff --git a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index e060e0b4f..7e5946d59 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -60,13 +60,13 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// This is null until at least one modification occurs. /// - private BufferModifiedRangeList _modifiedRanges = null; + private BufferModifiedRangeList _modifiedRanges; /// /// A structure that is used to flush buffer data back to a host mapped buffer for cached readback. /// Only used if the buffer data is explicitly owned by device local memory. /// - private BufferPreFlush _preFlush = null; + private BufferPreFlush _preFlush; /// /// Usage tracking state that determines what type of backing the buffer should use. diff --git a/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs index d92b0836e..567baf8e1 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs @@ -69,7 +69,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } private List _dependencies; - private BufferModifiedRangeList _modifiedRanges = null; + private BufferModifiedRangeList _modifiedRanges; /// /// Creates a new instance of the buffer. diff --git a/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs b/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs index 6ead314fd..0860e4330 100644 --- a/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs +++ b/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs @@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.OpenGL private readonly Sync _sync; - public uint ProgramCount { get; set; } = 0; + public uint ProgramCount { get; set; } public event EventHandler ScreenCaptured; diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs index 889517480..78b94342c 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries private readonly CounterQueue _queue; private readonly BufferedQuery _counter; - private bool _hostAccessReserved = false; + private bool _hostAccessReserved; private int _refCount = 1; // Starts with a reference from the counter queue. private readonly Lock _lock = new(); diff --git a/src/Ryujinx.Graphics.OpenGL/Sync.cs b/src/Ryujinx.Graphics.OpenGL/Sync.cs index e8f7ebc00..c9fe97a79 100644 --- a/src/Ryujinx.Graphics.OpenGL/Sync.cs +++ b/src/Ryujinx.Graphics.OpenGL/Sync.cs @@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.OpenGL public nint Handle; } - private ulong _firstHandle = 0; + private ulong _firstHandle; private static ClientWaitSyncFlags SyncFlags => HwCapabilities.RequiresSyncFlush ? ClientWaitSyncFlags.None : ClientWaitSyncFlags.SyncFlushCommandsBit; private readonly List _handles = new(); diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs index ad4b18e50..a5fc3277f 100644 --- a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs +++ b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs @@ -28,7 +28,7 @@ namespace Ryujinx.Graphics.Vulkan private bool _initialized; - public uint ProgramCount { get; set; } = 0; + public uint ProgramCount { get; set; } internal FormatCapabilities FormatCapabilities { get; private set; } internal HardwareCapabilities Capabilities; diff --git a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index ef9c493a8..fa33b65e6 100644 --- a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -38,7 +38,7 @@ namespace Ryujinx.HLE.FileSystem private readonly ConcurrentDictionary _romFsByPid; - private static bool _isInitialized = false; + private static bool _isInitialized; public static VirtualFileSystem CreateInstance() { diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs index 8fda00a7d..856bb976e 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs @@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Applets private SoftwareKeyboardState _foregroundState = SoftwareKeyboardState.Uninitialized; private volatile InlineKeyboardState _backgroundState = InlineKeyboardState.Uninitialized; - private bool _isBackground = false; + private bool _isBackground; private AppletSession _normalSession; private AppletSession _interactiveSession; @@ -53,14 +53,14 @@ namespace Ryujinx.HLE.HOS.Applets private byte[] _transferMemory; private string _textValue = string.Empty; - private int _cursorBegin = 0; + private int _cursorBegin; private Encoding _encoding = Encoding.Unicode; private KeyboardResult _lastResult = KeyboardResult.NotSet; - private IDynamicTextInputHandler _dynamicTextInputHandler = null; - private SoftwareKeyboardRenderer _keyboardRenderer = null; - private NpadReader _npads = null; - private bool _canAcceptController = false; + private IDynamicTextInputHandler _dynamicTextInputHandler; + private SoftwareKeyboardRenderer _keyboardRenderer; + private NpadReader _npads; + private bool _canAcceptController; private KeyboardInputMode _inputMode = KeyboardInputMode.ControllerAndKeyboard; private readonly Lock _lock = new(); diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs index e17b36911..fbcb2ee6f 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs @@ -24,15 +24,15 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard private readonly Lock _bufferLock = new(); - private RenderingSurfaceInfo _surfaceInfo = null; + private RenderingSurfaceInfo _surfaceInfo; private SKImageInfo _imageInfo; - private SKSurface _surface = null; - private byte[] _bufferData = null; + private SKSurface _surface; + private byte[] _bufferData; - private readonly SKBitmap _ryujinxLogo = null; - private readonly SKBitmap _padAcceptIcon = null; - private readonly SKBitmap _padCancelIcon = null; - private readonly SKBitmap _keyModeIcon = null; + private readonly SKBitmap _ryujinxLogo; + private readonly SKBitmap _padAcceptIcon; + private readonly SKBitmap _padCancelIcon; + private readonly SKBitmap _keyModeIcon; private readonly float _textBoxOutlineWidth; private readonly float _padPressedPenWidth; diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardUIState.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardUIState.cs index da5220364..a4a8a2031 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardUIState.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardUIState.cs @@ -8,15 +8,15 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard internal class SoftwareKeyboardUIState { public string InputText = string.Empty; - public int CursorBegin = 0; - public int CursorEnd = 0; - public bool AcceptPressed = false; - public bool CancelPressed = false; - public bool OverwriteMode = false; + public int CursorBegin; + public int CursorEnd; + public bool AcceptPressed; + public bool CancelPressed; + public bool OverwriteMode; public bool TypingEnabled = true; public bool ControllerEnabled = true; - public int TextBoxBlinkCounter = 0; + public int TextBoxBlinkCounter; - public RenderingSurfaceInfo SurfaceInfo = null; + public RenderingSurfaceInfo SurfaceInfo; } } diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs index a8b137df2..089a245b6 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs @@ -25,8 +25,8 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard } } - private TRef _cancelled = null; - private Thread _thread = null; + private TRef _cancelled; + private Thread _thread; private readonly Lock _lock = new(); public bool IsRunning diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs index 8e0f515ba..22bd5267f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs +++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs @@ -22,25 +22,25 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys private int _fatalSectionCount; // TODO: Set this when the game goes in suspension (go back to home menu ect), we currently don't support that so we can keep it set to 0. - private readonly ulong _accumulatedSuspendedTickValue = 0; + private readonly ulong _accumulatedSuspendedTickValue; // TODO: Determine where those fields are used. #pragma warning disable IDE0052 // Remove unread private member - private bool _screenShotPermission = false; - private bool _operationModeChangedNotification = false; - private bool _performanceModeChangedNotification = false; - private bool _restartMessageEnabled = false; - private bool _outOfFocusSuspendingEnabled = false; - private bool _handlesRequestToDisplay = false; + private bool _screenShotPermission; + private bool _operationModeChangedNotification; + private bool _performanceModeChangedNotification; + private bool _restartMessageEnabled; + private bool _outOfFocusSuspendingEnabled; + private bool _handlesRequestToDisplay; #pragma warning restore IDE0052 - private bool _autoSleepDisabled = false; + private bool _autoSleepDisabled; #pragma warning disable IDE0052 // Remove unread private member - private bool _albumImageTakenNotificationEnabled = false; - private bool _recordVolumeMuted = false; + private bool _albumImageTakenNotificationEnabled; + private bool _recordVolumeMuted; - private uint _screenShotImageOrientation = 0; + private uint _screenShotImageOrientation; #pragma warning restore IDE0052 - private uint _idleTimeDetectionExtension = 0; + private uint _idleTimeDetectionExtension; public ISelfController(ServiceCtx context, ulong pid) { diff --git a/src/Ryujinx.HLE/HOS/Services/Apm/PerformanceState.cs b/src/Ryujinx.HLE/HOS/Services/Apm/PerformanceState.cs index 86a1491de..851358bad 100644 --- a/src/Ryujinx.HLE/HOS/Services/Apm/PerformanceState.cs +++ b/src/Ryujinx.HLE/HOS/Services/Apm/PerformanceState.cs @@ -4,7 +4,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm { public PerformanceState() { } - public bool CpuOverclockEnabled = false; + public bool CpuOverclockEnabled; public PerformanceMode PerformanceMode = PerformanceMode.Default; public CpuBoostMode CpuBoostMode = CpuBoostMode.Disabled; diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/LazyFile.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/LazyFile.cs index a179e8e38..2fbfb6b1e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/LazyFile.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/LazyFile.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { private readonly LibHac.Fs.Fsa.IFileSystem _fs; private readonly string _filePath; - private readonly UniqueRef _fileReference = new(); + private readonly UniqueRef _fileReference; private readonly FileInfo _fileInfo; public LazyFile(string filePath, string prefix, LibHac.Fs.Fsa.IFileSystem fs) diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs index 834bee6f0..67accb099 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid }; internal NpadJoyHoldType JoyHold { get; set; } - internal bool SixAxisActive = false; // TODO: link to hidserver when implemented + internal bool SixAxisActive; // TODO: link to hidserver when implemented internal ControllerType SupportedStyleSets { get; set; } public Dictionary> RumbleQueues = new(); diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs b/src/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs index a13e77e72..57f46bdbd 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs @@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs [Service("irs")] class IIrSensorServer : IpcService { - private int _irsensorSharedMemoryHandle = 0; + private int _irsensorSharedMemoryHandle; public IIrSensorServer(ServiceCtx context) { } diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/Lp2p/ISfServiceMonitor.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/Lp2p/ISfServiceMonitor.cs index d3a8bead2..b7b82a4e6 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/Lp2p/ISfServiceMonitor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/Lp2p/ISfServiceMonitor.cs @@ -10,8 +10,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.Lp2p { private readonly KEvent _stateChangeEvent; private readonly KEvent _jointEvent; - private int _stateChangeEventHandle = 0; - private int _jointEventHandle = 0; + private int _stateChangeEventHandle; + private int _jointEventHandle; public ISfServiceMonitor(ServiceCtx context) { diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/AccessPoint.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/AccessPoint.cs index bd00a3139..197745871 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/AccessPoint.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/AccessPoint.cs @@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator private readonly IUserLocalCommunicationService _parent; public NetworkInfo NetworkInfo; - public Array8 LatestUpdates = new(); + public Array8 LatestUpdates; public bool Connected { get; private set; } public ProxyConfig Config => _parent.NetworkClient.Config; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs index 4c7814b8e..91784ef95 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu { public bool NeedsRealId => true; - private static InitializeMessage InitializeMemory = new InitializeMessage(); + private static InitializeMessage InitializeMemory; private const int InactiveTimeout = 6000; private const int FailureTimeout = 4000; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/RyuLdnProtocol.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/RyuLdnProtocol.cs index d0eeaf125..a9b31a133 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/RyuLdnProtocol.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/RyuLdnProtocol.cs @@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu private readonly int _headerSize = Marshal.SizeOf(); private readonly byte[] _buffer = new byte[MaxPacketSize]; - private int _bufferEnd = 0; + private int _bufferEnd; // Client Packets. public event Action Initialize; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/Station.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/Station.cs index fa43f789e..e099fa7be 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/Station.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/Station.cs @@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator class Station : IDisposable { public NetworkInfo NetworkInfo; - public Array8 LatestUpdates = new(); + public Array8 LatestUpdates; private readonly IUserLocalCommunicationService _parent; diff --git a/src/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs b/src/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs index 23a52d908..db82875f3 100644 --- a/src/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs @@ -11,8 +11,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii { class MiiDatabaseManager { - private readonly bool _isTestModeEnabled = false; - private uint _mountCounter = 0; + private readonly bool _isTestModeEnabled; + private uint _mountCounter; private const ulong DatabaseTestSaveDataId = 0x8000000000000031; private const ulong DatabaseSaveDataId = 0x8000000000000030; diff --git a/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs b/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs index a5a822db3..5dd60a47e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs @@ -13,9 +13,9 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService { private readonly GeneralServiceDetail _generalServiceDetail; - private IPInterfaceProperties _targetPropertiesCache = null; - private UnicastIPAddressInformation _targetAddressInfoCache = null; - private string _cacheChosenInterface = null; + private IPInterfaceProperties _targetPropertiesCache; + private UnicastIPAddressInformation _targetAddressInfoCache; + private string _cacheChosenInterface; public IGeneralService() { diff --git a/src/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/src/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs index a0df66d00..5ba02591c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs @@ -52,10 +52,10 @@ namespace Ryujinx.HLE.HOS.Services.Nv private IVirtualMemoryManager _clientMemory; private ulong _owner; - private bool _transferMemInitialized = false; + private bool _transferMemInitialized; // TODO: This should call set:sys::GetDebugModeFlag - private readonly bool _debugModeEnabled = false; + private readonly bool _debugModeEnabled; public INvDrvServices(ServiceCtx context) : base(context.Device.System.NvDrvServer) { diff --git a/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs b/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs index 9b026a1c3..a2cc855b9 100644 --- a/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs @@ -15,11 +15,11 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory private int[] _ratingAge; // TODO: Find where they are set. - private readonly bool _restrictionEnabled = false; - private readonly bool _featuresRestriction = false; - private bool _freeCommunicationEnabled = false; + private readonly bool _restrictionEnabled; + private readonly bool _featuresRestriction; + private bool _freeCommunicationEnabled; private readonly bool _stereoVisionRestrictionConfigurable = true; - private bool _stereoVisionRestriction = false; + private bool _stereoVisionRestriction; #pragma warning restore IDE0052, CS0414 public IParentalControlService(ServiceCtx context, ulong pid, bool withInitialize, int permissionFlag) diff --git a/src/Ryujinx.HLE/HOS/Services/Pcv/Clkrst/IClkrstManager.cs b/src/Ryujinx.HLE/HOS/Services/Pcv/Clkrst/IClkrstManager.cs index c7c459196..d45735066 100644 --- a/src/Ryujinx.HLE/HOS/Services/Pcv/Clkrst/IClkrstManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Pcv/Clkrst/IClkrstManager.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst [Service("clkrst:i")] // 8.0.0+ class IClkrstManager : IpcService { - private int _moduleStateTableEventHandle = 0; + private int _moduleStateTableEventHandle; public IClkrstManager(ServiceCtx context) { } diff --git a/src/Ryujinx.HLE/HOS/Services/ServerBase.cs b/src/Ryujinx.HLE/HOS/Services/ServerBase.cs index f67699b90..8715e4aa1 100644 --- a/src/Ryujinx.HLE/HOS/Services/ServerBase.cs +++ b/src/Ryujinx.HLE/HOS/Services/ServerBase.cs @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services private KProcess _selfProcess; private KThread _selfThread; private KEvent _wakeEvent; - private int _wakeHandle = 0; + private int _wakeHandle; private readonly ReaderWriterLockSlim _handleLock = new(); private readonly Dictionary _sessions = new(); @@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services private readonly MemoryStream _responseDataStream; private readonly BinaryWriter _responseDataWriter; - private int _isDisposed = 0; + private int _isDisposed; public ManualResetEvent InitDone { get; } public string Name { get; } diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs index 981fe0a8f..fae75d247 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs @@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl } } - bool hasEmittedBlockingWarning = false; + bool hasEmittedBlockingWarning; public LinuxError Receive(out int receiveSize, Span buffer, BsdSocketFlags flags) { diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs index 0c1fa3a9f..bf967d8f2 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd private readonly FqdnResolver _fqdnResolver; #pragma warning restore IDE0052 - private readonly bool _isInitialized = false; + private readonly bool _isInitialized; public IManager(ServiceCtx context) { diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs index 5151930a5..55d7d0ddb 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { private static readonly Dictionary _registeredBinderObjects = new(); - private static int _lastBinderId = 0; + private static int _lastBinderId; private static readonly Lock _lock = new(); diff --git a/src/Ryujinx.HLE/HOS/Services/Time/IStaticServiceForPsc.cs b/src/Ryujinx.HLE/HOS/Services/Time/IStaticServiceForPsc.cs index a6b33e4ae..e3ac777ad 100644 --- a/src/Ryujinx.HLE/HOS/Services/Time/IStaticServiceForPsc.cs +++ b/src/Ryujinx.HLE/HOS/Services/Time/IStaticServiceForPsc.cs @@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Time private readonly TimeManager _timeManager; private readonly TimePermissions _permissions; - private int _timeSharedMemoryNativeHandle = 0; + private int _timeSharedMemoryNativeHandle; public IStaticServiceForPsc(ServiceCtx context, TimePermissions permissions) : this(TimeManager.Instance, permissions) { } diff --git a/src/Ryujinx.HLE/HOS/Tamper/AtmosphereProgram.cs b/src/Ryujinx.HLE/HOS/Tamper/AtmosphereProgram.cs index 8171d2177..7f2cee0f6 100644 --- a/src/Ryujinx.HLE/HOS/Tamper/AtmosphereProgram.cs +++ b/src/Ryujinx.HLE/HOS/Tamper/AtmosphereProgram.cs @@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Tamper private readonly IOperation _entryPoint; public string Name { get; } - public bool TampersCodeMemory { get; set; } = false; + public bool TampersCodeMemory { get; set; } public ITamperedProcess Process { get; } public bool IsEnabled { get; set; } diff --git a/src/Ryujinx.HLE/HOS/Tamper/Register.cs b/src/Ryujinx.HLE/HOS/Tamper/Register.cs index cce13ee69..7e46afe9a 100644 --- a/src/Ryujinx.HLE/HOS/Tamper/Register.cs +++ b/src/Ryujinx.HLE/HOS/Tamper/Register.cs @@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Tamper { class Register : IOperand { - private ulong _register = 0; + private ulong _register; private readonly string _alias; public Register(string alias) diff --git a/src/Ryujinx.HLE/HOS/Tamper/TamperedKProcess.cs b/src/Ryujinx.HLE/HOS/Tamper/TamperedKProcess.cs index 422e4ef0e..0f077115d 100644 --- a/src/Ryujinx.HLE/HOS/Tamper/TamperedKProcess.cs +++ b/src/Ryujinx.HLE/HOS/Tamper/TamperedKProcess.cs @@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Tamper public ProcessState State => _process.State; - public bool TamperedCodeMemory { get; set; } = false; + public bool TamperedCodeMemory { get; set; } public TamperedKProcess(KProcess process) { diff --git a/src/Ryujinx.HLE/HOS/TamperMachine.cs b/src/Ryujinx.HLE/HOS/TamperMachine.cs index 609221535..d65345051 100644 --- a/src/Ryujinx.HLE/HOS/TamperMachine.cs +++ b/src/Ryujinx.HLE/HOS/TamperMachine.cs @@ -16,9 +16,9 @@ namespace Ryujinx.HLE.HOS // cheat and the re-execution of the first one. private const int TamperMachineSleepMs = 1000 / 12; - private Thread _tamperThread = null; + private Thread _tamperThread; private readonly ConcurrentQueue _programs = new(); - private long _pressedKeys = 0; + private long _pressedKeys; private readonly Dictionary _programDictionary = new(); private void Activate() diff --git a/src/Ryujinx.HLE/Switch.cs b/src/Ryujinx.HLE/Switch.cs index d0afdf173..327c16e03 100644 --- a/src/Ryujinx.HLE/Switch.cs +++ b/src/Ryujinx.HLE/Switch.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE public IHostUIHandler UIHandler { get; } public VSyncMode VSyncMode { get; set; } = VSyncMode.Switch; - public bool CustomVSyncIntervalEnabled { get; set; } = false; + public bool CustomVSyncIntervalEnabled { get; set; } public int CustomVSyncInterval { get; set; } public long TargetVSyncInterval { get; set; } = 60; diff --git a/src/Ryujinx.Headless.SDL2/WindowBase.cs b/src/Ryujinx.Headless.SDL2/WindowBase.cs index fbe7cb49c..35c3eb058 100644 --- a/src/Ryujinx.Headless.SDL2/WindowBase.cs +++ b/src/Ryujinx.Headless.SDL2/WindowBase.cs @@ -34,7 +34,7 @@ namespace Ryujinx.Headless.SDL2 protected const int DefaultHeight = 720; private const int TargetFps = 60; private SDL_WindowFlags DefaultFlags = SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI | SDL_WindowFlags.SDL_WINDOW_RESIZABLE | SDL_WindowFlags.SDL_WINDOW_INPUT_FOCUS | SDL_WindowFlags.SDL_WINDOW_SHOWN; - private SDL_WindowFlags FullscreenFlag = 0; + private SDL_WindowFlags FullscreenFlag; private static readonly ConcurrentQueue _mainThreadActions = new(); diff --git a/src/Ryujinx.Memory/Tracking/RegionHandle.cs b/src/Ryujinx.Memory/Tracking/RegionHandle.cs index 4e81a9723..ed238f289 100644 --- a/src/Ryujinx.Memory/Tracking/RegionHandle.cs +++ b/src/Ryujinx.Memory/Tracking/RegionHandle.cs @@ -60,8 +60,8 @@ namespace Ryujinx.Memory.Tracking private readonly MemoryTracking _tracking; private bool _disposed; - private int _checkCount = 0; - private int _volatileCount = 0; + private int _checkCount; + private int _volatileCount; private bool _volatile; internal MemoryPermission RequiredPermission diff --git a/src/Ryujinx.Tests.Memory/MockVirtualMemoryManager.cs b/src/Ryujinx.Tests.Memory/MockVirtualMemoryManager.cs index 3fe44db21..0503cfd95 100644 --- a/src/Ryujinx.Tests.Memory/MockVirtualMemoryManager.cs +++ b/src/Ryujinx.Tests.Memory/MockVirtualMemoryManager.cs @@ -10,7 +10,7 @@ namespace Ryujinx.Tests.Memory { public bool UsesPrivateAllocations => false; - public bool NoMappings = false; + public bool NoMappings; public event Action OnProtect; diff --git a/src/Ryujinx.Tests/Cpu/CpuTest.cs b/src/Ryujinx.Tests/Cpu/CpuTest.cs index da0f03e6b..9ca1672a6 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTest.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTest.cs @@ -19,10 +19,10 @@ namespace Ryujinx.Tests.Cpu protected static ulong DataBaseAddress = CodeBaseAddress + Size; #pragma warning restore CA2211 - private static readonly bool _ignoreFpcrFz = false; - private static readonly bool _ignoreFpcrDn = false; + private static readonly bool _ignoreFpcrFz; + private static readonly bool _ignoreFpcrDn; - private static readonly bool _ignoreAllExceptFpsrQc = false; + private static readonly bool _ignoreAllExceptFpsrQc; private ulong _currAddress; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs b/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs index aab009766..81b87ef7f 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs @@ -58,9 +58,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; #region "AluImm & Csel" [Test, Pairwise] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs b/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs index e984a1584..bce49ed2f 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs @@ -57,9 +57,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise] public void Vmsr_Vcmp_Vmrs([ValueSource(nameof(_1S_F_))] ulong a, diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs index eb763618d..4b453de76 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs @@ -1251,9 +1251,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise, Description("ABS , ")] public void Abs_S_D([Values(0u)] uint rd, diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs index 08202c9e1..00accfc4f 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs @@ -179,9 +179,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise, Description("SHA256SU0.32 , ")] public void Sha256su0_V([Values(0xF3BA03C0u)] uint opcode, diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs index 007c0f8cb..491305cee 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs @@ -370,9 +370,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise] [Explicit] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs index ba201a480..a30bf3bb8 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs @@ -161,9 +161,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Explicit] [Test, Pairwise, Description("VCVT.
.F32 , ")] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs index d6d12b278..5ec9057f0 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs @@ -135,9 +135,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; private const int RndCntNzcv = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise] [Explicit] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs index 207f76089..91f8363f0 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs @@ -600,9 +600,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise, Description("ADD , , ")] public void Add_S_D([Values(0u)] uint rd, diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs index 843273dc2..1bfc54e4c 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs @@ -272,9 +272,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise, Description("SHA256H.32 , , ")] public void Sha256h_V([Values(0xF3000C40u)] uint opcode, diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs index 1b670da76..489c405c5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs @@ -213,9 +213,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; // Fused. [Test, Pairwise] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs index 9816bc2cc..ac3421c53 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs @@ -539,9 +539,9 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly bool _noZeros = false; - private static readonly bool _noInfs = false; - private static readonly bool _noNaNs = false; + private static readonly bool _noZeros; + private static readonly bool _noInfs; + private static readonly bool _noNaNs; [Test, Pairwise] [Explicit] diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 5872b278f..cbf7462a7 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -94,7 +94,7 @@ namespace Ryujinx.Ava private long _lastCursorMoveTime; private bool _isCursorInRenderer = true; - private bool _ignoreCursorState = false; + private bool _ignoreCursorState; private enum CursorStates { @@ -108,7 +108,7 @@ namespace Ryujinx.Ava private DateTime _lastShaderReset; private uint _displayCount; - private uint _previousCount = 0; + private uint _previousCount; private bool _isStopped; private bool _isActive; diff --git a/src/Ryujinx/UI/Models/CheatNode.cs b/src/Ryujinx/UI/Models/CheatNode.cs index 8e9aee254..9f8897d6b 100644 --- a/src/Ryujinx/UI/Models/CheatNode.cs +++ b/src/Ryujinx/UI/Models/CheatNode.cs @@ -7,7 +7,7 @@ namespace Ryujinx.Ava.UI.Models { public class CheatNode : BaseModel { - private bool _isEnabled = false; + private bool _isEnabled; public ObservableCollection SubNodes { get; } = new(); public string CleanName => Name[1..^7]; public string BuildIdKey => $"{BuildId}-{Name}"; diff --git a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs index 3abaae3ae..dad4b53f7 100644 --- a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs @@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.ViewModels private AvaloniaList _downloadableContents = new(); private AvaloniaList _selectedDownloadableContents = new(); private AvaloniaList _views = new(); - private bool _showBundledContentNotice = false; + private bool _showBundledContentNotice; private string _search; private readonly ApplicationData _applicationData; diff --git a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs index dacdc3056..96018c21d 100644 --- a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs @@ -26,7 +26,7 @@ namespace Ryujinx.Ava.UI.ViewModels private AvaloniaList _titleUpdates = new(); private AvaloniaList _views = new(); private object _selectedUpdate = new TitleUpdateViewNoUpdateSentinal(); - private bool _showBundledContentNotice = false; + private bool _showBundledContentNotice; public AvaloniaList TitleUpdates {