From a7f6862210c158a18917d9283a4bf59210e636ab Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sun, 11 Mar 2018 23:22:02 +1100 Subject: [PATCH] More include cleanups Cleaned up unnecessary inclusions of: * event.hpp * exceptions.hpp * formatter.hpp * hash.hpp * image.hpp * sound.hpp * team.hpp * tstring.hpp * wml_exception.hpp --- src/addon/manager.cpp | 1 - src/ai/composite/goal.cpp | 1 - src/ai/configuration.cpp | 1 - src/ai/default/recruitment.cpp | 1 - src/chat_events.cpp | 1 - src/config.hpp | 1 - src/config_attribute_value.hpp | 1 - src/deprecation.cpp | 1 - src/editor/map/map_context.cpp | 1 - src/game_display.cpp | 1 - src/game_events/action_wml.cpp | 1 - src/game_initialization/create_engine.cpp | 2 -- src/game_initialization/lobby_info.cpp | 1 - src/gui/auxiliary/field.hpp | 1 - src/gui/dialogs/editor/custom_tod.cpp | 1 - src/gui/dialogs/game_load.hpp | 1 - src/gui/dialogs/unit_attack.cpp | 1 - src/gui/dialogs/unit_create.cpp | 1 - src/gui/widgets/generator.hpp | 1 - src/gui/widgets/toggle_button.cpp | 1 - src/gui/widgets/window.cpp | 1 - src/hotkey/command_executor.hpp | 1 - src/hotkey/hotkey_handler.cpp | 1 - src/map/map.cpp | 1 - src/menu_events.cpp | 2 -- src/minimap.cpp | 1 - src/mouse_events.cpp | 1 - src/mt_rng.cpp | 1 - src/play_controller.cpp | 1 - src/playmp_controller.cpp | 1 - src/playturn.cpp | 1 - src/preferences/display.cpp | 1 - src/scripting/game_lua_kernel.cpp | 1 - src/scripting/lua_fileops.cpp | 1 - src/scripting/lua_kernel_base.cpp | 1 - src/server/server.cpp | 1 - src/storyscreen/controller.hpp | 2 +- src/tod_manager.cpp | 1 - src/units/filter.cpp | 1 - src/wesnoth.cpp | 1 - src/wesnothd_connection.hpp | 1 - 41 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/addon/manager.cpp b/src/addon/manager.cpp index 6d6d39d83c54..d7ca7689f050 100644 --- a/src/addon/manager.cpp +++ b/src/addon/manager.cpp @@ -16,7 +16,6 @@ #include "addon/manager.hpp" #include "addon/manager_ui.hpp" #include "filesystem.hpp" -#include "formatter.hpp" #include "preferences/game.hpp" #include "gettext.hpp" #include "gui/dialogs/addon/connect.hpp" diff --git a/src/ai/composite/goal.cpp b/src/ai/composite/goal.cpp index fc8481ba0fca..156ee22478f8 100644 --- a/src/ai/composite/goal.cpp +++ b/src/ai/composite/goal.cpp @@ -33,7 +33,6 @@ #include "units/unit.hpp" #include "units/map.hpp" #include "units/filter.hpp" -#include "wml_exception.hpp" #include #include diff --git a/src/ai/configuration.cpp b/src/ai/configuration.cpp index 3be0bcfa8bd3..c3794da770ff 100644 --- a/src/ai/configuration.cpp +++ b/src/ai/configuration.cpp @@ -24,7 +24,6 @@ #include "log.hpp" #include "serialization/parser.hpp" #include "serialization/preprocessor.hpp" -#include "wml_exception.hpp" #include #include diff --git a/src/ai/default/recruitment.cpp b/src/ai/default/recruitment.cpp index c9cfa520bdce..d9686b676b2e 100644 --- a/src/ai/default/recruitment.cpp +++ b/src/ai/default/recruitment.cpp @@ -42,7 +42,6 @@ #include "units/types.hpp" #include "units/unit.hpp" #include "variable.hpp" -#include "wml_exception.hpp" #include diff --git a/src/chat_events.cpp b/src/chat_events.cpp index 34f67e00e7a1..49ebf2d88394 100644 --- a/src/chat_events.cpp +++ b/src/chat_events.cpp @@ -13,7 +13,6 @@ #include "chat_events.hpp" -#include "formatter.hpp" #include "formula/string_utils.hpp" #include "gettext.hpp" #include "log.hpp" diff --git a/src/config.hpp b/src/config.hpp index fe96a66b5c9f..54defb13e752 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -48,7 +48,6 @@ #include "config_attribute_value.hpp" #include "exceptions.hpp" -#include "tstring.hpp" #ifdef HAVE_CXX14 # ifdef __clang__ // Check this first, because clang also defines __GNUC__ diff --git a/src/config_attribute_value.hpp b/src/config_attribute_value.hpp index 901fa483b155..a63d59dc1d3d 100644 --- a/src/config_attribute_value.hpp +++ b/src/config_attribute_value.hpp @@ -46,7 +46,6 @@ #include #include -#include "exceptions.hpp" #include "tstring.hpp" #ifdef HAVE_CXX14 diff --git a/src/deprecation.cpp b/src/deprecation.cpp index 1ae70f53a3b8..210cf0de5d2a 100644 --- a/src/deprecation.cpp +++ b/src/deprecation.cpp @@ -16,7 +16,6 @@ #include "log.hpp" #include "gettext.hpp" #include "formula/string_utils.hpp" -#include "tstring.hpp" #include "game_config.hpp" #include "version.hpp" #include "preferences/general.hpp" diff --git a/src/editor/map/map_context.cpp b/src/editor/map/map_context.cpp index 02c1a363c400..1db8674395b1 100644 --- a/src/editor/map/map_context.cpp +++ b/src/editor/map/map_context.cpp @@ -29,7 +29,6 @@ #include "team.hpp" #include "terrain/type_data.hpp" #include "units/unit.hpp" -#include "wml_exception.hpp" #include diff --git a/src/game_display.cpp b/src/game_display.cpp index d15ddc08e8fb..079f607166c8 100644 --- a/src/game_display.cpp +++ b/src/game_display.cpp @@ -38,7 +38,6 @@ #include "resources.hpp" #include "tod_manager.hpp" #include "color.hpp" -#include "sound.hpp" #include "synced_context.hpp" #include "terrain/type_data.hpp" #include "units/unit.hpp" diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index 91987e0a4db1..88b2f8c6a656 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -50,7 +50,6 @@ #include "resources.hpp" #include "scripting/game_lua_kernel.hpp" #include "side_filter.hpp" -#include "sound.hpp" #include "soundsource.hpp" #include "synced_context.hpp" #include "synced_user_choice.hpp" diff --git a/src/game_initialization/create_engine.cpp b/src/game_initialization/create_engine.cpp index bebd59946dc2..73560eca715f 100644 --- a/src/game_initialization/create_engine.cpp +++ b/src/game_initialization/create_engine.cpp @@ -20,8 +20,6 @@ #include "preferences/game.hpp" #include "generators/map_create.hpp" #include "gui/dialogs/campaign_difficulty.hpp" -#include "hash.hpp" -#include "image.hpp" #include "log.hpp" #include "map/exception.hpp" #include "map/map.hpp" diff --git a/src/game_initialization/lobby_info.cpp b/src/game_initialization/lobby_info.cpp index a016d1708c9b..744bd18ab1ec 100644 --- a/src/game_initialization/lobby_info.cpp +++ b/src/game_initialization/lobby_info.cpp @@ -21,7 +21,6 @@ #include "mp_ui_alerts.hpp" #include "preferences/game.hpp" #include "wesnothd_connection.hpp" -#include "wml_exception.hpp" #include diff --git a/src/gui/auxiliary/field.hpp b/src/gui/auxiliary/field.hpp index d5a7697cdf4d..a8f6e9184c29 100644 --- a/src/gui/auxiliary/field.hpp +++ b/src/gui/auxiliary/field.hpp @@ -28,7 +28,6 @@ #include "gui/widgets/selectable_item.hpp" #include "gui/widgets/text_box.hpp" #include "gui/widgets/window.hpp" -#include "wml_exception.hpp" namespace gui2 { diff --git a/src/gui/dialogs/editor/custom_tod.cpp b/src/gui/dialogs/editor/custom_tod.cpp index 6ed95255591b..a98c236f6010 100644 --- a/src/gui/dialogs/editor/custom_tod.cpp +++ b/src/gui/dialogs/editor/custom_tod.cpp @@ -30,7 +30,6 @@ #include "gui/widgets/settings.hpp" #include "gui/widgets/slider.hpp" #include "gui/widgets/text_box.hpp" -#include "image.hpp" #include "utils/functional.hpp" diff --git a/src/gui/dialogs/game_load.hpp b/src/gui/dialogs/game_load.hpp index a0921c1111aa..a6e27c8a9da6 100644 --- a/src/gui/dialogs/game_load.hpp +++ b/src/gui/dialogs/game_load.hpp @@ -18,7 +18,6 @@ #include "gui/dialogs/transient_message.hpp" #include "savegame.hpp" #include "save_index.hpp" -#include "tstring.hpp" #include "gettext.hpp" #include diff --git a/src/gui/dialogs/unit_attack.cpp b/src/gui/dialogs/unit_attack.cpp index 54cf04799dff..733266b2068f 100644 --- a/src/gui/dialogs/unit_attack.cpp +++ b/src/gui/dialogs/unit_attack.cpp @@ -36,7 +36,6 @@ #include "help/help.hpp" #include "language.hpp" #include "color.hpp" -#include "team.hpp" #include "units/unit.hpp" #include "utils/functional.hpp" diff --git a/src/gui/dialogs/unit_create.cpp b/src/gui/dialogs/unit_create.cpp index f4cf48910989..c04fc8f52d7f 100644 --- a/src/gui/dialogs/unit_create.cpp +++ b/src/gui/dialogs/unit_create.cpp @@ -37,7 +37,6 @@ #include "game_config.hpp" #include "gettext.hpp" #include "play_controller.hpp" -#include "team.hpp" #include "units/types.hpp" #include "utils/functional.hpp" diff --git a/src/gui/widgets/generator.hpp b/src/gui/widgets/generator.hpp index aec1d8349a7c..afb703aa4a5e 100644 --- a/src/gui/widgets/generator.hpp +++ b/src/gui/widgets/generator.hpp @@ -15,7 +15,6 @@ #pragma once #include "widget.hpp" -#include "tstring.hpp" #include diff --git a/src/gui/widgets/toggle_button.cpp b/src/gui/widgets/toggle_button.cpp index a07422ba8ca2..0d3fa2ccdb0d 100644 --- a/src/gui/widgets/toggle_button.cpp +++ b/src/gui/widgets/toggle_button.cpp @@ -22,7 +22,6 @@ #include "gui/core/log.hpp" #include "gui/core/window_builder/helper.hpp" #include "sound.hpp" -#include "wml_exception.hpp" #include "utils/functional.hpp" diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 5dd5b136c1c2..9185c7589cbf 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -56,7 +56,6 @@ #include "preferences/display.hpp" #include "sdl/rect.hpp" #include "sdl/surface.hpp" -#include "tstring.hpp" #include "formula/variant.hpp" #include "video.hpp" #include "wml_exception.hpp" diff --git a/src/hotkey/command_executor.hpp b/src/hotkey/command_executor.hpp index 4e350b22e994..82094c8b294d 100644 --- a/src/hotkey/command_executor.hpp +++ b/src/hotkey/command_executor.hpp @@ -16,7 +16,6 @@ #include "hotkey_command.hpp" #include "game_end_exceptions.hpp" -#include "events.hpp" class display; class CVideo; diff --git a/src/hotkey/hotkey_handler.cpp b/src/hotkey/hotkey_handler.cpp index d5374b014498..d9cc0e6245f6 100644 --- a/src/hotkey/hotkey_handler.cpp +++ b/src/hotkey/hotkey_handler.cpp @@ -16,7 +16,6 @@ #include "actions/create.hpp" #include "font/standard_colors.hpp" -#include "formatter.hpp" #include "formula/string_utils.hpp" #include "game_display.hpp" #include "game_errors.hpp" diff --git a/src/map/map.cpp b/src/map/map.cpp index 9cea1229b31b..f0f7d2d12975 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -27,7 +27,6 @@ #include "serialization/string_utils.hpp" #include "terrain/terrain.hpp" #include "terrain/type_data.hpp" -#include "wml_exception.hpp" #include #include diff --git a/src/menu_events.cpp b/src/menu_events.cpp index 14944bc20162..287b1f0fb8cd 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -31,7 +31,6 @@ #include "color.hpp" #include "display_chat_manager.hpp" #include "font/standard_colors.hpp" -#include "formatter.hpp" #include "formula/string_utils.hpp" #include "game_board.hpp" #include "game_config_manager.hpp" @@ -77,7 +76,6 @@ #include "savegame.hpp" #include "scripting/game_lua_kernel.hpp" #include "scripting/plugins/manager.hpp" -#include "sound.hpp" #include "synced_context.hpp" #include "terrain/builder.hpp" #include "units/udisplay.hpp" diff --git a/src/minimap.cpp b/src/minimap.cpp index 022c402fe979..0c9ad50732ea 100644 --- a/src/minimap.cpp +++ b/src/minimap.cpp @@ -28,7 +28,6 @@ #include "sdl/surface.hpp" #include "team.hpp" #include "terrain/type_data.hpp" -#include "wml_exception.hpp" static lg::log_domain log_display("display"); #define DBG_DP LOG_STREAM(debug, log_display) diff --git a/src/mouse_events.cpp b/src/mouse_events.cpp index 5959e9f45507..af4ac555d852 100644 --- a/src/mouse_events.cpp +++ b/src/mouse_events.cpp @@ -39,7 +39,6 @@ #include "synced_context.hpp" #include "team.hpp" // for team #include "tod_manager.hpp" -#include "tstring.hpp" // for t_string #include "units/animation_component.hpp" #include "units/ptr.hpp" // for unit_const_ptr #include "units/unit.hpp" // for unit diff --git a/src/mt_rng.cpp b/src/mt_rng.cpp index cc59ef960a33..69c414695c1b 100644 --- a/src/mt_rng.cpp +++ b/src/mt_rng.cpp @@ -15,7 +15,6 @@ #include "mt_rng.hpp" #include "seed_rng.hpp" #include "config.hpp" -#include "formatter.hpp" #include "log.hpp" #include #include diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 5a86bbd0d54b..31feaf144e97 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -61,7 +61,6 @@ #include "units/unit.hpp" #include "units/id.hpp" #include "whiteboard/manager.hpp" -#include "wml_exception.hpp" #include "utils/functional.hpp" diff --git a/src/playmp_controller.cpp b/src/playmp_controller.cpp index 6200477c118e..b7ee9b616bc1 100644 --- a/src/playmp_controller.cpp +++ b/src/playmp_controller.cpp @@ -28,7 +28,6 @@ #include "game_initialization/playcampaign.hpp" #include "resources.hpp" #include "savegame.hpp" -#include "sound.hpp" #include "serialization/string_utils.hpp" #include "whiteboard/manager.hpp" #include "countdown_clock.hpp" diff --git a/src/playturn.cpp b/src/playturn.cpp index cfa48cd978f0..0f81f59d0cec 100644 --- a/src/playturn.cpp +++ b/src/playturn.cpp @@ -34,7 +34,6 @@ #include "resources.hpp" // for gameboard, screen, etc #include "serialization/string_utils.hpp" // for string_map #include "team.hpp" // for team, team::CONTROLLER::AI, etc -#include "tstring.hpp" // for operator== #include "wesnothd_connection_error.hpp" #include "whiteboard/manager.hpp" // for manager #include "widgets/button.hpp" // for button diff --git a/src/preferences/display.cpp b/src/preferences/display.cpp index 373ca22e8ad9..bcb7932d2ecb 100644 --- a/src/preferences/display.cpp +++ b/src/preferences/display.cpp @@ -23,7 +23,6 @@ #include "display.hpp" #include "filesystem.hpp" -#include "formatter.hpp" #include "formula/string_utils.hpp" #include "preferences/game.hpp" #include "gettext.hpp" diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 68849b0b7fcd..cab6ff9e3450 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -55,7 +55,6 @@ #include "game_events/pump.hpp" // for queued_event #include "preferences/game.hpp" // for encountered_units #include "help/help.hpp" -#include "image.hpp" // for get_image, locator #include "log.hpp" // for LOG_STREAM, logger, etc #include "utils/make_enum.hpp" // for operator<< #include "map/map.hpp" // for gamemap diff --git a/src/scripting/lua_fileops.cpp b/src/scripting/lua_fileops.cpp index 078168962b7b..641e2ce85582 100644 --- a/src/scripting/lua_fileops.cpp +++ b/src/scripting/lua_fileops.cpp @@ -14,7 +14,6 @@ #include "scripting/lua_fileops.hpp" -#include "exceptions.hpp" #include "filesystem.hpp" #include "game_config.hpp" //for game_config::debug_lua #include "game_errors.hpp" diff --git a/src/scripting/lua_kernel_base.cpp b/src/scripting/lua_kernel_base.cpp index 7898f81a88d9..a3058b9decb4 100644 --- a/src/scripting/lua_kernel_base.cpp +++ b/src/scripting/lua_kernel_base.cpp @@ -14,7 +14,6 @@ #include "scripting/lua_kernel_base.hpp" -#include "exceptions.hpp" #include "game_config.hpp" #include "game_errors.hpp" #include "gui/core/gui_definition.hpp" diff --git a/src/server/server.cpp b/src/server/server.cpp index 94ff35095262..0d470416e122 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -36,7 +36,6 @@ #include "server/player.hpp" #include "server/simple_wml.hpp" #include "server/ban.hpp" -#include "exceptions.hpp" #include "server/user_handler.hpp" #include "server/sample_user_handler.hpp" diff --git a/src/storyscreen/controller.hpp b/src/storyscreen/controller.hpp index c71139d4d3bf..355e5f9a7a3c 100644 --- a/src/storyscreen/controller.hpp +++ b/src/storyscreen/controller.hpp @@ -19,11 +19,11 @@ #pragma once -#include "events.hpp" #include "storyscreen/parser.hpp" #include #include +#include namespace storyscreen { diff --git a/src/tod_manager.cpp b/src/tod_manager.cpp index 24cc3586e954..742004d9c8dd 100644 --- a/src/tod_manager.cpp +++ b/src/tod_manager.cpp @@ -24,7 +24,6 @@ #include "random.hpp" #include "units/unit.hpp" #include "units/abilities.hpp" -#include "wml_exception.hpp" #include "resources.hpp" #include diff --git a/src/units/filter.cpp b/src/units/filter.cpp index cec522428a49..9290a3c45d70 100644 --- a/src/units/filter.cpp +++ b/src/units/filter.cpp @@ -29,7 +29,6 @@ #include "units/formula_manager.hpp" #include "units/types.hpp" #include "variable.hpp" // needed for vconfig, scoped unit -#include "wml_exception.hpp" // needed for FAIL #include "formula/callable_objects.hpp" #include "formula/formula.hpp" #include "formula/function_gamestate.hpp" diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index 8db5c6336f77..2167a373cbb3 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -49,7 +49,6 @@ #include "serialization/validator.hpp" // for strict_validation_enabled #include "sound.hpp" // for commit_music_changes, etc #include "statistics.hpp" // for fresh_stats -#include "tstring.hpp" // for operator==, t_string #include "utils/functional.hpp" #include "version.hpp" // for version_info #include "video.hpp" // for CVideo diff --git a/src/wesnothd_connection.hpp b/src/wesnothd_connection.hpp index 6050b99d2a89..40f584000331 100644 --- a/src/wesnothd_connection.hpp +++ b/src/wesnothd_connection.hpp @@ -35,7 +35,6 @@ #endif // endif _WIN32 #include "configr_assign.hpp" -#include "exceptions.hpp" #include "wesnothd_connection_error.hpp" #include