1
0
Fork 0

Codefix: Add missing header includes.

pull/14052/head
frosch 2025-04-19 22:35:05 +02:00 committed by frosch
parent 461b73e21b
commit cb113cfed0
40 changed files with 70 additions and 7 deletions

View File

@ -158,7 +158,7 @@ def scan_source_files(path, strings_found):
# Most files we can just open, but some use magic, that requires the
# G++ preprocessor before we can make sense out of it.
if new_path == "src/table/cargo_const.h":
p = subprocess.run(["g++", "-E", new_path], stdout=subprocess.PIPE)
p = subprocess.run(["g++", "-E", "-DCHECK_UNUSED_STRINGS", new_path], stdout=subprocess.PIPE)
output = p.stdout.decode()
else:
with open(new_path) as fp:

View File

@ -10,7 +10,7 @@
#ifndef DATE_GUI_H
#define DATE_GUI_H
#include "timer/timer_game_calendar.h"
#include "timer/timer_game_economy.h"
#include "window_type.h"
/**

View File

@ -12,6 +12,7 @@
#include "command_type.h"
#include "depot_type.h"
#include "vehicle_type.h"
CommandCost CmdRenameDepot(DoCommandFlags flags, DepotID depot_id, const std::string &text);

View File

@ -10,6 +10,7 @@
#ifndef DROPDOWN_COMMON_TYPE_H
#define DROPDOWN_COMMON_TYPE_H
#include "dropdown_type.h"
#include "gfx_func.h"
#include "gfx_type.h"
#include "palette_func.h"
@ -17,6 +18,8 @@
#include "strings_func.h"
#include "window_gui.h"
#include "table/strings.h"
/**
* Drop down divider component.
* @tparam TBase Base component.

View File

@ -10,6 +10,7 @@
#ifndef DROPDOWN_FUNC_H
#define DROPDOWN_FUNC_H
#include "dropdown_type.h"
#include "window_gui.h"
/* Show drop down menu containing a fixed list of strings */

View File

@ -10,6 +10,7 @@
#ifndef ENGINE_TYPE_H
#define ENGINE_TYPE_H
#include "core/pool_type.hpp"
#include "economy_type.h"
#include "landscape_type.h"
#include "newgrf_callbacks.h"

View File

@ -10,6 +10,7 @@
#ifndef GAME_TEXT_HPP
#define GAME_TEXT_HPP
#include "../string_type.h"
#include "../strings_type.h"
struct StringParam {

View File

@ -11,6 +11,8 @@
#define GROUP_GUI_H
#include "company_type.h"
#include "group_type.h"
#include "sortlist_type.h"
#include "vehicle_type.h"
void ShowCompanyGroup(CompanyID company, VehicleType veh, GroupID group = GroupID::Invalid());

View File

@ -10,6 +10,8 @@
#ifndef INDUSTRY_TYPE_H
#define INDUSTRY_TYPE_H
#include "core/pool_type.hpp"
using IndustryID = PoolID<uint16_t, struct IndustryIDTag, 64000, 0xFFFF>;
typedef uint16_t IndustryGfx;

View File

@ -14,6 +14,9 @@
#include "../../3rdparty/md5/md5.h"
#include "../../string_type.h"
#include "../../textfile_type.h"
/** The values in the enum are important; they are used as database 'keys' */
enum ContentType : uint8_t {
CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types

View File

@ -14,6 +14,8 @@
#include "tcp.h"
#include "../network.h"
#include "../network_func.h"
#include "../network_internal.h"
#include "../../core/pool_type.hpp"
#include "../../debug.h"

View File

@ -19,7 +19,7 @@
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "../table/strings.h"
#include "table/strings.h"
#include "../safeguards.h"

View File

@ -18,7 +18,7 @@
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "../table/strings.h"
#include "table/strings.h"
#include "../safeguards.h"

View File

@ -13,7 +13,7 @@
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "../table/strings.h"
#include "table/strings.h"
#include "../safeguards.h"

View File

@ -16,9 +16,9 @@
#include "newgrf_internal.h"
#include "newgrf_stringmapping.h"
#include "../safeguards.h"
#include "table/strings.h"
#include "../table/strings.h"
#include "../safeguards.h"
/**
* Information for mapping static StringIDs.

View File

@ -10,6 +10,8 @@
#ifndef NEWGRF_ACT5_H
#define NEWGRF_ACT5_H
#include "gfx_type.h"
/** The type of action 5 type. */
enum Action5BlockType : uint8_t {
A5BLOCK_FIXED, ///< Only allow replacing a whole block of sprites. (TTDP compatible)

View File

@ -9,6 +9,8 @@
#include "newgrf_class.h"
#include "table/strings.h"
/** Reset the classes, i.e. clear everything. */
template <typename Tspec, typename Tindex, Tindex Tmax>
void NewGRFClass<Tspec, Tindex, Tmax>::Reset()

View File

@ -10,6 +10,7 @@
#ifndef NEWGRF_SPRITEGROUP_H
#define NEWGRF_SPRITEGROUP_H
#include "core/pool_type.hpp"
#include "town_type.h"
#include "engine_type.h"
#include "house_type.h"

View File

@ -12,6 +12,7 @@
#include "command_type.h"
#include "track_type.h"
#include "direction_type.h"
#include "rail_type.h"
#include "signal_type.h"

View File

@ -13,6 +13,8 @@
#include "direction_type.h"
#include "road_type.h"
#include "command_type.h"
#include "station_type.h"
#include "town_type.h"
enum RoadStopClassID : uint16_t;

View File

@ -10,6 +10,7 @@
#ifndef ROAD_GUI_H
#define ROAD_GUI_H
#include "road.h"
#include "road_type.h"
#include "tile_type.h"
#include "direction_type.h"

View File

@ -11,6 +11,7 @@
#define SAVELOAD_NEWGRF_SL_H
#include "../newgrf_commons.h"
#include "saveload.h"
struct NewGRFMappingChunkHandler : ChunkHandler {
OverrideManagerBase &mapping;

View File

@ -11,6 +11,7 @@
#define SCRIPT_CONTROLLER_HPP
#include "script_types.hpp"
#include "../../string_func.h"
#include "../../company_type.h"
/**

View File

@ -13,6 +13,8 @@
#include "../company_type.h"
#include "../textfile_type.h"
struct Window;
void ShowScriptListWindow(CompanyID slot, bool show_all);
Window *ShowScriptDebugWindow(CompanyID show_company = CompanyID::Invalid(), bool new_window = false);
void ShowScriptSettingsWindow(CompanyID slot);

View File

@ -10,6 +10,8 @@
#ifndef SIGNS_TYPE_H
#define SIGNS_TYPE_H
#include "core/pool_type.hpp"
/** The type of the IDs of signs. */
using SignID = PoolID<uint16_t, struct SignIDTag, 64000, 0xFFFF>;

View File

@ -11,8 +11,12 @@
#define STATION_CMD_H
#include "command_type.h"
#include "rail_type.h"
#include "road_type.h"
#include "station_type.h"
struct Town;
enum StationClassID : uint16_t;
enum RoadStopClassID : uint16_t;

View File

@ -10,6 +10,7 @@
#ifndef SUBSIDY_FUNC_H
#define SUBSIDY_FUNC_H
#include "source_type.h"
#include "station_type.h"
#include "company_type.h"
#include "cargo_type.h"

View File

@ -11,6 +11,7 @@
#define SUBSIDY_TYPE_H
#include "core/enum_type.hpp"
#include "core/pool_type.hpp"
/** What part of a subsidy is something? */
enum class PartOfSubsidy : uint8_t {

View File

@ -10,6 +10,8 @@
#ifndef AIRPORTTILES_H
#define AIRPORTTILES_H
#include "table/strings.h"
/** Writes all airport tile properties in the AirportTile struct */
#define AT(num_frames, anim_speed) {{num_frames, AnimationStatus::Looping, anim_speed, 0}, STR_NULL, AirportTileCallbackMasks{}, 0, true, GRFFileProps(INVALID_AIRPORTTILE), {}}
/** Writes an airport tile without animation in the AirportTile struct */

View File

@ -5,6 +5,8 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
#include "table/strings.h"
/**
* @file bridge_land.h This file contains all the sprites for bridges
* It consists of a number of arrays.

View File

@ -10,6 +10,8 @@
#ifndef BUILD_INDUSTRY_H
#define BUILD_INDUSTRY_H
#include "table/strings.h"
/**
* Definition of an industry tiles layout.
* @param x offset x of this tile

View File

@ -7,6 +7,11 @@
/** @file cargo_const.h Table of all default cargo types */
#include "../table/sprites.h"
#ifndef CHECK_UNUSED_STRINGS
#include "table/strings.h"
#endif
/** Construction macros for the #CargoSpec StringID entries. */
#define MK_STR_CARGO_PLURAL(label_plural) STR_CARGO_PLURAL_ ## label_plural
#define MK_STR_CARGO_SINGULAR(label_singular) STR_CARGO_SINGULAR_ ## label_singular

View File

@ -7,6 +7,8 @@
/** @file clear_land.h Tables with sprites for clear land and fences. */
#include "sprites.h"
static const SpriteID _landscape_clear_sprites_rough[8] = {
SPR_FLAT_ROUGH_LAND,
SPR_FLAT_ROUGH_LAND_1,

View File

@ -13,6 +13,8 @@
#ifndef ENGINES_H
#define ENGINES_H
#include "table/strings.h"
/**
* Writes the properties of a train into the EngineInfo struct.
* @see EngineInfo

View File

@ -7,6 +7,8 @@
/** @file object_land.h Sprites to use and how to display them for object tiles. */
#include "table/strings.h"
#define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
static const DrawTileSeqStruct _object_transmitter_seq[] = {

View File

@ -13,6 +13,8 @@
#ifndef RAILTYPES_H
#define RAILTYPES_H
#include "table/strings.h"
/**
* Global Railtype definition
*/

View File

@ -13,6 +13,8 @@
#ifndef ROADTYPES_H
#define ROADTYPES_H
#include "table/strings.h"
/**
* Global Roadtype definition
*/

View File

@ -7,6 +7,8 @@
/** @file table/settings.h Settings to save in the savegame and config file. */
#include "table/strings.h"
/* Callback function used in _settings[] as well as _company_settings[] */
static size_t ConvertLandscape(const char *value);

View File

@ -11,7 +11,9 @@
#define TIMETABLE_CMD_H
#include "command_type.h"
#include "order_type.h"
#include "timer/timer_game_tick.h"
#include "vehicle_type.h"
CommandCost CmdChangeTimetable(DoCommandFlags flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16_t data);
CommandCost CmdBulkChangeTimetable(DoCommandFlags flags, VehicleID veh, ModifyTimetableFlags mtf, uint16_t data);

View File

@ -12,6 +12,7 @@
#include "command_type.h"
#include "engine_type.h"
#include "network/network_type.h"
#include "vehicle_type.h"
CommandCost CmdBuildRailVehicle(DoCommandFlags flags, TileIndex tile, const Engine *e, Vehicle **ret);