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 2a7b76412..f6e7f017c 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 45a559ce8..3f81447df 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 ce26e6bee..92dad8e6f 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 ef0b27bde..ec8d770fc 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 d4a12ed10..c1e45dfeb 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 409bc670a..c69ff91c3 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 f8acec977..98823aec3 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 db17afc92..1f65297dd 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 def85d4c3..dec838cae 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 f78a6f02e..b14aefe8b 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 c1234a186..5c825f429 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 1becf6c0f..10b273bdb 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 9a9182afc..896f89529 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 3431fed88..afc689848 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 9980cced1..85151a311 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 a22d3837a..5cfcddf6c 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 d11d42bb9..c88b39bcd 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 10415798d..1850b3b17 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 7b8a68610..674f5093a 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 4e275cb13..ba272f05f 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 357b6b096..f61125953 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 af299ac21..f31135212 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