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/nro.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/loader/nro.cpp') diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 24c2c55a9..b37c3a092 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -4,6 +4,7 @@ #include +#include "common/common_funcs.h" #include "common/logging/log.h" #include "common/swap.h" #include "core/hle/kernel/process.h" @@ -51,7 +52,7 @@ FileType AppLoader_NRO::IdentifyType(FileUtil::IOFile& file) { if (sizeof(NroHeader) != file.ReadBytes(&nro_header, sizeof(NroHeader))) { return FileType::Error; } - if (nro_header.magic == MakeMagic('N', 'R', 'O', '0')) { + if (nro_header.magic == Common::MakeMagic('N', 'R', 'O', '0')) { return FileType::NRO; } return FileType::Error; @@ -87,7 +88,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { if (sizeof(NroHeader) != file.ReadBytes(&nro_header, sizeof(NroHeader))) { return {}; } - if (nro_header.magic != MakeMagic('N', 'R', 'O', '0')) { + if (nro_header.magic != Common::MakeMagic('N', 'R', 'O', '0')) { return {}; } @@ -109,7 +110,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) { u32 bss_size{Memory::PAGE_SIZE}; // Default .bss to page size if MOD0 section doesn't exist std::memcpy(&mod_header, program_image.data() + nro_header.module_header_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