From e5fcabdd698b7c5e8fe8c0903ed2b3babcb75a17 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 21 Jun 2015 15:44:11 +0100 Subject: [PATCH] Core: Cleanup file_sys includes. --- src/common/make_unique.h | 1 + src/core/file_sys/archive_backend.cpp | 2 ++ src/core/file_sys/archive_extsavedata.cpp | 4 ++-- src/core/file_sys/archive_extsavedata.h | 7 +++++-- src/core/file_sys/archive_romfs.cpp | 3 ++- src/core/file_sys/archive_romfs.h | 4 +++- src/core/file_sys/archive_savedata.cpp | 3 +-- src/core/file_sys/archive_savedata.h | 7 ++++--- src/core/file_sys/archive_savedatacheck.cpp | 5 +++++ src/core/file_sys/archive_savedatacheck.h | 9 ++++----- src/core/file_sys/archive_sdmc.cpp | 3 +-- src/core/file_sys/archive_sdmc.h | 7 ++++--- src/core/file_sys/archive_systemsavedata.cpp | 5 +++-- src/core/file_sys/archive_systemsavedata.h | 7 +++++-- src/core/file_sys/disk_archive.cpp | 4 ++-- src/core/file_sys/disk_archive.h | 7 ++++++- src/core/file_sys/ivfc_archive.cpp | 1 - src/core/file_sys/ivfc_archive.h | 4 +++- src/core/hle/kernel/process.h | 3 ++- src/core/hle/service/fs/archive.cpp | 10 ++++++++-- src/core/hle/service/fs/archive.h | 13 ++++++++----- src/core/hle/service/service.h | 2 ++ 22 files changed, 73 insertions(+), 38 deletions(-) diff --git a/src/common/make_unique.h b/src/common/make_unique.h index 2a7b764124..f6e7f017cd 100644 --- a/src/common/make_unique.h +++ b/src/common/make_unique.h @@ -4,6 +4,7 @@ #pragma once +#include #include namespace Common { diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index 45a559ce87..3f81447dfd 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include #include #include "common/logging/log.h" diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index ce26e6bee5..92dad8e6f1 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -2,7 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include +#include #include "common/common_types.h" #include "common/file_util.h" @@ -13,7 +14,6 @@ #include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" -#include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_extsavedata.h b/src/core/file_sys/archive_extsavedata.h index ef0b27bdee..ec8d770fc0 100644 --- a/src/core/file_sys/archive_extsavedata.h +++ b/src/core/file_sys/archive_extsavedata.h @@ -4,10 +4,13 @@ #pragma once +#include +#include + #include "common/common_types.h" -#include "core/file_sys/disk_archive.h" -#include "core/loader/loader.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp index d4a12ed103..c1e45dfeb2 100644 --- a/src/core/file_sys/archive_romfs.cpp +++ b/src/core/file_sys/archive_romfs.cpp @@ -2,14 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include "common/common_types.h" -#include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_romfs.h" +#include "core/file_sys/ivfc_archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h index 409bc670aa..c69ff91c31 100644 --- a/src/core/file_sys/archive_romfs.h +++ b/src/core/file_sys/archive_romfs.h @@ -5,11 +5,13 @@ #pragma once #include +#include #include #include "common/common_types.h" -#include "core/file_sys/ivfc_archive.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index f8acec9771..98823aec33 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include #include "common/common_types.h" #include "common/file_util.h" @@ -14,7 +14,6 @@ #include "core/file_sys/disk_archive.h" #include "core/hle/kernel/process.h" #include "core/hle/service/fs/archive.h" -#include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_savedata.h b/src/core/file_sys/archive_savedata.h index db17afc92a..1f65297ddc 100644 --- a/src/core/file_sys/archive_savedata.h +++ b/src/core/file_sys/archive_savedata.h @@ -4,10 +4,11 @@ #pragma once -#include "common/common_types.h" +#include +#include -#include "core/file_sys/disk_archive.h" -#include "core/loader/loader.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index def85d4c38..dec838caee 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -2,12 +2,17 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include + +#include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" #include "common/string_util.h" #include "core/file_sys/archive_savedatacheck.h" +#include "core/file_sys/ivfc_archive.h" #include "core/hle/service/fs/archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/archive_savedatacheck.h b/src/core/file_sys/archive_savedatacheck.h index f78a6f02ee..b14aefe8bc 100644 --- a/src/core/file_sys/archive_savedatacheck.h +++ b/src/core/file_sys/archive_savedatacheck.h @@ -4,12 +4,11 @@ #pragma once -#include +#include +#include -#include "common/common_types.h" - -#include "core/file_sys/ivfc_archive.h" -#include "core/loader/loader.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index c1234a1862..5c825f4296 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include -#include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" diff --git a/src/core/file_sys/archive_sdmc.h b/src/core/file_sys/archive_sdmc.h index 1becf6c0f2..10b273bdba 100644 --- a/src/core/file_sys/archive_sdmc.h +++ b/src/core/file_sys/archive_sdmc.h @@ -4,10 +4,11 @@ #pragma once -#include "common/common_types.h" +#include +#include -#include "core/file_sys/disk_archive.h" -#include "core/loader/loader.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 9a9182afc9..896f895295 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -2,7 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include +#include #include "common/common_types.h" #include "common/file_util.h" @@ -10,8 +11,8 @@ #include "common/string_util.h" #include "core/file_sys/archive_systemsavedata.h" +#include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" -#include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/archive_systemsavedata.h b/src/core/file_sys/archive_systemsavedata.h index 3431fed880..afc689848a 100644 --- a/src/core/file_sys/archive_systemsavedata.h +++ b/src/core/file_sys/archive_systemsavedata.h @@ -4,10 +4,13 @@ #pragma once +#include +#include + #include "common/common_types.h" -#include "core/file_sys/disk_archive.h" -#include "core/loader/loader.h" +#include "core/file_sys/archive_backend.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 9980cced10..85151a311b 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -2,7 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include +#include #include "common/common_types.h" #include "common/file_util.h" @@ -10,7 +11,6 @@ #include "common/make_unique.h" #include "core/file_sys/disk_archive.h" -#include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index a22d3837a4..5cfcddf6ca 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -4,13 +4,18 @@ #pragma once +#include +#include +#include +#include + #include "common/common_types.h" #include "common/file_util.h" #include "core/file_sys/archive_backend.h" #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" -#include "core/loader/loader.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index d11d42bb97..c88b39bcd6 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -6,7 +6,6 @@ #include #include "common/common_types.h" -#include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 10415798d5..1850b3b173 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -4,7 +4,9 @@ #pragma once +#include #include +#include #include #include "common/common_types.h" @@ -12,7 +14,7 @@ #include "core/file_sys/archive_backend.h" #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" -#include "core/loader/loader.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 7b8a686106..674f5093ad 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -5,6 +5,8 @@ #pragma once #include +#include +#include #include @@ -12,7 +14,6 @@ #include "common/common_types.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/result.h" namespace Kernel { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 4e275cb13a..ba272f05f3 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -2,29 +2,35 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include +#include #include #include +#include #include +#include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" -#include "common/math_util.h" #include "core/file_sys/archive_backend.h" #include "core/file_sys/archive_extsavedata.h" -#include "core/file_sys/archive_romfs.h" #include "core/file_sys/archive_savedata.h" #include "core/file_sys/archive_savedatacheck.h" #include "core/file_sys/archive_sdmc.h" #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/directory_backend.h" +#include "core/file_sys/file_backend.h" +#include "core/hle/hle.h" #include "core/hle/service/service.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" #include "core/hle/result.h" +#include "core/memory.h" // Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map. // Workaroung for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970 diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 357b6b0969..f611259537 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -4,22 +4,25 @@ #pragma once +#include +#include + #include "common/common_types.h" #include "core/file_sys/archive_backend.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/session.h" #include "core/hle/result.h" +namespace FileSys { +class DirectoryBackend; +class FileBackend; +} + /// The unique system identifier hash, also known as ID0 extern const std::string SYSTEM_ID; /// The scrambled SD card CID, also known as ID1 extern const std::string SDCARD_ID; -namespace Kernel { - class Session; -} - namespace Service { namespace FS { diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index af299ac219..f311352120 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include @@ -12,6 +13,7 @@ #include "common/common_types.h" #include "core/hle/kernel/session.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace Service