loader: Resolve instances of variable shadowing
Eliminates variable shadowing cases across all the loaders to bring us closer to enabling variable shadowing as an error in core.
This commit is contained in:
parent
cd80471c90
commit
724c19a307
19 changed files with 257 additions and 169 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue