From 2dafd0d287338981d510c19edaeb720c332a968f Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 20 Jan 2018 14:20:04 -0500 Subject: nso: Remove code specific to directory loading. --- src/core/loader/nso.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/loader/nso.h') diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index a24bcdc24..44d6dbbd9 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -31,10 +31,11 @@ public: return IdentifyType(file); } + static VAddr LoadModule(const std::string& path, VAddr load_base); + ResultStatus Load(Kernel::SharedPtr& process) override; private: - VAddr LoadNso(const std::string& path, VAddr load_base); std::string filepath; }; -- cgit v1.2.3 From 023aef053c96c92c9ea15d067f7d2cb7150585d6 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 20 Jan 2018 14:55:54 -0500 Subject: loader: Refactor to also pass filepath into IdentifyType. --- src/core/loader/nso.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core/loader/nso.h') diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 44d6dbbd9..f6a2b214f 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/common_types.h" #include "common/file_util.h" @@ -23,12 +22,13 @@ public: /** * Returns the type of the file * @param file FileUtil::IOFile open file + * @param filepath Path of the file that we are opening. * @return FileType found, or FileType::Error if this loader doesn't know it */ - static FileType IdentifyType(FileUtil::IOFile& file); + static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath); FileType GetFileType() override { - return IdentifyType(file); + return IdentifyType(file, filepath); } static VAddr LoadModule(const std::string& path, VAddr load_base); @@ -36,7 +36,6 @@ public: ResultStatus Load(Kernel::SharedPtr& process) override; private: - std::string filepath; }; -- cgit v1.2.3 From 386df282a3ad340ddaf7ab054102858406b27198 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 20 Jan 2018 15:48:37 -0500 Subject: loader: Clean up ctors and includes. --- src/core/loader/nso.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/core/loader/nso.h') diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index f6a2b214f..1ae30a824 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h @@ -6,7 +6,6 @@ #include #include "common/common_types.h" -#include "common/file_util.h" #include "core/hle/kernel/kernel.h" #include "core/loader/linker.h" #include "core/loader/loader.h" @@ -16,8 +15,7 @@ namespace Loader { /// Loads an NSO file class AppLoader_NSO final : public AppLoader, Linker { public: - AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath) - : AppLoader(std::move(file)), filepath(std::move(filepath)) {} + AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath); /** * Returns the type of the file -- cgit v1.2.3