From c8e3f98c27b15055d033ab75c75c8b3e0455a40e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 14 Aug 2018 22:27:01 -0400 Subject: [PATCH 1/2] loader/xci: Remove unnecessary includes and member variables Many of these aren't necessary and will cause this file to be required to be recompiled whenever any changes to those files are made, which lengthens compile times for no reason. This also removes an unused metadata variable from AppLoader_XCI --- src/core/loader/xci.cpp | 14 +++----------- src/core/loader/xci.h | 12 ++++++++---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 5d67fb1862..4c49795454 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp @@ -4,22 +4,14 @@ #include -#include "common/file_util.h" -#include "common/logging/log.h" -#include "common/string_util.h" -#include "common/swap.h" -#include "core/core.h" +#include "common/common_types.h" +#include "core/file_sys/card_image.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/control_metadata.h" -#include "core/file_sys/program_metadata.h" #include "core/file_sys/romfs.h" -#include "core/gdbstub/gdbstub.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/resource_limit.h" -#include "core/hle/service/filesystem/filesystem.h" -#include "core/loader/nso.h" +#include "core/loader/nca.h" #include "core/loader/xci.h" -#include "core/memory.h" namespace Loader { diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h index 973833050e..cc4287e178 100644 --- a/src/core/loader/xci.h +++ b/src/core/loader/xci.h @@ -6,12 +6,18 @@ #include #include "common/common_types.h" -#include "core/file_sys/card_image.h" +#include "core/file_sys/vfs.h" #include "core/loader/loader.h" -#include "core/loader/nca.h" + +namespace FileSys { +class NACP; +class XCI; +} // namespace FileSys namespace Loader { +class AppLoader_NCA; + /// Loads an XCI file class AppLoader_XCI final : public AppLoader { public: @@ -37,8 +43,6 @@ public: ResultStatus ReadTitle(std::string& title) override; private: - FileSys::ProgramMetadata metadata; - std::unique_ptr xci; std::unique_ptr nca_loader; From 0769aa594e8814ffd7e70654cfd1bdc04ba0c5c4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 14 Aug 2018 22:37:12 -0400 Subject: [PATCH 2/2] loader/nca: Remove unnecessary includes and member variables --- src/core/loader/nca.cpp | 14 +++----------- src/core/loader/nca.h | 17 ++++++++--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index 8498cc94b9..9d50c7d426 100644 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp @@ -3,28 +3,22 @@ // Refer to the license.txt file included. #include -#include #include "common/file_util.h" #include "common/logging/log.h" -#include "common/string_util.h" -#include "common/swap.h" -#include "core/core.h" #include "core/file_sys/content_archive.h" -#include "core/file_sys/program_metadata.h" -#include "core/gdbstub/gdbstub.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/resource_limit.h" #include "core/hle/service/filesystem/filesystem.h" +#include "core/loader/deconstructed_rom_directory.h" #include "core/loader/nca.h" -#include "core/loader/nso.h" -#include "core/memory.h" namespace Loader { AppLoader_NCA::AppLoader_NCA(FileSys::VirtualFile file_) : AppLoader(std::move(file_)), nca(std::make_unique(file)) {} +AppLoader_NCA::~AppLoader_NCA() = default; + FileType AppLoader_NCA::IdentifyType(const FileSys::VirtualFile& file) { FileSys::NCA nca(file); @@ -83,6 +77,4 @@ ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { return ResultStatus::Success; } -AppLoader_NCA::~AppLoader_NCA() = default; - } // namespace Loader diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index 7f7d8ea0ba..326f848579 100644 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h @@ -4,20 +4,24 @@ #pragma once -#include #include "common/common_types.h" -#include "core/file_sys/content_archive.h" -#include "core/file_sys/program_metadata.h" +#include "core/file_sys/vfs.h" #include "core/hle/kernel/object.h" #include "core/loader/loader.h" -#include "deconstructed_rom_directory.h" + +namespace FileSys { +class NCA; +} namespace Loader { +class AppLoader_DeconstructedRomDirectory; + /// Loads an NCA file class AppLoader_NCA final : public AppLoader { public: explicit AppLoader_NCA(FileSys::VirtualFile file); + ~AppLoader_NCA() override; /** * Returns the type of the file @@ -35,12 +39,7 @@ public: ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override; ResultStatus ReadProgramId(u64& out_program_id) override; - ~AppLoader_NCA(); - private: - FileSys::ProgramMetadata metadata; - - FileSys::NCAHeader header; std::unique_ptr nca; std::unique_ptr directory_loader; };