From 746c2a3ae769c6172700e4f9e10ba01fa0df4ccb Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 15 Oct 2017 00:11:38 -0400 Subject: core: Refactor MakeMagic usage and remove dead code. --- src/core/loader/nso.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/loader/nso.cpp') diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 5ebbde19a..0d16d4b8c 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -5,6 +5,7 @@ #include #include +#include "common/common_funcs.h" #include "common/logging/log.h" #include "common/swap.h" #include "core/hle/kernel/process.h" @@ -50,7 +51,7 @@ FileType AppLoader_NSO::IdentifyType(FileUtil::IOFile& file) { return FileType::Error; } - if (MakeMagic('N', 'S', 'O', '0') == magic) { + if (Common::MakeMagic('N', 'S', 'O', '0') == magic) { return FileType::NSO; } @@ -96,7 +97,7 @@ VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relo if (sizeof(NsoHeader) != file.ReadBytes(&nso_header, sizeof(NsoHeader))) { return {}; } - if (nso_header.magic != MakeMagic('N', 'S', 'O', '0')) { + if (nso_header.magic != Common::MakeMagic('N', 'S', 'O', '0')) { return {}; } @@ -121,7 +122,7 @@ VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relo ModHeader mod_header{}; u32 bss_size{Memory::PAGE_SIZE}; // Default .bss to page size if MOD0 section doesn't exist std::memcpy(&mod_header, program_image.data() + module_offset, sizeof(ModHeader)); - const bool has_mod_header{mod_header.magic == MakeMagic('M', 'O', 'D', '0')}; + const bool has_mod_header{mod_header.magic == Common::MakeMagic('M', 'O', 'D', '0')}; if (has_mod_header) { // Resize program image to include .bss section and page align each section bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset); -- cgit v1.2.3