From beab133c8de8a33882927a79ab789d6c66612743 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sun, 26 Jan 2025 15:15:26 -0600 Subject: [PATCH] misc: chore: Fix object creation in HLE project --- src/Ryujinx.HLE/FileSystem/ContentManager.cs | 30 ++++----- .../FileSystem/VirtualFileSystem.cs | 10 +-- .../HOS/Applets/Cabinet/CabinetApplet.cs | 2 +- .../HOS/Applets/Error/ErrorApplet.cs | 2 +- .../SoftwareKeyboardApplet.cs | 2 +- .../SoftwareKeyboardRendererBase.cs | 26 ++++---- .../Applets/SoftwareKeyboard/TimedAction.cs | 10 +-- .../HOS/ArmProcessContextFactory.cs | 10 +-- src/Ryujinx.HLE/HOS/Horizon.cs | 12 ++-- src/Ryujinx.HLE/HOS/HorizonFsClient.cs | 2 +- .../HOS/Kernel/Memory/KPageHeap.cs | 2 +- .../HOS/Kernel/Memory/KPageTable.cs | 4 +- .../HOS/Kernel/Memory/KPageTableBase.cs | 8 +-- .../HOS/Kernel/SupervisorCall/Syscall.cs | 4 +- .../HOS/Kernel/Threading/KThread.cs | 2 +- src/Ryujinx.HLE/HOS/ModLoader.cs | 30 ++++----- .../Services/Account/Acc/AccountManager.cs | 4 +- .../Acc/AccountService/ManagerServer.cs | 2 +- .../SystemAppletProxy/ICommonStateGetter.cs | 2 +- .../HOS/Services/Caps/CaptureManager.cs | 2 +- .../FileSystemProxy/FileSystemProxyHelper.cs | 8 +-- .../Fs/FileSystemProxy/IFileSystem.cs | 4 +- .../HOS/Services/Fs/IFileSystemProxy.cs | 64 +++++++++---------- .../LdnMitm/LanDiscovery.cs | 2 +- .../LdnMitm/Proxy/LdnProxyUdpServer.cs | 2 +- .../LdnRyu/LdnMasterProxyClient.cs | 18 +++--- .../LdnRyu/Proxy/EphemeralPortPool.cs | 2 +- .../LdnRyu/Proxy/LdnProxy.cs | 14 ++-- .../LdnRyu/Proxy/LdnProxySocket.cs | 18 +++--- .../LdnRyu/Proxy/P2pProxyClient.cs | 6 +- .../LdnRyu/Proxy/P2pProxyServer.cs | 16 ++--- .../Nfc/AmiiboDecryption/AmiiboBinReader.cs | 6 +- .../Nfc/AmiiboDecryption/AmiiboDump.cs | 14 ++-- .../HOS/Services/Nv/Host1xContext.cs | 4 +- .../NvHostAsGpu/NvHostAsGpuDeviceFile.cs | 4 +- .../HOS/Services/Sdb/Pl/SharedFontManager.cs | 2 +- .../Settings/ISystemSettingsServer.cs | 2 +- .../Services/Ssl/BuiltInCertificateManager.cs | 2 +- .../Time/TimeZone/TimeZoneContentManager.cs | 6 +- .../Extensions/FileSystemExtensions.cs | 2 +- .../Extensions/LocalFileSystemExtensions.cs | 2 +- .../Extensions/MetaLoaderExtensions.cs | 2 +- .../Processes/Extensions/NcaExtensions.cs | 8 +-- .../PartitionFileSystemExtensions.cs | 4 +- .../Loaders/Processes/ProcessLoader.cs | 2 +- .../Loaders/Processes/ProcessLoaderHelper.cs | 4 +- src/Ryujinx.HLE/StructHelpers.cs | 2 +- .../Utilities/PartitionFileSystemUtils.cs | 2 +- 48 files changed, 194 insertions(+), 194 deletions(-) diff --git a/src/Ryujinx.HLE/FileSystem/ContentManager.cs b/src/Ryujinx.HLE/FileSystem/ContentManager.cs index bce896ea1..08c4f4eb4 100644 --- a/src/Ryujinx.HLE/FileSystem/ContentManager.cs +++ b/src/Ryujinx.HLE/FileSystem/ContentManager.cs @@ -217,8 +217,8 @@ namespace Ryujinx.HLE.FileSystem if (AocData.TryGetValue(aocTitleId, out AocItem aoc)) { - FileStream file = new FileStream(aoc.ContainerPath, FileMode.Open, FileAccess.Read); - using UniqueRef ncaFile = new UniqueRef(); + FileStream file = new(aoc.ContainerPath, FileMode.Open, FileAccess.Read); + using UniqueRef ncaFile = new(); switch (Path.GetExtension(aoc.ContainerPath)) { @@ -227,7 +227,7 @@ namespace Ryujinx.HLE.FileSystem xci.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); break; case ".nsp": - PartitionFileSystem pfs = new PartitionFileSystem(); + PartitionFileSystem pfs = new(); pfs.Initialize(file.AsStorage()); pfs.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); break; @@ -627,7 +627,7 @@ namespace Ryujinx.HLE.FileSystem private static IFile OpenPossibleFragmentedFile(IFileSystem filesystem, string path, OpenMode mode) { - using UniqueRef file = new UniqueRef(); + using UniqueRef file = new(); if (filesystem.FileExists($"{path}/00")) { @@ -733,11 +733,11 @@ namespace Ryujinx.HLE.FileSystem string cnmtPath = fs.EnumerateEntries("/", "*.cnmt").Single().FullPath; - using UniqueRef metaFile = new UniqueRef(); + using UniqueRef metaFile = new(); if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { - Cnmt meta = new Cnmt(metaFile.Get.AsStream()); + Cnmt meta = new(metaFile.Get.AsStream()); if (meta.Type == ContentMetaType.SystemUpdate) { @@ -762,7 +762,7 @@ namespace Ryujinx.HLE.FileSystem IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.ErrorOnInvalid); - using UniqueRef systemVersionFile = new UniqueRef(); + using UniqueRef systemVersionFile = new(); if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { @@ -798,11 +798,11 @@ namespace Ryujinx.HLE.FileSystem string cnmtPath = fs.EnumerateEntries("/", "*.cnmt").Single().FullPath; - using UniqueRef metaFile = new UniqueRef(); + using UniqueRef metaFile = new(); if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { - Cnmt meta = new Cnmt(metaFile.Get.AsStream()); + Cnmt meta = new(metaFile.Get.AsStream()); IStorage contentStorage = contentNcaStream.AsStorage(); if (contentStorage.GetSize(out long size).IsSuccess()) @@ -867,11 +867,11 @@ namespace Ryujinx.HLE.FileSystem string cnmtPath = fs.EnumerateEntries("/", "*.cnmt").Single().FullPath; - using UniqueRef metaFile = new UniqueRef(); + using UniqueRef metaFile = new(); if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { - Cnmt meta = new Cnmt(metaFile.Get.AsStream()); + Cnmt meta = new(metaFile.Get.AsStream()); if (meta.Type == ContentMetaType.SystemUpdate) { @@ -885,7 +885,7 @@ namespace Ryujinx.HLE.FileSystem { IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.ErrorOnInvalid); - using UniqueRef systemVersionFile = new UniqueRef(); + using UniqueRef systemVersionFile = new(); if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { @@ -935,11 +935,11 @@ namespace Ryujinx.HLE.FileSystem string cnmtPath = fs.EnumerateEntries("/", "*.cnmt").Single().FullPath; - using UniqueRef metaFile = new UniqueRef(); + using UniqueRef metaFile = new(); if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { - Cnmt meta = new Cnmt(metaFile.Get.AsStream()); + Cnmt meta = new(metaFile.Get.AsStream()); if (contentStorage.GetSize(out long size).IsSuccess()) { @@ -1002,7 +1002,7 @@ namespace Ryujinx.HLE.FileSystem { IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.ErrorOnInvalid); - using UniqueRef systemVersionFile = new UniqueRef(); + using UniqueRef systemVersionFile = new(); if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { diff --git a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index 789caee4c..249d3f8d7 100644 --- a/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/src/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -61,7 +61,7 @@ namespace Ryujinx.HLE.FileSystem public void LoadRomFs(ulong pid, string fileName) { - FileStream romfsStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); + FileStream romfsStream = new(fileName, FileMode.Open, FileAccess.Read); _romFsByPid.AddOrUpdate(pid, romfsStream, (pid, oldStream) => { @@ -194,7 +194,7 @@ namespace Ryujinx.HLE.FileSystem } fsServerClient = horizon.CreatePrivilegedHorizonClient(); - FileSystemServer fsServer = new FileSystemServer(fsServerClient); + FileSystemServer fsServer = new(fsServerClient); RandomDataGenerator randomGenerator = Random.Shared.NextBytes; @@ -208,7 +208,7 @@ namespace Ryujinx.HLE.FileSystem SdCard.SetSdCardInserted(true); - FileSystemServerConfig fsServerConfig = new FileSystemServerConfig + FileSystemServerConfig fsServerConfig = new() { ExternalKeySet = KeySet.ExternalKeySet, FsCreators = fsServerObjects.FsCreators, @@ -270,7 +270,7 @@ namespace Ryujinx.HLE.FileSystem { foreach (DirectoryEntryEx ticketEntry in fs.EnumerateEntries("/", "*.tik")) { - using UniqueRef ticketFile = new UniqueRef(); + using UniqueRef ticketFile = new(); Result result = fs.OpenFile(ref ticketFile.Ref, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); @@ -334,7 +334,7 @@ namespace Ryujinx.HLE.FileSystem { Span info = stackalloc SaveDataInfo[8]; - using UniqueRef iterator = new UniqueRef(); + using UniqueRef iterator = new(); Result rc = hos.Fs.OpenSaveDataIterator(ref iterator.Ref, spaceId); if (rc.IsFailure()) diff --git a/src/Ryujinx.HLE/HOS/Applets/Cabinet/CabinetApplet.cs b/src/Ryujinx.HLE/HOS/Applets/Cabinet/CabinetApplet.cs index 294b8d1f6..04843deb0 100644 --- a/src/Ryujinx.HLE/HOS/Applets/Cabinet/CabinetApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/Cabinet/CabinetApplet.cs @@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Applets.Cabinet { _system.Device.UIHandler.DisplayCabinetDialog(out string newName); byte[] nameBytes = Encoding.UTF8.GetBytes(newName); - Array41 nickName = new Array41(); + Array41 nickName = new(); nameBytes.CopyTo(nickName.AsSpan()); startParam.RegisterInfo.Nickname = nickName; NfpDevice devicePlayer1 = new() diff --git a/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs b/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs index a7917a157..ad841c0df 100644 --- a/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error if (romfs.FileExists(filePath)) { - using UniqueRef binaryFile = new UniqueRef(); + using UniqueRef binaryFile = new(); romfs.OpenFile(ref binaryFile.Ref, filePath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); StreamReader reader = new(binaryFile.Get.AsStream(), Encoding.Unicode); diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs index ea906659f..7e88db51d 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs @@ -205,7 +205,7 @@ namespace Ryujinx.HLE.HOS.Applets else { // Call the configured GUI handler to get user's input. - SoftwareKeyboardUIArgs args = new SoftwareKeyboardUIArgs + SoftwareKeyboardUIArgs args = new() { KeyboardMode = _keyboardForegroundConfig.Mode, HeaderText = StripUnicodeControlCodes(_keyboardForegroundConfig.HeaderText), diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs index 9e861ad10..cc00a6392 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardRendererBase.cs @@ -219,7 +219,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard return; } - using SKPaint paint = new SKPaint(_messageFont) + using SKPaint paint = new(_messageFont) { Color = _textNormalColor, IsAntialias = true @@ -229,7 +229,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard SKRect messageRectangle = MeasureString(MessageText, paint); float messagePositionX = (_panelRectangle.Width - messageRectangle.Width) / 2 - messageRectangle.Left; float messagePositionY = _messagePositionY - messageRectangle.Top; - SKPoint messagePosition = new SKPoint(messagePositionX, messagePositionY); + SKPoint messagePosition = new(messagePositionX, messagePositionY); SKRect messageBoundRectangle = SKRect.Create(messagePositionX, messagePositionY, messageRectangle.Width, messageRectangle.Height); canvas.DrawRect(messageBoundRectangle, _panelBrush); @@ -336,7 +336,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard private void DrawTextBox(SKCanvas canvas, SoftwareKeyboardUIState state) { - using SKPaint textPaint = new SKPaint(_labelsTextFont) + using SKPaint textPaint = new(_labelsTextFont) { IsAntialias = true, Color = _textNormalColor @@ -360,7 +360,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard float inputTextX = (_panelRectangle.Width - inputTextRectangle.Width) / 2 - inputTextRectangle.Left; float inputTextY = boxY + 5; - SKPoint inputTextPosition = new SKPoint(inputTextX, inputTextY); + SKPoint inputTextPosition = new(inputTextX, inputTextY); canvas.DrawText(state.InputText, inputTextPosition.X, inputTextPosition.Y + (_labelsTextFont.Metrics.XHeight + _labelsTextFont.Metrics.Descent), textPaint); // Draw the cursor on top of the text and redraw the text with a different color if necessary. @@ -459,9 +459,9 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard using SKSurface textOverCursor = SKSurface.Create(new SKImageInfo((int)cursorRectangle.Width, (int)cursorRectangle.Height, SKColorType.Rgba8888)); SKCanvas textOverCanvas = textOverCursor.Canvas; - SKPoint textRelativePosition = new SKPoint(inputTextPosition.X - cursorRectangle.Left, inputTextPosition.Y - cursorRectangle.Top); + SKPoint textRelativePosition = new(inputTextPosition.X - cursorRectangle.Left, inputTextPosition.Y - cursorRectangle.Top); - using SKPaint cursorPaint = new SKPaint(_inputTextFont) + using SKPaint cursorPaint = new(_inputTextFont) { Color = cursorTextColor, IsAntialias = true @@ -469,7 +469,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard textOverCanvas.DrawText(state.InputText, textRelativePosition.X, textRelativePosition.Y + _inputTextFont.Metrics.XHeight + _inputTextFont.Metrics.Descent, cursorPaint); - SKPoint cursorPosition = new SKPoint((int)cursorRectangle.Left, (int)cursorRectangle.Top); + SKPoint cursorPosition = new((int)cursorRectangle.Left, (int)cursorRectangle.Top); textOverCursor.Flush(); canvas.DrawSurface(textOverCursor, cursorPosition); } @@ -492,7 +492,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard float iconWidth = icon.Width; float iconHeight = icon.Height; - using SKPaint paint = new SKPaint(_labelsTextFont) + using SKPaint paint = new(_labelsTextFont) { Color = _textNormalColor, IsAntialias = true @@ -514,8 +514,8 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard iconX += originX; iconY += originY; - SKPoint iconPosition = new SKPoint((int)iconX, (int)iconY); - SKPoint labelPosition = new SKPoint(labelPositionX + originX, labelPositionY + originY); + SKPoint iconPosition = new((int)iconX, (int)iconY); + SKPoint labelPosition = new(labelPositionX + originX, labelPositionY + originY); SKRect selectedRectangle = SKRect.Create(originX - 2 * _padPressedPenWidth, originY - 2 * _padPressedPenWidth, fullWidth + 4 * _padPressedPenWidth, fullHeight + 4 * _padPressedPenWidth); @@ -545,7 +545,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard private void DrawControllerToggle(SKCanvas canvas, SKPoint point) { - using SKPaint paint = new SKPaint(_labelsTextFont) + using SKPaint paint = new(_labelsTextFont) { IsAntialias = true, Color = _textNormalColor @@ -574,8 +574,8 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard keyX += originX; keyY += originY; - SKPoint labelPosition = new SKPoint(labelPositionX + originX, labelPositionY + originY); - SKPoint overlayPosition = new SKPoint((int)keyX, (int)keyY); + SKPoint labelPosition = new(labelPositionX + originX, labelPositionY + originY); + SKPoint overlayPosition = new((int)keyX, (int)keyY); canvas.DrawBitmap(_keyModeIcon, overlayPosition); canvas.DrawText(ControllerToggleText, labelPosition.X, labelPosition.Y + _labelsTextFont.Metrics.XHeight, paint); diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs index e98dadb77..7a6ce8f32 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs @@ -79,11 +79,11 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard public void Reset(Action action, int totalMilliseconds, int sleepMilliseconds) { // Create a dedicated cancel token for each task. - TRef cancelled = new TRef(false); + TRef cancelled = new(false); Reset(new Thread(() => { - SleepSubstepData substepData = new SleepSubstepData(sleepMilliseconds); + SleepSubstepData substepData = new(sleepMilliseconds); int totalCount = totalMilliseconds / sleepMilliseconds; int totalRemainder = totalMilliseconds - totalCount * sleepMilliseconds; @@ -126,11 +126,11 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard public void Reset(Action action, int sleepMilliseconds) { // Create a dedicated cancel token for each task. - TRef cancelled = new TRef(false); + TRef cancelled = new(false); Reset(new Thread(() => { - SleepSubstepData substepData = new SleepSubstepData(sleepMilliseconds); + SleepSubstepData substepData = new(sleepMilliseconds); while (!Volatile.Read(ref cancelled.Value)) { @@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard public void Reset(Action action) { // Create a dedicated cancel token for each task. - TRef cancelled = new TRef(false); + TRef cancelled = new(false); Reset(new Thread(() => { diff --git a/src/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs b/src/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs index 621a081fd..95b6167f3 100644 --- a/src/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs +++ b/src/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs @@ -51,8 +51,8 @@ namespace Ryujinx.HLE.HOS if (OperatingSystem.IsMacOS() && isArm64Host && for64Bit && context.Device.Configuration.UseHypervisor) { - HvEngine cpuEngine = new HvEngine(_tickSource); - HvMemoryManager memoryManager = new HvMemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler); + HvEngine cpuEngine = new(_tickSource); + HvMemoryManager memoryManager = new(context.Memory, addressSpaceSize, invalidAccessHandler); processContext = new ArmProcessContext(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit); } else @@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS switch (mode) { case MemoryManagerMode.SoftwarePageTable: - MemoryManager memoryManager = new MemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler); + MemoryManager memoryManager = new(context.Memory, addressSpaceSize, invalidAccessHandler); processContext = new ArmProcessContext(pid, cpuEngine, _gpu, memoryManager, addressSpaceSize, for64Bit); break; @@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS case MemoryManagerMode.HostMappedUnsafe: if (addressSpace == null) { - MemoryManagerHostTracked memoryManagerHostTracked = new MemoryManagerHostTracked(context.Memory, addressSpaceSize, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler); + MemoryManagerHostTracked memoryManagerHostTracked = new(context.Memory, addressSpaceSize, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler); processContext = new ArmProcessContext(pid, cpuEngine, _gpu, memoryManagerHostTracked, addressSpaceSize, for64Bit); } else @@ -104,7 +104,7 @@ namespace Ryujinx.HLE.HOS Logger.Warning?.Print(LogClass.Emulation, $"Allocated address space (0x{addressSpace.AddressSpaceSize:X}) is smaller than guest application requirements (0x{addressSpaceSize:X})"); } - MemoryManagerHostMapped memoryManagerHostMapped = new MemoryManagerHostMapped(addressSpace, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler); + MemoryManagerHostMapped memoryManagerHostMapped = new(addressSpace, mode == MemoryManagerMode.HostMappedUnsafe, invalidAccessHandler); processContext = new ArmProcessContext(pid, cpuEngine, _gpu, memoryManagerHostMapped, addressSpace.AddressSpaceSize, for64Bit); } break; diff --git a/src/Ryujinx.HLE/HOS/Horizon.cs b/src/Ryujinx.HLE/HOS/Horizon.cs index e0dd0f1c9..85f06ceba 100644 --- a/src/Ryujinx.HLE/HOS/Horizon.cs +++ b/src/Ryujinx.HLE/HOS/Horizon.cs @@ -154,11 +154,11 @@ namespace Ryujinx.HLE.HOS timePageList.AddRange(timePa, TimeSize / KPageTableBase.PageSize); appletCaptureBufferPageList.AddRange(appletCaptureBufferPa, AppletCaptureBufferSize / KPageTableBase.PageSize); - SharedMemoryStorage hidStorage = new SharedMemoryStorage(KernelContext, hidPageList); - SharedMemoryStorage fontStorage = new SharedMemoryStorage(KernelContext, fontPageList); - SharedMemoryStorage iirsStorage = new SharedMemoryStorage(KernelContext, iirsPageList); - SharedMemoryStorage timeStorage = new SharedMemoryStorage(KernelContext, timePageList); - SharedMemoryStorage appletCaptureBufferStorage = new SharedMemoryStorage(KernelContext, appletCaptureBufferPageList); + SharedMemoryStorage hidStorage = new(KernelContext, hidPageList); + SharedMemoryStorage fontStorage = new(KernelContext, fontPageList); + SharedMemoryStorage iirsStorage = new(KernelContext, iirsPageList); + SharedMemoryStorage timeStorage = new(KernelContext, timePageList); + SharedMemoryStorage appletCaptureBufferStorage = new(KernelContext, appletCaptureBufferPageList); HidStorage = hidStorage; @@ -304,7 +304,7 @@ namespace Ryujinx.HLE.HOS public bool LoadKip(string kipPath) { - using SharedRef kipFile = new SharedRef(new LocalStorage(kipPath, FileAccess.Read)); + using SharedRef kipFile = new(new LocalStorage(kipPath, FileAccess.Read)); return ProcessLoaderHelper.LoadKip(KernelContext, new KipExecutable(in kipFile)); } diff --git a/src/Ryujinx.HLE/HOS/HorizonFsClient.cs b/src/Ryujinx.HLE/HOS/HorizonFsClient.cs index 67b3d9b14..56bc3bec3 100644 --- a/src/Ryujinx.HLE/HOS/HorizonFsClient.cs +++ b/src/Ryujinx.HLE/HOS/HorizonFsClient.cs @@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS Nca nca = new(_system.KeySet, ncaStorage); using IFileSystem ncaFileSystem = nca.OpenFileSystem(NcaSectionType.Data, _system.FsIntegrityCheckLevel); - using UniqueRef ncaFsRef = new UniqueRef(ncaFileSystem); + using UniqueRef ncaFsRef = new(ncaFileSystem); Result result = _fsClient.Register(mountName.ToU8Span(), ref ncaFsRef.Ref).ToHorizonResult(); if (result.IsFailure) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageHeap.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageHeap.cs index 3c3c83bb9..ec2eda97d 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageHeap.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageHeap.cs @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory _blocksCount = blockShifts.Length; _blocks = new Block[_memoryBlockPageShifts.Length]; - ArraySegment currBitmapStorage = new ArraySegment(new ulong[CalculateManagementOverheadSize(size, blockShifts)]); + ArraySegment currBitmapStorage = new(new ulong[CalculateManagementOverheadSize(size, blockShifts)]); for (int i = 0; i < blockShifts.Length; i++) { diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs index 8258c16c8..8985a4244 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs @@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory bool shouldFillPages, byte fillValue) { - using KScopedPageList scopedPageList = new KScopedPageList(Context.MemoryManager, pageList); + using KScopedPageList scopedPageList = new(Context.MemoryManager, pageList); ulong currentVa = address; @@ -188,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } } - using KScopedPageList scopedPageList = new KScopedPageList(Context.MemoryManager, pageList); + using KScopedPageList scopedPageList = new(Context.MemoryManager, pageList); foreach (KPageNode pageNode in pageList) { diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs index 1b7cd7cad..122845725 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs @@ -617,7 +617,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory return result; } - using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); + using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); return MapPages(address, pageList, permission, MemoryMapFlags.Private); } @@ -769,7 +769,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory Result result = region.AllocatePages(out KPageList pageList, pagesCount); - using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); + using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); void CleanUpForError() { @@ -1341,7 +1341,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory Result result = region.AllocatePages(out KPageList pageList, remainingPages); - using OnScopeExit _ = new OnScopeExit(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); + using OnScopeExit _ = new(() => pageList.DecrementPagesReferenceCount(Context.MemoryManager)); void CleanUpForError() { @@ -1867,7 +1867,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory ulong dstLastPagePa = 0; ulong currentVa = va; - using OnScopeExit _ = new OnScopeExit(() => + using OnScopeExit _ = new(() => { if (dstFirstPagePa != 0) { diff --git a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index c439a8fff..9bcaf9538 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall KProcess process = new(_context); - using OnScopeExit _ = new OnScopeExit(process.DecrementReferenceCount); + using OnScopeExit _ = new(process.DecrementReferenceCount); KResourceLimit resourceLimit; @@ -1425,7 +1425,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall KCodeMemory codeMemory = new(_context); - using OnScopeExit _ = new OnScopeExit(codeMemory.DecrementReferenceCount); + using OnScopeExit _ = new(codeMemory.DecrementReferenceCount); KProcess currentProcess = KernelStatic.GetCurrentProcess(); diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index ce0810990..38599b5fa 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -1232,7 +1232,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { if (_schedulerWaitEvent == null) { - ManualResetEvent schedulerWaitEvent = new ManualResetEvent(false); + ManualResetEvent schedulerWaitEvent = new(false); if (Interlocked.Exchange(ref _schedulerWaitEvent, schedulerWaitEvent) == null) { diff --git a/src/Ryujinx.HLE/HOS/ModLoader.cs b/src/Ryujinx.HLE/HOS/ModLoader.cs index 76edcc322..289a493a2 100644 --- a/src/Ryujinx.HLE/HOS/ModLoader.cs +++ b/src/Ryujinx.HLE/HOS/ModLoader.cs @@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS private static string EnsureBaseDirStructure(string modsBasePath) { - DirectoryInfo modsDir = new DirectoryInfo(modsBasePath); + DirectoryInfo modsDir = new(modsBasePath); modsDir.CreateSubdirectory(AmsContentsDir); modsDir.CreateSubdirectory(AmsNsoPatchDir); @@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS public static string GetApplicationDir(string modsBasePath, string applicationId) { - DirectoryInfo contentsDir = new DirectoryInfo(Path.Combine(modsBasePath, AmsContentsDir)); + DirectoryInfo contentsDir = new(Path.Combine(modsBasePath, AmsContentsDir)); DirectoryInfo applicationModsPath = FindApplicationDir(contentsDir, applicationId); if (applicationModsPath == null) @@ -273,7 +273,7 @@ namespace Ryujinx.HLE.HOS } } - FileInfo fsFile = new FileInfo(Path.Combine(applicationDir.FullName, RomfsContainer)); + FileInfo fsFile = new(Path.Combine(applicationDir.FullName, RomfsContainer)); if (fsFile.Exists) { Mod modData = modMetadata.Mods.FirstOrDefault(x => fsFile.FullName.Contains(x.Path)); @@ -432,7 +432,7 @@ namespace Ryujinx.HLE.HOS foreach (string path in searchDirPaths) { - DirectoryInfo searchDir = new DirectoryInfo(path); + DirectoryInfo searchDir = new(path); if (!searchDir.Exists) { Logger.Warning?.Print(LogClass.ModLoader, $"Mod Search Dir '{searchDir.FullName}' doesn't exist"); @@ -470,8 +470,8 @@ namespace Ryujinx.HLE.HOS return baseStorage; } - HashSet fileSet = new HashSet(); - RomFsBuilder builder = new RomFsBuilder(); + HashSet fileSet = new(); + RomFsBuilder builder = new(); int count = 0; Logger.Info?.Print(LogClass.ModLoader, $"Applying RomFS mods for Application {applicationId:X16}"); @@ -517,12 +517,12 @@ namespace Ryujinx.HLE.HOS Logger.Info?.Print(LogClass.ModLoader, $"Replaced {fileSet.Count} file(s) over {count} mod(s). Processing base storage..."); // And finally, the base romfs - RomFsFileSystem baseRom = new RomFsFileSystem(baseStorage); + RomFsFileSystem baseRom = new(baseStorage); foreach (DirectoryEntryEx entry in baseRom.EnumerateEntries() .Where(f => f.Type == DirectoryEntryType.File && !fileSet.Contains(f.FullPath)) .OrderBy(f => f.FullPath, StringComparer.Ordinal)) { - using UniqueRef file = new UniqueRef(); + using UniqueRef file = new(); baseRom.OpenFile(ref file.Ref, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); builder.AddFile(entry.FullPath, file.Release()); @@ -542,7 +542,7 @@ namespace Ryujinx.HLE.HOS .Where(f => f.Type == DirectoryEntryType.File) .OrderBy(f => f.FullPath, StringComparer.Ordinal)) { - LazyFile file = new LazyFile(entry.FullPath, rootPath, fs); + LazyFile file = new(entry.FullPath, rootPath, fs); if (fileSet.Add(entry.FullPath)) { @@ -569,7 +569,7 @@ namespace Ryujinx.HLE.HOS Logger.Info?.Print(LogClass.ModLoader, "Using replacement ExeFS partition"); - PartitionFileSystem pfs = new PartitionFileSystem(); + PartitionFileSystem pfs = new(); pfs.Initialize(mods.ExefsContainers[0].Path.OpenRead().AsStorage()).ThrowIfFailure(); exefs = pfs; @@ -753,7 +753,7 @@ namespace Ryujinx.HLE.HOS patches[i] = new MemPatch(); } - List buildIds = new List(programs.Length); + List buildIds = new(programs.Length); foreach (IExecutable p in programs) { @@ -793,17 +793,17 @@ namespace Ryujinx.HLE.HOS Logger.Info?.Print(LogClass.ModLoader, $"Matching IPS patch '{patchFile.Name}' in '{mod.Name}' bid={buildId}"); using FileStream fs = patchFile.OpenRead(); - using BinaryReader reader = new BinaryReader(fs); + using BinaryReader reader = new(fs); - IpsPatcher patcher = new IpsPatcher(reader); + IpsPatcher patcher = new(reader); patcher.AddPatches(patches[index]); } else if (StrEquals(".pchtxt", patchFile.Extension)) // IPSwitch { using FileStream fs = patchFile.OpenRead(); - using StreamReader reader = new StreamReader(fs); + using StreamReader reader = new(fs); - IPSwitchPatcher patcher = new IPSwitchPatcher(reader); + IPSwitchPatcher patcher = new(reader); int index = GetIndex(patcher.BuildId); if (index == -1) diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index 279e696be..e97fb15a4 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } } - public void AddUser(string name, byte[] image, UserId userId = new UserId()) + public void AddUser(string name, byte[] image, UserId userId = new()) { if (userId.IsNull) { @@ -194,7 +194,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc SaveDataFilter saveDataFilter = SaveDataFilter.Make(programId: default, saveType: default, new LibHac.Fs.UserId((ulong)userId.High, (ulong)userId.Low), saveDataId: default, index: default); - using UniqueRef saveDataIterator = new UniqueRef(); + using UniqueRef saveDataIterator = new(); _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs index 7f98b0044..2f0454a89 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs @@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService byte[] deviceAccountId = new byte[0x10]; RandomNumberGenerator.Fill(deviceId); - SecurityTokenDescriptor descriptor = new SecurityTokenDescriptor + SecurityTokenDescriptor descriptor = new() { Subject = new GenericIdentity(Convert.ToHexString(rawUserId).ToLower()), SigningCredentials = credentials, diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs index f58e5b891..ad776fe6e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs +++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs @@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys _vrModeEnabled = vrModeEnabled; - using LblApi lblApi = new LblApi(); + using LblApi lblApi = new(); if (vrModeEnabled) { diff --git a/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs b/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs index 67cbb81ac..2dd86b436 100644 --- a/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Caps/CaptureManager.cs @@ -118,7 +118,7 @@ namespace Ryujinx.HLE.HOS.Services.Caps } // NOTE: The saved JPEG file doesn't have the limitation in the extra EXIF data. - using SKBitmap bitmap = new SKBitmap(new SKImageInfo(1280, 720, SKColorType.Rgba8888)); + using SKBitmap bitmap = new(new SKImageInfo(1280, 720, SKColorType.Rgba8888)); Marshal.Copy(screenshotData, 0, bitmap.GetPixels(), screenshotData.Length); using SKData data = bitmap.Encode(SKEncodedImageFormat.Jpeg, 80); using FileStream file = File.OpenWrite(filePath); diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs index 796ece16c..53904369b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs @@ -26,7 +26,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy try { LocalStorage storage = new(pfsPath, FileAccess.Read, FileMode.Open); - PartitionFileSystem pfs = new PartitionFileSystem(); + PartitionFileSystem pfs = new(); using SharedRef nsp = new(pfs); pfs.Initialize(storage).ThrowIfFailure(); @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy } LibHac.Fs.Fsa.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); - using SharedRef sharedFs = new SharedRef(fileSystem); + using SharedRef sharedFs = new(fileSystem); using SharedRef adapter = FileSystemInterfaceAdapter.CreateShared(ref sharedFs.Ref, true); @@ -99,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy string filename = fullPath.Replace(archivePath.FullName, string.Empty).TrimStart('\\'); - using UniqueRef ncaFile = new UniqueRef(); + using UniqueRef ncaFile = new(); Result result = nsp.OpenFile(ref ncaFile.Ref, filename.ToU8Span(), OpenMode.Read); if (result.IsFailure()) @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { foreach (DirectoryEntryEx ticketEntry in nsp.EnumerateEntries("/", "*.tik")) { - using UniqueRef ticketFile = new UniqueRef(); + using UniqueRef ticketFile = new(); Result result = nsp.OpenFile(ref ticketFile.Ref, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs index ff0cb7aed..0ed56ea4e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs @@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy uint mode = context.RequestData.ReadUInt32(); ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context); - using SharedRef file = new SharedRef(); + using SharedRef file = new(); Result result = _fileSystem.Get.OpenFile(ref file.Ref, in name, mode); @@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy uint mode = context.RequestData.ReadUInt32(); ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context); - using SharedRef dir = new SharedRef(); + using SharedRef dir = new(); Result result = _fileSystem.Get.OpenDirectory(ref dir.Ref, name, mode); diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index 4ccc7cc92..d353ce64f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs BisPartitionId bisPartitionId = (BisPartitionId)context.RequestData.ReadInt32(); ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenBisFileSystem(ref fileSystem.Ref, in path, bisPartitionId); if (result.IsFailure()) @@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenBisStorage(ServiceCtx context) { BisPartitionId bisPartitionId = (BisPartitionId)context.RequestData.ReadInt32(); - using SharedRef storage = new SharedRef(); + using SharedRef storage = new(); Result result = _baseFileSystemProxy.Get.OpenBisStorage(ref storage.Ref, bisPartitionId); if (result.IsFailure()) @@ -152,7 +152,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenSdCardFileSystem() -> object public ResultCode OpenSdCardFileSystem(ServiceCtx context) { - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenSdCardFileSystem(ref fileSystem.Ref); if (result.IsFailure()) @@ -260,7 +260,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { GameCardHandle handle = context.RequestData.ReadUInt32(); GameCardPartitionRaw partitionId = (GameCardPartitionRaw)context.RequestData.ReadInt32(); - using SharedRef storage = new SharedRef(); + using SharedRef storage = new(); Result result = _baseFileSystemProxy.Get.OpenGameCardStorage(ref storage.Ref, handle, partitionId); if (result.IsFailure()) @@ -279,7 +279,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { GameCardHandle handle = context.RequestData.ReadUInt32(); GameCardPartition partitionId = (GameCardPartition)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenGameCardFileSystem(ref fileSystem.Ref, handle, partitionId); if (result.IsFailure()) @@ -360,7 +360,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataAttribute attribute = context.RequestData.ReadStruct(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) @@ -379,7 +379,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataAttribute attribute = context.RequestData.ReadStruct(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystemBySystemSaveDataId(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) @@ -398,7 +398,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataAttribute attribute = context.RequestData.ReadStruct(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenReadOnlySaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) @@ -469,7 +469,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenSaveDataInfoReader() -> object public ResultCode OpenSaveDataInfoReader(ServiceCtx context) { - using SharedRef infoReader = new SharedRef(); + using SharedRef infoReader = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReader(ref infoReader.Ref); if (result.IsFailure()) @@ -487,7 +487,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenSaveDataInfoReaderBySaveDataSpaceId(ServiceCtx context) { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadByte(); - using SharedRef infoReader = new SharedRef(); + using SharedRef infoReader = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderBySaveDataSpaceId(ref infoReader.Ref, spaceId); if (result.IsFailure()) @@ -504,7 +504,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenSaveDataInfoReaderOnlyCacheStorage() -> object public ResultCode OpenSaveDataInfoReaderOnlyCacheStorage(ServiceCtx context) { - using SharedRef infoReader = new SharedRef(); + using SharedRef infoReader = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderOnlyCacheStorage(ref infoReader.Ref); if (result.IsFailure()) @@ -523,7 +523,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); ulong saveDataId = context.RequestData.ReadUInt64(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataInternalStorageFileSystem(ref fileSystem.Ref, spaceId, saveDataId); if (result.IsFailure()) @@ -587,7 +587,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataFilter filter = context.RequestData.ReadStruct(); - using SharedRef infoReader = new SharedRef(); + using SharedRef infoReader = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderWithFilter(ref infoReader.Ref, spaceId, in filter); if (result.IsFailure()) @@ -664,7 +664,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt32(); SaveDataMetaType metaType = (SaveDataMetaType)context.RequestData.ReadInt32(); SaveDataAttribute attribute = context.RequestData.ReadStruct(); - using SharedRef file = new SharedRef(); + using SharedRef file = new(); Result result = _baseFileSystemProxy.Get.OpenSaveDataMetaFile(ref file.Ref, spaceId, in attribute, metaType); if (result.IsFailure()) @@ -702,7 +702,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenImageDirectoryFileSystem(ServiceCtx context) { ImageDirectoryId directoryId = (ImageDirectoryId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenImageDirectoryFileSystem(ref fileSystem.Ref, directoryId); if (result.IsFailure()) @@ -719,7 +719,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenBaseFileSystem(ServiceCtx context) { BaseFileSystemId fileSystemId = (BaseFileSystemId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenBaseFileSystem(ref fileSystem.Ref, fileSystemId); if (result.IsFailure()) @@ -736,7 +736,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenContentStorageFileSystem(ServiceCtx context) { ContentStorageId contentStorageId = (ContentStorageId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenContentStorageFileSystem(ref fileSystem.Ref, contentStorageId); if (result.IsFailure()) @@ -753,7 +753,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenCloudBackupWorkStorageFileSystem(ServiceCtx context) { CloudBackupWorkStorageId storageId = (CloudBackupWorkStorageId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref, storageId); if (result.IsFailure()) @@ -770,7 +770,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenCustomStorageFileSystem(ServiceCtx context) { CustomStorageId customStorageId = (CustomStorageId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenCustomStorageFileSystem(ref fileSystem.Ref, customStorageId); if (result.IsFailure()) @@ -788,8 +788,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenDataStorageByCurrentProcess(ServiceCtx context) { LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); - using SharedRef sharedStorage = new SharedRef(storage); - using SharedRef sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); + using SharedRef sharedStorage = new(storage); + using SharedRef sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref)); MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); @@ -813,8 +813,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs Logger.Info?.Print(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}"); LibHac.Fs.IStorage storage = context.Device.FileSystem.ModLoader.ApplyRomFsMods(titleId, aocStorage); - using SharedRef sharedStorage = new SharedRef(storage); - using SharedRef sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); + using SharedRef sharedStorage = new(storage); + using SharedRef sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref)); MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); @@ -848,8 +848,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs LibHac.Fs.IStorage ncaStorage = new LocalStorage(ncaPath, FileAccess.Read, FileMode.Open); Nca nca = new(context.Device.System.KeySet, ncaStorage); LibHac.Fs.IStorage romfsStorage = nca.OpenStorage(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); - using SharedRef sharedStorage = new SharedRef(romfsStorage); - using SharedRef sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); + using SharedRef sharedStorage = new(romfsStorage); + using SharedRef sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref)); MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); } @@ -879,8 +879,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenPatchDataStorageByCurrentProcess(ServiceCtx context) { LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); - using SharedRef sharedStorage = new SharedRef(storage); - using SharedRef sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); + using SharedRef sharedStorage = new(storage); + using SharedRef sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref)); MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); @@ -899,8 +899,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs } LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); - using SharedRef sharedStorage = new SharedRef(storage); - using SharedRef sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); + using SharedRef sharedStorage = new(storage); + using SharedRef sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref)); MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); @@ -911,7 +911,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenDataStorageByCurrentProcess() -> object dataStorage public ResultCode OpenDeviceOperator(ServiceCtx context) { - using SharedRef deviceOperator = new SharedRef(); + using SharedRef deviceOperator = new(); Result result = _baseFileSystemProxy.Get.OpenDeviceOperator(ref deviceOperator.Ref); if (result.IsFailure()) @@ -1310,7 +1310,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs [CommandCmif(1008)] public ResultCode OpenRegisteredUpdatePartition(ServiceCtx context) { - using SharedRef fileSystem = new SharedRef(); + using SharedRef fileSystem = new(); Result result = _baseFileSystemProxy.Get.OpenRegisteredUpdatePartition(ref fileSystem.Ref); if (result.IsFailure()) @@ -1420,7 +1420,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenMultiCommitManager() -> object public ResultCode OpenMultiCommitManager(ServiceCtx context) { - using SharedRef commitManager = new SharedRef(); + using SharedRef commitManager = new(); Result result = _baseFileSystemProxy.Get.OpenMultiCommitManager(ref commitManager.Ref); if (result.IsFailure()) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs index e6b8ab1ec..1f93cd1d9 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs @@ -244,7 +244,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm byte[] ip = address.GetAddressBytes(); - Array6 macAddress = new Array6(); + Array6 macAddress = new(); new byte[] { 0x02, 0x00, ip[0], ip[1], ip[2], ip[3] }.CopyTo(macAddress.AsSpan()); return macAddress; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/Proxy/LdnProxyUdpServer.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/Proxy/LdnProxyUdpServer.cs index b1040e646..374871311 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/Proxy/LdnProxyUdpServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/Proxy/LdnProxyUdpServer.cs @@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm.Proxy lock (_scanLock) { - Dictionary results = new Dictionary(); + Dictionary results = new(); foreach (KeyValuePair last in _scanResultsLast) { 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 a21fb190a..2277420f6 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 = new(); private const int InactiveTimeout = 6000; private const int FailureTimeout = 4000; @@ -31,16 +31,16 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu private bool _useP2pProxy; private NetworkError _lastError; - private readonly ManualResetEvent _connected = new ManualResetEvent(false); - private readonly ManualResetEvent _error = new ManualResetEvent(false); - private readonly ManualResetEvent _scan = new ManualResetEvent(false); - private readonly ManualResetEvent _reject = new ManualResetEvent(false); - private readonly AutoResetEvent _apConnected = new AutoResetEvent(false); + private readonly ManualResetEvent _connected = new(false); + private readonly ManualResetEvent _error = new(false); + private readonly ManualResetEvent _scan = new(false); + private readonly ManualResetEvent _reject = new(false); + private readonly AutoResetEvent _apConnected = new(false); private readonly RyuLdnProtocol _protocol; private readonly NetworkTimeout _timeout; - private readonly List _availableGames = new List(); + private readonly List _availableGames = new(); private DisconnectReason _disconnectReason; private P2pProxyServer _hostedProxy; @@ -490,7 +490,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu SendAsync(_protocol.Encode(PacketId.CreateAccessPoint, request, advertiseData)); // Send a network change event with dummy data immediately. Necessary to avoid crashes in some games - NetworkChangeEventArgs networkChangeEvent = new NetworkChangeEventArgs(new NetworkInfo() + NetworkChangeEventArgs networkChangeEvent = new(new NetworkInfo() { Common = new CommonNetworkInfo() { @@ -610,7 +610,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu SendAsync(_protocol.Encode(PacketId.Connect, request)); - NetworkChangeEventArgs networkChangeEvent = new NetworkChangeEventArgs(new NetworkInfo() + NetworkChangeEventArgs networkChangeEvent = new(new NetworkInfo() { Common = request.NetworkInfo.Common, Ldn = request.NetworkInfo.Ldn diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs index 9ea56d050..01579e78f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs @@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { private const ushort EphemeralBase = 49152; - private readonly List _ephemeralPorts = new List(); + private readonly List _ephemeralPorts = new(); private readonly Lock _lock = new(); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs index bb390d49a..540ef9104 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs @@ -13,8 +13,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy public EndPoint LocalEndpoint { get; } public IPAddress LocalAddress { get; } - private readonly List _sockets = new List(); - private readonly Dictionary _ephemeralPorts = new Dictionary(); + private readonly List _sockets = new(); + private readonly Dictionary _ephemeralPorts = new(); private readonly IProxyClient _parent; private RyuLdnProtocol _protocol; @@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy public void HandleData(LdnHeader header, ProxyDataHeader proxyHeader, byte[] data) { - ProxyDataPacket packet = new ProxyDataPacket() { Header = proxyHeader, Data = data }; + ProxyDataPacket packet = new() { Header = proxyHeader, Data = data }; ForRoutedSockets(proxyHeader.Info, (socket) => { @@ -179,7 +179,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { // We must ask the other side to initialize a connection, so they can accept a socket for us. - ProxyConnectRequest request = new ProxyConnectRequest + ProxyConnectRequest request = new() { Info = MakeInfo(localEp, remoteEp, type) }; @@ -191,7 +191,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { // We must tell the other side that we have accepted their request for connection. - ProxyConnectResponse request = new ProxyConnectResponse + ProxyConnectResponse request = new() { Info = MakeInfo(localEp, remoteEp, type) }; @@ -203,7 +203,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { // We must tell the other side that our connection is dropped. - ProxyDisconnectMessage request = new ProxyDisconnectMessage + ProxyDisconnectMessage request = new() { Info = MakeInfo(localEp, remoteEp, type), DisconnectReason = 0 // TODO @@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy // We send exactly as much as the user wants us to, currently instantly. // TODO: handle over "virtual mtu" (we have a max packet size to worry about anyways). fragment if tcp? throw if udp? - ProxyDataHeader request = new ProxyDataHeader + ProxyDataHeader request = new() { Info = MakeInfo(localEp, remoteEp, type), DataLength = (uint)buffer.Length diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs index 705e67ecd..bb93bcb45 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs @@ -18,21 +18,21 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private readonly LdnProxy _proxy; private bool _isListening; - private readonly List _listenSockets = new List(); + private readonly List _listenSockets = new(); - private readonly Queue _connectRequests = new Queue(); + private readonly Queue _connectRequests = new(); - private readonly AutoResetEvent _acceptEvent = new AutoResetEvent(false); + private readonly AutoResetEvent _acceptEvent = new(false); private readonly int _acceptTimeout = -1; - private readonly Queue _errors = new Queue(); + private readonly Queue _errors = new(); - private readonly AutoResetEvent _connectEvent = new AutoResetEvent(false); + private readonly AutoResetEvent _connectEvent = new(false); private ProxyConnectResponse _connectResponse; private int _receiveTimeout = -1; - private readonly AutoResetEvent _receiveEvent = new AutoResetEvent(false); - private readonly Queue _receiveQueue = new Queue(); + private readonly AutoResetEvent _receiveEvent = new(false); + private readonly Queue _receiveQueue = new(); // private int _sendTimeout = -1; // Sends are techically instant right now, so not _really_ used. @@ -42,7 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy // private bool _writeShutdown; private bool _closed; - private readonly Dictionary _socketOptions = new Dictionary() + private readonly Dictionary _socketOptions = new() { { SocketOptionName.Broadcast, 0 }, //TODO: honor this value { SocketOptionName.DontLinger, 0 }, @@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy } } - IPEndPoint localEp = new IPEndPoint(_proxy.LocalAddress, _proxy.GetEphemeralPort(ProtocolType)); + IPEndPoint localEp = new(_proxy.LocalAddress, _proxy.GetEphemeralPort(ProtocolType)); LocalEndPoint = localEp; return localEp; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyClient.cs index 7da1aa998..7392ef62b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyClient.cs @@ -16,9 +16,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private readonly RyuLdnProtocol _protocol; - private readonly ManualResetEvent _connected = new ManualResetEvent(false); - private readonly ManualResetEvent _ready = new ManualResetEvent(false); - private readonly AutoResetEvent _error = new AutoResetEvent(false); + private readonly ManualResetEvent _connected = new(false); + private readonly ManualResetEvent _ready = new(false); + private readonly AutoResetEvent _error = new(false); public P2pProxyClient(string address, int port) : base(address, port) { diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs index fbce5c10c..26aba483c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs @@ -29,22 +29,22 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private const ushort AuthWaitSeconds = 1; - private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); + private readonly ReaderWriterLockSlim _lock = new(LockRecursionPolicy.SupportsRecursion); public ushort PrivatePort { get; } private ushort _publicPort; private bool _disposed; - private readonly CancellationTokenSource _disposedCancellation = new CancellationTokenSource(); + private readonly CancellationTokenSource _disposedCancellation = new(); private NatDevice _natDevice; private Mapping _portMapping; - private readonly List _players = new List(); + private readonly List _players = new(); - private readonly List _waitingTokens = new List(); - private readonly AutoResetEvent _tokenEvent = new AutoResetEvent(false); + private readonly List _waitingTokens = new(); + private readonly AutoResetEvent _tokenEvent = new(false); private uint _broadcastAddress; @@ -112,8 +112,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy public async Task NatPunch() { - NatDiscoverer discoverer = new NatDiscoverer(); - CancellationTokenSource cts = new CancellationTokenSource(1000); + NatDiscoverer discoverer = new(); + CancellationTokenSource cts = new(1000); NatDevice device; @@ -300,7 +300,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy session.SetIpv4(waitToken.VirtualIp); - ProxyConfig pconfig = new ProxyConfig + ProxyConfig pconfig = new() { ProxyIp = session.VirtualIpAddress, ProxySubnetMask = 0xFFFF0000 // TODO: Use from server. diff --git a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs index dffcf9c3f..44d164eba 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboBinReader.cs @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption string nickName = amiiboDump.AmiiboNickname; LogFinalData(titleId, appId, head, tail, finalID, nickName, initDateTime, writeDateTime, settingsValue, writeCounterValue, applicationAreas); - VirtualAmiiboFile virtualAmiiboFile = new VirtualAmiiboFile + VirtualAmiiboFile virtualAmiiboFile = new() { FileVersion = 1, TagUuid = uid, @@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption readBytes = newFileBytes; } - AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath); + AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath); AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes); byte[] oldData = amiiboDump.GetData(); @@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption readBytes = newFileBytes; } - AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath); + AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath); AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes); amiiboDump.AmiiboNickname = newNickName; byte[] oldData = amiiboDump.GetData(); diff --git a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs index c5788a4b9..9873ae1be 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs @@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(seedBytes, 0, dataForAes, 2, seedBytes.Length); byte[] derivedBytes; - using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey)) + using (HMACSHA256 hmac = new(key.HmacKey)) { derivedBytes = hmac.ComputeHash(dataForAes); } @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption dataForHmacKey[1] = 0x01; // Counter (1) Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length); - using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey)) + using (HMACSHA256 hmac = new(key.HmacKey)) { derivedBytes = hmac.ComputeHash(dataForHmacKey); } @@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length); byte[] derivedBytes; - using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey)) + using (HMACSHA256 hmac = new(key.HmacKey)) { derivedBytes = hmac.ComputeHash(dataForHmacKey); } @@ -229,7 +229,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(data, 0x054, tagHmacData, 8, 44); byte[] tagHmac; - using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey)) + using (HMACSHA256 hmac = new(hmacTagKey)) { tagHmac = hmac.ComputeHash(tagHmacData); } @@ -258,7 +258,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(data, 0x054, dataHmacData, offset, len5); byte[] dataHmac; - using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey)) + using (HMACSHA256 hmac = new(hmacDataKey)) { dataHmac = hmac.ComputeHash(dataHmacData); } @@ -278,7 +278,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(data, 0x054, tagHmacData, 8, 44); byte[] calculatedTagHmac; - using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey)) + using (HMACSHA256 hmac = new(hmacTagKey)) { calculatedTagHmac = hmac.ComputeHash(tagHmacData); } @@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption Array.Copy(data, 0x054, dataHmacData, offset, len5); byte[] calculatedDataHmac; - using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey)) + using (HMACSHA256 hmac = new(hmacDataKey)) { calculatedDataHmac = hmac.ComputeHash(dataHmacData); } diff --git a/src/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs b/src/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs index 57b31e662..b8495f643 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs @@ -18,8 +18,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv MemoryAllocator = new NvMemoryAllocator(); Host1x = new Host1xDevice(gpu.Synchronization); Smmu = gpu.CreateDeviceMemoryManager(pid); - NvdecDevice nvdec = new NvdecDevice(Smmu); - VicDevice vic = new VicDevice(Smmu); + NvdecDevice nvdec = new(Smmu); + VicDevice vic = new(Smmu); Host1x.RegisterDevice(ClassId.Nvdec, nvdec); Host1x.RegisterDevice(ClassId.Vic, vic); } diff --git a/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs b/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs index 3422343fd..6ce45de88 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs @@ -33,8 +33,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu } private static readonly VmRegion[] _vmRegions = { - new VmRegion((ulong)BigPageSize << 16, SmallRegionLimit), - new VmRegion(SmallRegionLimit, DefaultUserSize), + new((ulong)BigPageSize << 16, SmallRegionLimit), + new(SmallRegionLimit, DefaultUserSize), }; private readonly AddressSpaceContext _asContext; diff --git a/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs b/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs index 3cc43a551..d0e3a7a44 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs @@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl Nca nca = new(_device.System.KeySet, ncaFileStream); IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _device.System.FsIntegrityCheckLevel); - using UniqueRef fontFile = new UniqueRef(); + using UniqueRef fontFile = new(); romfs.OpenFile(ref fontFile.Ref, ("/" + fontFilename).ToU8Span(), OpenMode.Read).ThrowIfFailure(); diff --git a/src/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs b/src/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs index df2f76563..cfad2884a 100644 --- a/src/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs @@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings IFileSystem firmwareRomFs = firmwareContent.OpenFileSystem(NcaSectionType.Data, device.System.FsIntegrityCheckLevel); - using UniqueRef firmwareFile = new UniqueRef(); + using UniqueRef firmwareFile = new(); Result result = firmwareRomFs.OpenFile(ref firmwareFile.Ref, "/file".ToU8Span(), OpenMode.Read); if (result.IsFailure()) diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs index adde15b32..763ab8d60 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs @@ -129,7 +129,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel); - using UniqueRef trustedCertsFileRef = new UniqueRef(); + using UniqueRef trustedCertsFileRef = new(); Result result = romfs.OpenFile(ref trustedCertsFileRef.Ref, "/ssl_TrustedCerts.bdf".ToU8Span(), OpenMode.Read); diff --git a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index 82d33578e..e00af70f5 100644 --- a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone Nca nca = new(_virtualFileSystem.KeySet, ncaFileStream); IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel); - using UniqueRef binaryListFile = new UniqueRef(); + using UniqueRef binaryListFile = new(); romfs.OpenFile(ref binaryListFile.Ref, "/binaryList.txt".ToU8Span(), OpenMode.Read).ThrowIfFailure(); @@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone continue; } - using UniqueRef tzif = new UniqueRef(); + using UniqueRef tzif = new(); if (romfs.OpenFile(ref tzif.Ref, $"/zoneinfo/{locName}".ToU8Span(), OpenMode.Read).IsFailure()) { @@ -269,7 +269,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone Nca nca = new(_virtualFileSystem.KeySet, ncaFile); IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel); - using UniqueRef timeZoneBinaryFile = new UniqueRef(); + using UniqueRef timeZoneBinaryFile = new(); Result result = romfs.OpenFile(ref timeZoneBinaryFile.Ref, $"/zoneinfo/{locationName}".ToU8Span(), OpenMode.Read); diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs index d68b1e200..5874636e7 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs @@ -62,7 +62,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions Logger.Info?.Print(LogClass.Loader, $"Loading {name}..."); - using UniqueRef nsoFile = new UniqueRef(); + using UniqueRef nsoFile = new(); exeFs.OpenFile(ref nsoFile.Ref, $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure(); diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/LocalFileSystemExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/LocalFileSystemExtensions.cs index a5c22177f..140be91b5 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/LocalFileSystemExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/LocalFileSystemExtensions.cs @@ -12,7 +12,7 @@ namespace Ryujinx.HLE.Loaders.Processes public static ProcessResult Load(this LocalFileSystem exeFs, Switch device, string romFsPath = "") { MetaLoader metaLoader = exeFs.GetNpdm(); - BlitStruct nacpData = new BlitStruct(1); + BlitStruct nacpData = new(1); ulong programId = metaLoader.GetProgramId(); device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]); diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/MetaLoaderExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/MetaLoaderExtensions.cs index eed7a1be5..f6dab1583 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/MetaLoaderExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/MetaLoaderExtensions.cs @@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions path = ProcessConst.MainNpdmPath; } - using UniqueRef npdmFile = new UniqueRef(); + using UniqueRef npdmFile = new(); fileSystem.OpenFile(ref npdmFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure(); diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/NcaExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/NcaExtensions.cs index c4d47d5bd..be37078f5 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/NcaExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/NcaExtensions.cs @@ -49,7 +49,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions ModLoader.GetSdModsBasePath()); // Load Nacp file. - BlitStruct nacpData = new BlitStruct(1); + BlitStruct nacpData = new(1); if (controlNca != null) { @@ -214,9 +214,9 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions public static BlitStruct GetNacp(this Nca controlNca, Switch device) { - BlitStruct nacpData = new BlitStruct(1); + BlitStruct nacpData = new(1); - using UniqueRef controlFile = new UniqueRef(); + using UniqueRef controlFile = new(); Result result = controlNca.OpenFileSystem(NcaSectionType.Data, device.System.FsIntegrityCheckLevel) .OpenFile(ref controlFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read); @@ -236,7 +236,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions public static Cnmt GetCnmt(this Nca cnmtNca, IntegrityCheckLevel checkLevel, ContentMetaType metaType) { string path = $"/{metaType}_{cnmtNca.Header.TitleId:x16}.cnmt"; - using UniqueRef cnmtFile = new UniqueRef(); + using UniqueRef cnmtFile = new(); try { diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs index 4a9eafea1..798b1f86f 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/PartitionFileSystemExtensions.cs @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions { fileSystem.ImportTickets(partitionFileSystem); - Dictionary programs = new Dictionary(); + Dictionary programs = new(); foreach (DirectoryEntryEx fileEntry in partitionFileSystem.EnumerateEntries("/", "*.cnmt.nca")) { @@ -152,7 +152,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions public static Nca GetNca(this IFileSystem fileSystem, KeySet keySet, string path) { - using UniqueRef ncaFile = new UniqueRef(); + using UniqueRef ncaFile = new(); fileSystem.OpenFile(ref ncaFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure(); diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs index b9746da16..726b017b6 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs @@ -161,7 +161,7 @@ namespace Ryujinx.HLE.Loaders.Processes public bool LoadNxo(string path) { - BlitStruct nacpData = new BlitStruct(1); + BlitStruct nacpData = new(1); IFileSystem dummyExeFs = null; Stream romfsStream = null; diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs index 32266d5ca..b11057da2 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs @@ -180,7 +180,7 @@ namespace Ryujinx.HLE.Loaders.Processes KProcess process = new(context); - ArmProcessContextFactory processContextFactory = new ArmProcessContextFactory( + ArmProcessContextFactory processContextFactory = new( context.Device.System.TickSource, context.Device.Gpu, string.Empty, @@ -373,7 +373,7 @@ namespace Ryujinx.HLE.Loaders.Processes displayVersion = device.System.ContentManager.GetCurrentFirmwareVersion()?.VersionString ?? string.Empty; } - ArmProcessContextFactory processContextFactory = new ArmProcessContextFactory( + ArmProcessContextFactory processContextFactory = new( context.Device.System.TickSource, context.Device.Gpu, $"{programId:x16}", diff --git a/src/Ryujinx.HLE/StructHelpers.cs b/src/Ryujinx.HLE/StructHelpers.cs index f573f0eb6..a9a00c2d7 100644 --- a/src/Ryujinx.HLE/StructHelpers.cs +++ b/src/Ryujinx.HLE/StructHelpers.cs @@ -18,7 +18,7 @@ namespace Ryujinx.HLE const int OffsetOfApplicationPublisherStrings = 0x200; - BlitStruct nacpData = new BlitStruct(1); + BlitStruct nacpData = new(1); // name and publisher buffer // repeat once for each locale (the ApplicationControlProperty has 16 locales) diff --git a/src/Ryujinx.HLE/Utilities/PartitionFileSystemUtils.cs b/src/Ryujinx.HLE/Utilities/PartitionFileSystemUtils.cs index 1bd6e0ff7..671bcaa06 100644 --- a/src/Ryujinx.HLE/Utilities/PartitionFileSystemUtils.cs +++ b/src/Ryujinx.HLE/Utilities/PartitionFileSystemUtils.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.Utilities } else { - PartitionFileSystem pfsTemp = new PartitionFileSystem(); + PartitionFileSystem pfsTemp = new(); Result initResult = pfsTemp.Initialize(file.AsStorage()); if (throwOnFailure)