From c0c0e412e05916c3f45d122b54347bae3225ccc8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 7 Jun 2019 18:25:32 -0400 Subject: [PATCH] Core/ConfigManager: Use forward declarations where applicable Avoids dragging in IniFile, EXI device and SI device headers in this header which is quite widely used throughout the codebase. This also uncovered a few cases where indirect inclusions were being relied upon, which this also fixes. --- Source/Android/jni/MainAndroid.cpp | 1 + Source/Core/Common/IniFile.cpp | 4 ++++ Source/Core/Common/IniFile.h | 3 +++ Source/Core/Core/BootManager.cpp | 1 + Source/Core/Core/ConfigManager.cpp | 3 +++ Source/Core/Core/ConfigManager.h | 21 ++++++++++++------- Source/Core/Core/Movie.cpp | 1 + Source/Core/Core/NetPlayClient.cpp | 4 +--- Source/Core/DolphinNoGUI/PlatformX11.cpp | 1 + .../DolphinQt/Config/ControllersWindow.cpp | 2 +- Source/Core/DolphinQt/GameList/GameList.cpp | 1 + Source/Core/DolphinQt/MainWindow.cpp | 1 + Source/Core/InputCommon/GCAdapter.cpp | 1 + Source/Core/InputCommon/GCAdapter_Android.cpp | 1 + Source/Core/UICommon/UICommon.cpp | 1 + Source/Core/VideoCommon/OnScreenDisplay.cpp | 1 + 16 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index c297d5e541..763ecd182f 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -23,6 +23,7 @@ #include "Common/CommonTypes.h" #include "Common/Event.h" #include "Common/FileUtil.h" +#include "Common/IniFile.h" #include "Common/Logging/LogManager.h" #include "Common/MsgHandler.h" #include "Common/Version.h" diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index d059e3dd1b..65deaa1573 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -121,6 +121,10 @@ bool IniFile::Section::GetLines(std::vector* lines, const bool remo // IniFile +IniFile::IniFile() = default; + +IniFile::~IniFile() = default; + const IniFile::Section* IniFile::GetSection(const std::string& sectionName) const { for (const Section& sect : sections) diff --git a/Source/Core/Common/IniFile.h b/Source/Core/Common/IniFile.h index b085ad1741..f23a52fcb0 100644 --- a/Source/Core/Common/IniFile.h +++ b/Source/Core/Common/IniFile.h @@ -86,6 +86,9 @@ public: std::vector m_lines; }; + IniFile(); + ~IniFile(); + /** * Loads sections and keys. * @param filename filename of the ini file which should be loaded diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index c742f1cd08..f62882e773 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -38,6 +38,7 @@ #include "Core/Core.h" #include "Core/HW/EXI/EXI.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/Sram.h" #include "Core/HW/WiimoteReal/WiimoteReal.h" #include "Core/Movie.h" diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index fa5db12061..56ad444a19 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -19,6 +19,7 @@ #include "Common/CommonTypes.h" #include "Common/Config/Config.h" #include "Common/FileUtil.h" +#include "Common/IniFile.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/NandPaths.h" @@ -34,7 +35,9 @@ #include "Core/FifoPlayer/FifoDataFile.h" #include "Core/HLE/HLE.h" #include "Core/HW/DVD/DVDInterface.h" +#include "Core/HW/EXI/EXI_Device.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/Host.h" #include "Core/IOS/ES/ES.h" #include "Core/IOS/ES/Formats.h" diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 987be0ed1e..11c27f2f1a 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -11,9 +11,9 @@ #include #include -#include "Common/IniFile.h" -#include "Core/HW/EXI/EXI_Device.h" -#include "Core/HW/SI/SI_Device.h" +#include "Common/CommonTypes.h" + +class IniFile; namespace DiscIO { @@ -24,19 +24,26 @@ struct Partition; class Volume; } // namespace DiscIO -namespace IOS +namespace ExpansionInterface { -namespace ES +enum TEXIDevices : int; +} // namespace ExpansionInterface + +namespace IOS::ES { class TMDReader; -} -} // namespace IOS +} // namespace IOS::ES namespace PowerPC { enum class CPUCore; } // namespace PowerPC +namespace SerialInterface +{ +enum SIDevices : int; +} // namespace SerialInterface + struct BootParameters; // DSP Backend Types diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 6af7681eb7..ad2fce9cd9 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -44,6 +44,7 @@ #include "Core/HW/EXI/EXI_DeviceIPL.h" #include "Core/HW/ProcessorInterface.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/Wiimote.h" #include "Core/HW/WiimoteCommon/DataReport.h" #include "Core/HW/WiimoteCommon/WiimoteReport.h" diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 1ccac0ea95..010e1b559e 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -39,11 +39,11 @@ #include "Core/GeckoCode.h" #include "Core/HW/EXI/EXI_DeviceIPL.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/SI/SI_DeviceGCController.h" #include "Core/HW/Sram.h" #include "Core/HW/WiiSave.h" #include "Core/HW/WiiSaveStructs.h" -#include "Core/HW/WiimoteCommon/WiimoteReport.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteReal/WiimoteReal.h" #include "Core/IOS/FS/FileSystem.h" @@ -52,11 +52,9 @@ #include "Core/IOS/Uids.h" #include "Core/Movie.h" #include "Core/PowerPC/PowerPC.h" -#include "Core/WiiRoot.h" #include "InputCommon/ControllerEmu/ControlGroup/Attachments.h" #include "InputCommon/GCAdapter.h" #include "InputCommon/InputConfig.h" -#include "UICommon/GameFile.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/VideoConfig.h" diff --git a/Source/Core/DolphinNoGUI/PlatformX11.cpp b/Source/Core/DolphinNoGUI/PlatformX11.cpp index d295c91d66..af8993a4a5 100644 --- a/Source/Core/DolphinNoGUI/PlatformX11.cpp +++ b/Source/Core/DolphinNoGUI/PlatformX11.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/Source/Core/DolphinQt/Config/ControllersWindow.cpp b/Source/Core/DolphinQt/Config/ControllersWindow.cpp index 3eeec77e0f..2e4f1d573b 100644 --- a/Source/Core/DolphinQt/Config/ControllersWindow.cpp +++ b/Source/Core/DolphinQt/Config/ControllersWindow.cpp @@ -25,11 +25,11 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/Wiimote.h" #include "Core/HW/WiimoteReal/WiimoteReal.h" #include "Core/IOS/IOS.h" #include "Core/IOS/USB/Bluetooth/BTReal.h" -#include "Core/NetPlayProto.h" #include "DolphinQt/Config/Mapping/GCPadWiiUConfigDialog.h" #include "DolphinQt/Config/Mapping/MappingWindow.h" diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 629bf2cb5c..c73a23b488 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -32,6 +32,7 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/HW/DVD/DVDInterface.h" +#include "Core/HW/EXI/EXI_Device.h" #include "Core/HW/WiiSave.h" #include "Core/WiiUtils.h" diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 2aadf59844..06d5824984 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -44,6 +44,7 @@ #include "Core/HW/GCKeyboard.h" #include "Core/HW/GCPad.h" #include "Core/HW/ProcessorInterface.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/Wiimote.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HotkeyManager.h" diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 2d990a213c..493d8003f2 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -15,6 +15,7 @@ #include "Core/Core.h" #include "Core/CoreTiming.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/SystemTimers.h" #include "Core/LibusbUtils.h" #include "Core/NetPlayProto.h" diff --git a/Source/Core/InputCommon/GCAdapter_Android.cpp b/Source/Core/InputCommon/GCAdapter_Android.cpp index 84ccc25f10..176b8b3192 100644 --- a/Source/Core/InputCommon/GCAdapter_Android.cpp +++ b/Source/Core/InputCommon/GCAdapter_Android.cpp @@ -15,6 +15,7 @@ #include "Core/Core.h" #include "Core/CoreTiming.h" #include "Core/HW/SI/SI.h" +#include "Core/HW/SI/SI_Device.h" #include "Core/HW/SystemTimers.h" #include "InputCommon/GCAdapter.h" diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 117acdf254..9526f2b39f 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -17,6 +17,7 @@ #include "Common/CommonPaths.h" #include "Common/Config/Config.h" #include "Common/FileUtil.h" +#include "Common/IniFile.h" #include "Common/Logging/LogManager.h" #include "Common/MathUtil.h" #include "Common/MsgHandler.h" diff --git a/Source/Core/VideoCommon/OnScreenDisplay.cpp b/Source/Core/VideoCommon/OnScreenDisplay.cpp index 9df93cfc16..a38dc35318 100644 --- a/Source/Core/VideoCommon/OnScreenDisplay.cpp +++ b/Source/Core/VideoCommon/OnScreenDisplay.cpp @@ -11,6 +11,7 @@ #include "imgui.h" #include "Common/CommonTypes.h" +#include "Common/StringUtil.h" #include "Common/Timer.h" #include "Core/ConfigManager.h"