diff options
| author | 2021-04-27 12:05:34 -0400 | |
|---|---|---|
| committer | 2021-04-27 12:48:15 -0400 | |
| commit | 724c19a307f31ce1122fb8047c86d5a126d0860f (patch) | |
| tree | 605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/elf.cpp | |
| parent | Merge pull request #6246 from lioncash/shadow (diff) | |
| download | yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.gz yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.xz yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.zip | |
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.
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 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 | |||
| 364 | 364 | ||
| 365 | namespace Loader { | 365 | namespace Loader { |
| 366 | 366 | ||
| 367 | AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} | 367 | AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {} |
| 368 | 368 | ||
| 369 | FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& file) { | 369 | FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) { |
| 370 | static constexpr u16 ELF_MACHINE_ARM{0x28}; | 370 | static constexpr u16 ELF_MACHINE_ARM{0x28}; |
| 371 | 371 | ||
| 372 | u32 magic = 0; | 372 | u32 magic = 0; |
| 373 | if (4 != file->ReadObject(&magic)) | 373 | if (4 != elf_file->ReadObject(&magic)) { |
| 374 | return FileType::Error; | 374 | return FileType::Error; |
| 375 | } | ||
| 375 | 376 | ||
| 376 | u16 machine = 0; | 377 | u16 machine = 0; |
| 377 | if (2 != file->ReadObject(&machine, 18)) | 378 | if (2 != elf_file->ReadObject(&machine, 18)) { |
| 378 | return FileType::Error; | 379 | return FileType::Error; |
| 380 | } | ||
| 379 | 381 | ||
| 380 | if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) | 382 | if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) { |
| 381 | return FileType::ELF; | 383 | return FileType::ELF; |
| 384 | } | ||
| 382 | 385 | ||
| 383 | return FileType::Error; | 386 | return FileType::Error; |
| 384 | } | 387 | } |