summaryrefslogtreecommitdiffstats
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-28 04:40:46 +0200
committerGitHub <noreply@github.com>2021-04-28 04:40:46 +0200
commitb096ec68cdbf6f1064a8b6b855489d38c3e59f6a (patch)
tree605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/elf.cpp
parentMerge pull request #6246 from lioncash/shadow (diff)
parentloader: Resolve instances of variable shadowing (diff)
downloadyuzu-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/elf.cpp')
-rw-r--r--src/core/loader/elf.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index f4a339390..627c18c7e 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;
}