misc: chore: Fix object creation in HLE project

This commit is contained in:
Evan Husted
2025-01-26 15:15:26 -06:00
parent f1fd5c9366
commit beab133c8d
48 changed files with 194 additions and 194 deletions

View File

@@ -62,7 +62,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
Logger.Info?.Print(LogClass.Loader, $"Loading {name}...");
using UniqueRef<IFile> nsoFile = new UniqueRef<IFile>();
using UniqueRef<IFile> nsoFile = new();
exeFs.OpenFile(ref nsoFile.Ref, $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure();

View File

@@ -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<ApplicationControlProperty> nacpData = new BlitStruct<ApplicationControlProperty>(1);
BlitStruct<ApplicationControlProperty> nacpData = new(1);
ulong programId = metaLoader.GetProgramId();
device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]);

View File

@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
path = ProcessConst.MainNpdmPath;
}
using UniqueRef<IFile> npdmFile = new UniqueRef<IFile>();
using UniqueRef<IFile> npdmFile = new();
fileSystem.OpenFile(ref npdmFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure();

View File

@@ -49,7 +49,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
ModLoader.GetSdModsBasePath());
// Load Nacp file.
BlitStruct<ApplicationControlProperty> nacpData = new BlitStruct<ApplicationControlProperty>(1);
BlitStruct<ApplicationControlProperty> nacpData = new(1);
if (controlNca != null)
{
@@ -214,9 +214,9 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
public static BlitStruct<ApplicationControlProperty> GetNacp(this Nca controlNca, Switch device)
{
BlitStruct<ApplicationControlProperty> nacpData = new BlitStruct<ApplicationControlProperty>(1);
BlitStruct<ApplicationControlProperty> nacpData = new(1);
using UniqueRef<IFile> controlFile = new UniqueRef<IFile>();
using UniqueRef<IFile> 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<IFile> cnmtFile = new UniqueRef<IFile>();
using UniqueRef<IFile> cnmtFile = new();
try
{

View File

@@ -28,7 +28,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
{
fileSystem.ImportTickets(partitionFileSystem);
Dictionary<ulong, ContentMetaData> programs = new Dictionary<ulong, ContentMetaData>();
Dictionary<ulong, ContentMetaData> 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<IFile> ncaFile = new UniqueRef<IFile>();
using UniqueRef<IFile> ncaFile = new();
fileSystem.OpenFile(ref ncaFile.Ref, path.ToU8Span(), OpenMode.Read).ThrowIfFailure();