diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-27 19:40:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 19:40:46 -0700 |
commit | b096ec68cdbf6f1064a8b6b855489d38c3e59f6a (patch) | |
tree | 605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/elf.cpp | |
parent | cd80471c902540ae1086732234d45b6fb5b2e169 (diff) | |
parent | 724c19a307f31ce1122fb8047c86d5a126d0860f (diff) |
Merge pull request #6250 from lioncash/loader-shadow
loader: Resolve instances of variable shadowing
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r-- | src/core/loader/elf.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index f4a3393909..627c18c7e1 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -364,21 +364,24 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const namespace Loader { -AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} +AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {} -FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& file) { +FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) { static constexpr u16 ELF_MACHINE_ARM{0x28}; u32 magic = 0; - if (4 != file->ReadObject(&magic)) + if (4 != elf_file->ReadObject(&magic)) { return FileType::Error; + } u16 machine = 0; - if (2 != file->ReadObject(&machine, 18)) + if (2 != elf_file->ReadObject(&machine, 18)) { return FileType::Error; + } - if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) + if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) { return FileType::ELF; + } return FileType::Error; } |