From d75c4894662606858e628bf5569e60756707509e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 3 Jul 2023 23:34:52 +0100 Subject: [PATCH] Add various missing includes --- src/base_station_base.h | 1 + src/command_aux.h | 1 + src/core/smallstack_type.hpp | 1 + src/departures_type.h | 1 + src/engine_base.h | 1 + src/fios.h | 1 + src/gamelog.h | 1 + src/gfx_func.h | 1 + src/landscape.h | 1 + src/language.h | 1 + src/linkgraph/demands.h | 1 + src/linkgraph/linkgraph.h | 1 + src/linkgraph/linkgraphschedule.h | 1 + src/network/core/address.h | 1 + src/network/core/packet.h | 1 + src/network/core/tcp.h | 1 + src/network/core/tcp_content_type.h | 1 + src/network/network_content.h | 1 + src/network/network_query.h | 1 + src/newgrf.h | 1 + src/newgrf_commons.h | 1 + src/newgrf_debug.h | 1 + src/newgrf_internal.h | 1 + src/newgrf_newlandscape.h | 1 + src/newgrf_object.h | 1 + src/newgrf_spritegroup.h | 1 + src/newgrf_station.h | 1 + src/object_base.h | 1 + src/order_backup.h | 1 + src/programmable_signals.h | 1 + src/rail.h | 1 + src/settings_internal.h | 1 + src/sl/saveload.h | 1 - src/smallmap_gui.h | 1 + src/sortlist_type.h | 1 + src/stringfilter_type.h | 1 + src/textfile_gui.h | 1 + src/vehicle_base.h | 1 + src/vehicle_func.h | 1 + src/vehicle_gui.h | 1 + src/vehiclelist.h | 1 + src/video/sdl2_v.h | 1 + src/video/win32_v.h | 1 + src/viewport_sprite_sorter.h | 8 ++++---- src/widgets/dropdown_type.h | 1 + src/window_gui.h | 1 + 46 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/base_station_base.h b/src/base_station_base.h index 3541589d47..6f2e73b8fb 100644 --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -17,6 +17,7 @@ #include "core/geometry_type.hpp" #include "core/tinystring_type.hpp" #include +#include typedef Pool StationPool; extern StationPool _station_pool; diff --git a/src/command_aux.h b/src/command_aux.h index f9af2884da..72ee23a1ab 100644 --- a/src/command_aux.h +++ b/src/command_aux.h @@ -15,6 +15,7 @@ #include "string_type.h" #include "core/serialisation.hpp" #include +#include struct CommandDeserialisationBuffer : public BufferDeserialisationHelper { const uint8 *buffer; diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 662ed1aa23..c5a8291d55 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -9,6 +9,7 @@ #ifndef SMALLSTACK_TYPE_HPP #define SMALLSTACK_TYPE_HPP +#include /** * A simplified pool which stores values instead of pointers and doesn't diff --git a/src/departures_type.h b/src/departures_type.h index 91ccfadb66..82e7d33941 100644 --- a/src/departures_type.h +++ b/src/departures_type.h @@ -15,6 +15,7 @@ #include "station_base.h" #include "order_base.h" #include "vehicle_base.h" +#include /** Whether or not a vehicle has arrived for a departure. */ typedef enum { diff --git a/src/engine_base.h b/src/engine_base.h index 299fd58fbf..c199aacbce 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -17,6 +17,7 @@ #include "newgrf_commons.h" #include "3rdparty/cpp-btree/btree_map.h" +#include struct WagonOverride { std::vector engines; diff --git a/src/fios.h b/src/fios.h index ca8fb0c0a6..efb61888bf 100644 --- a/src/fios.h +++ b/src/fios.h @@ -14,6 +14,7 @@ #include "company_base.h" #include "newgrf_config.h" #include "network/core/tcp_content_type.h" +#include /** Special values for save-load window for the data parameter of #InvalidateWindowData. */ diff --git a/src/gamelog.h b/src/gamelog.h index 48fdac4944..40277483f2 100644 --- a/src/gamelog.h +++ b/src/gamelog.h @@ -11,6 +11,7 @@ #define GAMELOG_H #include "newgrf_config.h" +#include struct LoggedAction; diff --git a/src/gfx_func.h b/src/gfx_func.h index 1a26712b20..7ef1acb86b 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -42,6 +42,7 @@ #include "gfx_type.h" #include "strings_type.h" #include "string_type.h" +#include void GameLoop(); diff --git a/src/landscape.h b/src/landscape.h index 5c0d8327c7..4b029e80c1 100644 --- a/src/landscape.h +++ b/src/landscape.h @@ -12,6 +12,7 @@ #include "core/geometry_type.hpp" #include "tile_cmd.h" +#include static const uint SNOW_LINE_MONTHS = 12; ///< Number of months in the snow line table. static const uint SNOW_LINE_DAYS = 32; ///< Number of days in each month in the snow line table. diff --git a/src/language.h b/src/language.h index 0966ccb197..7e1ed3bc47 100644 --- a/src/language.h +++ b/src/language.h @@ -14,6 +14,7 @@ #include #endif /* WITH_ICU_I18N */ #include "strings_type.h" +#include static const uint8 CASE_GENDER_LEN = 16; ///< The (maximum) length of a case/gender string. static const uint8 MAX_NUM_GENDERS = 8; ///< Maximum number of supported genders. diff --git a/src/linkgraph/demands.h b/src/linkgraph/demands.h index b759c64941..c21e9cdc99 100644 --- a/src/linkgraph/demands.h +++ b/src/linkgraph/demands.h @@ -4,6 +4,7 @@ #define DEMANDS_H #include "linkgraphjob_base.h" +#include /** * Calculate the demands. This class has a state, but is recreated for each diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h index a50604de75..0fc571346c 100644 --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -19,6 +19,7 @@ #include "linkgraph_type.h" #include "../3rdparty/cpp-btree/btree_map.h" #include +#include class LinkGraph; diff --git a/src/linkgraph/linkgraphschedule.h b/src/linkgraph/linkgraphschedule.h index af54751afc..ee7602a221 100644 --- a/src/linkgraph/linkgraphschedule.h +++ b/src/linkgraph/linkgraphschedule.h @@ -13,6 +13,7 @@ #include "../thread.h" #include "linkgraph.h" #include +#include class LinkGraphJob; diff --git a/src/network/core/address.h b/src/network/core/address.h index 65adb9f3fc..8bad0618ff 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -17,6 +17,7 @@ #include #include +#include class NetworkAddress; typedef std::vector NetworkAddressList; ///< Type for a list of addresses. diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 37780c92d4..52544d754e 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -20,6 +20,7 @@ #include #include #include +#include typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint8 PacketType; ///< Identifier for the packet diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index 80b73ac3f1..d5551ce89e 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #if defined(__MINGW32__) #include "3rdparty/mingw-std-threads/mingw.thread.h" diff --git a/src/network/core/tcp_content_type.h b/src/network/core/tcp_content_type.h index f63cdbd492..5049c13f3c 100644 --- a/src/network/core/tcp_content_type.h +++ b/src/network/core/tcp_content_type.h @@ -13,6 +13,7 @@ #define NETWORK_CORE_TCP_CONTENT_TYPE_H #include "../../3rdparty/md5/md5.h" +#include /** The values in the enum are important; they are used as database 'keys' */ enum ContentType { diff --git a/src/network/network_content.h b/src/network/network_content.h index 53e4e1bb66..9c5287fb4c 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -14,6 +14,7 @@ #include "core/http.h" #include "../core/container_func.hpp" #include "../3rdparty/cpp-btree/btree_map.h" +#include /** Vector with content info */ typedef std::vector ContentVector; diff --git a/src/network/network_query.h b/src/network/network_query.h index e4e09fa1bb..2ef5b3ed63 100644 --- a/src/network/network_query.h +++ b/src/network/network_query.h @@ -11,6 +11,7 @@ #define NETWORK_QUERY_H #include "network_internal.h" +#include /** Class for handling the client side of quering a game server. */ class QueryNetworkGameSocketHandler : public ZeroedMemoryAllocator, public NetworkGameSocketHandler { diff --git a/src/newgrf.h b/src/newgrf.h index 7566bb95d1..69c8185030 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -20,6 +20,7 @@ #include "core/mem_func.hpp" #include "3rdparty/cpp-btree/btree_map.h" #include +#include /** * List of different canal 'features'. diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index fd462508e4..0034212c89 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -18,6 +18,7 @@ #include "command_type.h" #include "direction_type.h" #include "company_type.h" +#include /** Context for tile accesses */ enum TileContext : uint8 { diff --git a/src/newgrf_debug.h b/src/newgrf_debug.h index 56a9c60117..2b134654cd 100644 --- a/src/newgrf_debug.h +++ b/src/newgrf_debug.h @@ -13,6 +13,7 @@ #include "newgrf.h" #include "tile_type.h" #include "vehicle_type.h" +#include /** Current state of spritepicker */ enum NewGrfDebugSpritePickerMode { diff --git a/src/newgrf_internal.h b/src/newgrf_internal.h index c04f49499c..1ff083cd2d 100644 --- a/src/newgrf_internal.h +++ b/src/newgrf_internal.h @@ -19,6 +19,7 @@ #include "3rdparty/cpp-btree/btree_map.h" #include +#include /** Base GRF ID for OpenTTD's base graphics GRFs. */ static const uint32 OPENTTD_GRAPHICS_BASE_GRF_ID = BSWAP32(0xFF4F5400); diff --git a/src/newgrf_newlandscape.h b/src/newgrf_newlandscape.h index 105e6ce1a8..504121f907 100644 --- a/src/newgrf_newlandscape.h +++ b/src/newgrf_newlandscape.h @@ -12,6 +12,7 @@ #include "newgrf_commons.h" #include "newgrf_spritegroup.h" +#include extern std::vector _new_landscape_rocks_grfs; diff --git a/src/newgrf_object.h b/src/newgrf_object.h index ef6b3763ea..30b14c4614 100644 --- a/src/newgrf_object.h +++ b/src/newgrf_object.h @@ -19,6 +19,7 @@ #include "newgrf_animation_type.h" #include "newgrf_class.h" #include "newgrf_commons.h" +#include /** Various object behaviours. */ enum ObjectFlags : uint16 { diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index e5b3b5204b..410e715f2b 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -23,6 +23,7 @@ #include "3rdparty/cpp-btree/btree_set.h" #include +#include /** * Gets the value of a so-called newgrf "register". diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 1514e4d296..9f02b486a5 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -19,6 +19,7 @@ #include "rail_type.h" #include "newgrf_spritegroup.h" #include "newgrf_town.h" +#include /** Scope resolver for stations. */ struct StationScopeResolver : public ScopeResolver { diff --git a/src/object_base.h b/src/object_base.h index b60f7cb626..a0e791e8c0 100644 --- a/src/object_base.h +++ b/src/object_base.h @@ -15,6 +15,7 @@ #include "tilearea_type.h" #include "town_type.h" #include "date_type.h" +#include typedef Pool ObjectPool; extern ObjectPool _object_pool; diff --git a/src/order_backup.h b/src/order_backup.h index 33d7f1be62..4953a5b183 100644 --- a/src/order_backup.h +++ b/src/order_backup.h @@ -17,6 +17,7 @@ #include "base_consist.h" #include "order_base.h" #include "sl/saveload_common.h" +#include /** Unique identifier for an order backup. */ typedef uint8 OrderBackupID; diff --git a/src/programmable_signals.h b/src/programmable_signals.h index 2a348bf800..1365471690 100644 --- a/src/programmable_signals.h +++ b/src/programmable_signals.h @@ -13,6 +13,7 @@ #include "tracerestrict.h" #include "core/container_func.hpp" #include +#include /** @defgroup progsigs Programmable Pre-Signals */ ///@{ diff --git a/src/rail.h b/src/rail.h index 4efd4c3489..e916e3c505 100644 --- a/src/rail.h +++ b/src/rail.h @@ -21,6 +21,7 @@ #include "signal_type.h" #include "rail_map.h" #include "settings_type.h" +#include /** Railtype flags. */ enum RailTypeFlags { diff --git a/src/settings_internal.h b/src/settings_internal.h index 90eb39ce89..465556803b 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -13,6 +13,7 @@ #include "sl/saveload_types.h" #include +#include enum SettingFlag : uint32 { SF_NONE = 0, diff --git a/src/sl/saveload.h b/src/sl/saveload.h index d849bb0e4d..dc17a68964 100644 --- a/src/sl/saveload.h +++ b/src/sl/saveload.h @@ -19,7 +19,6 @@ #include #include #include -#include /** Save or load result codes. */ enum SaveOrLoadResult { diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h index 939f8382b8..2d8f75a70a 100644 --- a/src/smallmap_gui.h +++ b/src/smallmap_gui.h @@ -18,6 +18,7 @@ #include "linkgraph/linkgraph_gui.h" #include "widgets/smallmap_widget.h" #include "guitimer_func.h" +#include static const int NUM_NO_COMPANY_ENTRIES = 4; ///< Number of entries in the owner legend that are not companies. diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 3d4a2c3ea9..554478fd89 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -14,6 +14,7 @@ #include "core/bitmath_func.hpp" #include "core/mem_func.hpp" #include "date_type.h" +#include /** Flags of the sort list. */ enum SortListFlags { diff --git a/src/stringfilter_type.h b/src/stringfilter_type.h index 5b24587cb5..ef2b4d7efc 100644 --- a/src/stringfilter_type.h +++ b/src/stringfilter_type.h @@ -11,6 +11,7 @@ #define STRINGFILTER_TYPE_H #include "strings_type.h" +#include /** * String filter and state. diff --git a/src/textfile_gui.h b/src/textfile_gui.h index f71f8e5686..b2e71084cd 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -15,6 +15,7 @@ #include "textfile_type.h" #include "window_gui.h" #include +#include const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filename); diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 27028ca221..c192abeb0d 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -28,6 +28,7 @@ #include "sl/saveload_common.h" #include #include +#include CommandCost CmdRefitVehicle(TileIndex, DoCommandFlag, uint32, uint32, const char*); diff --git a/src/vehicle_func.h b/src/vehicle_func.h index 87e67433c5..3815de6b88 100644 --- a/src/vehicle_func.h +++ b/src/vehicle_func.h @@ -20,6 +20,7 @@ #include "track_type.h" #include "livery.h" #include "cargo_type.h" +#include #define is_custom_sprite(x) (x >= 0xFD) #define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD) diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index 1099fe0d0e..256b9a4dce 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -17,6 +17,7 @@ #include "engine_type.h" #include "company_type.h" #include "widgets/dropdown_func.h" +#include void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent, bool auto_refit = false, bool is_virtual_train = false); diff --git a/src/vehiclelist.h b/src/vehiclelist.h index 4aadc7b786..866f4eb632 100644 --- a/src/vehiclelist.h +++ b/src/vehiclelist.h @@ -14,6 +14,7 @@ #include "company_type.h" #include "tile_type.h" #include "cargo_type.h" +#include /** Vehicle List type flags */ enum VehicleListType { diff --git a/src/video/sdl2_v.h b/src/video/sdl2_v.h index ce7d79f249..3def038f44 100644 --- a/src/video/sdl2_v.h +++ b/src/video/sdl2_v.h @@ -16,6 +16,7 @@ #endif #include "video_driver.hpp" +#include /** The SDL video driver. */ class VideoDriver_SDL_Base : public VideoDriver { diff --git a/src/video/win32_v.h b/src/video/win32_v.h index 31f83c827b..968eb6b195 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -17,6 +17,7 @@ #include "../3rdparty/mingw-std-threads/mingw.mutex.h" #include "../3rdparty/mingw-std-threads/mingw.condition_variable.h" #endif +#include /** Base class for Windows video drivers. */ class VideoDriver_Win32Base : public VideoDriver { diff --git a/src/viewport_sprite_sorter.h b/src/viewport_sprite_sorter.h index b3e7ea5945..a631543d07 100644 --- a/src/viewport_sprite_sorter.h +++ b/src/viewport_sprite_sorter.h @@ -7,13 +7,13 @@ /** @file viewport_sprite_sorter.h Types related to sprite sorting. */ -#include "stdafx.h" -#include "core/bitmath_func.hpp" -#include "gfx_type.h" - #ifndef VIEWPORT_SPRITE_SORTER_H #define VIEWPORT_SPRITE_SORTER_H +#include "core/bitmath_func.hpp" +#include "gfx_type.h" +#include + /** Parent sprite that should be drawn */ #ifdef _MSC_VER struct __declspec(align(16)) ParentSpriteToDraw { diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 6b668efc27..87f3517048 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -13,6 +13,7 @@ #include "../window_type.h" #include "../gfx_func.h" #include "table/strings.h" +#include enum DropDownSyncFocus { DDSF_NONE = 0, diff --git a/src/window_gui.h b/src/window_gui.h index bb4eb11856..eadd59e17f 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -20,6 +20,7 @@ #include #include +#include /** * Flags to describe the look of the frame