diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-28 04:40:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 04:40:46 +0200 |
commit | b096ec68cdbf6f1064a8b6b855489d38c3e59f6a (patch) | |
tree | 605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/nro.cpp | |
parent | Merge pull request #6246 from lioncash/shadow (diff) | |
parent | loader: Resolve instances of variable shadowing (diff) | |
download | yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.gz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.bz2 yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.lz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.xz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.zst yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.zip |
Diffstat (limited to 'src/core/loader/nro.cpp')
-rw-r--r-- | src/core/loader/nro.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 0115ed0c4..0597cfa60 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -72,7 +72,7 @@ struct AssetHeader { }; static_assert(sizeof(AssetHeader) == 0x38, "AssetHeader has incorrect size."); -AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file) : AppLoader(file) { +AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) { NroHeader nro_header{}; if (file->ReadObject(&nro_header) != sizeof(NroHeader)) { return; @@ -114,10 +114,10 @@ AppLoader_NRO::AppLoader_NRO(FileSys::VirtualFile file) : AppLoader(file) { AppLoader_NRO::~AppLoader_NRO() = default; -FileType AppLoader_NRO::IdentifyType(const FileSys::VirtualFile& file) { +FileType AppLoader_NRO::IdentifyType(const FileSys::VirtualFile& nro_file) { // Read NSO header NroHeader nro_header{}; - if (sizeof(NroHeader) != file->ReadObject(&nro_header)) { + if (sizeof(NroHeader) != nro_file->ReadObject(&nro_header)) { return FileType::Error; } if (nro_header.magic == Common::MakeMagic('N', 'R', 'O', '0')) { @@ -130,8 +130,7 @@ static constexpr u32 PageAlignSize(u32 size) { return static_cast<u32>((size + Core::Memory::PAGE_MASK) & ~Core::Memory::PAGE_MASK); } -static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data, - const std::string& name) { +static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data) { if (data.size() < sizeof(NroHeader)) { return {}; } @@ -200,8 +199,8 @@ static bool LoadNroImpl(Kernel::Process& process, const std::vector<u8>& data, return true; } -bool AppLoader_NRO::LoadNro(Kernel::Process& process, const FileSys::VfsFile& file) { - return LoadNroImpl(process, file.ReadAllBytes(), file.GetName()); +bool AppLoader_NRO::LoadNro(Kernel::Process& process, const FileSys::VfsFile& nro_file) { + return LoadNroImpl(process, nro_file.ReadAllBytes()); } AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process, Core::System& system) { |