1
0
Fork 0

Codefix: Prefer `static inline const` keyword order. (#14301)

pull/14302/head
Peter Nelson 2025-05-25 20:32:56 +01:00 committed by GitHub
parent 948ceb3b17
commit b042e7a439
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 102 additions and 102 deletions

View File

@ -183,7 +183,7 @@ public:
* @param orig_age Age of the original link graph.
* @return scaled value.
*/
inline static uint Scale(uint val, TimerGameEconomy::Date target_age, TimerGameEconomy::Date orig_age)
static inline uint Scale(uint val, TimerGameEconomy::Date target_age, TimerGameEconomy::Date orig_age)
{
return val > 0 ? std::max(1U, val * target_age.base() / orig_age.base()) : 0;
}

View File

@ -299,7 +299,7 @@ public:
* @param total Total capacity.
* @return free * 16 / max(total, 1).
*/
inline static int GetCapacityRatio(int free, uint total)
static inline int GetCapacityRatio(int free, uint total)
{
return Clamp(free, PATH_CAP_MIN_FREE, PATH_CAP_MAX_FREE) * PATH_CAP_MULTIPLIER / std::max(total, 1U);
}

View File

@ -147,7 +147,7 @@ protected:
int number_of_items = 0; // item counter
/** static helper - return hash for the given key modulo number of slots */
inline static int CalcHash(const Tkey &key)
static inline int CalcHash(const Tkey &key)
{
uint32_t hash = key.CalcHash();
hash -= (hash >> 17); // hash * 131071 / 131072
@ -157,7 +157,7 @@ protected:
}
/** static helper - return hash for the given item modulo number of slots */
inline static int CalcHash(const Titem &item)
static inline int CalcHash(const Titem &item)
{
return CalcHash(item.GetKey());
}

View File

@ -93,8 +93,8 @@ struct CFollowTrackT
debug_inline static bool IsRailTT() { return TT() == TRANSPORT_RAIL; }
inline bool IsTram() { return IsRoadTT() && RoadTypeIsTram(RoadVehicle::From(this->veh)->roadtype); }
debug_inline static bool IsRoadTT() { return TT() == TRANSPORT_ROAD; }
inline static bool Allow90degTurns() { return T90deg_turns_allowed_; }
inline static bool DoTrackMasking() { return Tmask_reserved_tracks; }
static inline bool Allow90degTurns() { return T90deg_turns_allowed_; }
static inline bool DoTrackMasking() { return Tmask_reserved_tracks; }
/** Tests if a tile is a road tile with a single tramtrack (tram can reverse) */
inline DiagDirection GetSingleTramBit(TileIndex tile)

View File

@ -24,7 +24,7 @@ struct CYapfCostBase {
* @param td The track direction to check.
* @return True if there's a slope, otherwise false.
*/
inline static bool stSlopeCost(TileIndex tile, Trackdir td)
static inline bool stSlopeCost(TileIndex tile, Trackdir td)
{
if (IsDiagonalTrackdir(td)) {
if (IsBridgeTile(tile)) {

View File

@ -124,7 +124,7 @@ protected:
return *static_cast<Tpf *>(this);
}
inline static Cache &stGetGlobalCache()
static inline Cache &stGetGlobalCache()
{
static int last_rail_change_counter = 0;
static Cache C;

View File

@ -246,8 +246,8 @@ struct CompanyOldAI {
class SlCompanyOldAIBuildRec : public DefaultSaveLoadHandler<SlCompanyOldAIBuildRec, CompanyOldAI> {
public:
inline static const SaveLoad description[] = {{}}; // Needed to keep DefaultSaveLoadHandler happy.
inline const static SaveLoadCompatTable compat_description = _company_old_ai_buildrec_compat;
static inline const SaveLoad description[] = {{}}; // Needed to keep DefaultSaveLoadHandler happy.
static inline const SaveLoadCompatTable compat_description = _company_old_ai_buildrec_compat;
SaveLoadTable GetDescription() const override { return {}; }
@ -263,11 +263,11 @@ public:
class SlCompanyOldAI : public DefaultSaveLoadHandler<SlCompanyOldAI, CompanyProperties> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(CompanyOldAI, num_build_rec, SLE_UINT8, SL_MIN_VERSION, SLV_107),
SLEG_STRUCTLIST("buildrec", SlCompanyOldAIBuildRec),
};
inline const static SaveLoadCompatTable compat_description = _company_old_ai_compat;
static inline const SaveLoadCompatTable compat_description = _company_old_ai_compat;
void Load(CompanyProperties *c) const override
{
@ -282,7 +282,7 @@ public:
class SlCompanySettings : public DefaultSaveLoadHandler<SlCompanySettings, CompanyProperties> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
/* Engine renewal settings */
SLE_CONDREF(CompanyProperties, engine_renew_list, REF_ENGINE_RENEWS, SLV_19, SL_MAX_VERSION),
SLE_CONDVAR(CompanyProperties, settings.engine_renew, SLE_BOOL, SLV_16, SL_MAX_VERSION),
@ -297,7 +297,7 @@ public:
SLE_CONDVAR(CompanyProperties, settings.vehicle.servint_aircraft, SLE_UINT16, SLV_120, SL_MAX_VERSION),
SLE_CONDVAR(CompanyProperties, settings.vehicle.servint_ships, SLE_UINT16, SLV_120, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _company_settings_compat;
static inline const SaveLoadCompatTable compat_description = _company_settings_compat;
void Save(CompanyProperties *c) const override
{
@ -319,7 +319,7 @@ public:
class SlCompanyEconomy : public DefaultSaveLoadHandler<SlCompanyEconomy, CompanyProperties> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(CompanyEconomyEntry, income, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
SLE_CONDVAR(CompanyEconomyEntry, income, SLE_INT64, SLV_2, SL_MAX_VERSION),
SLE_CONDVAR(CompanyEconomyEntry, expenses, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
@ -332,7 +332,7 @@ public:
SLE_CONDARR(CompanyEconomyEntry, delivered_cargo, SLE_UINT32, NUM_CARGO, SLV_EXTEND_CARGOTYPES, SL_MAX_VERSION),
SLE_VAR(CompanyEconomyEntry, performance_history, SLE_INT32),
};
inline const static SaveLoadCompatTable compat_description = _company_economy_compat;
static inline const SaveLoadCompatTable compat_description = _company_economy_compat;
void Save(CompanyProperties *c) const override
{
@ -379,12 +379,12 @@ public:
class SlCompanyLiveries : public DefaultSaveLoadHandler<SlCompanyLiveries, CompanyProperties> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(Livery, in_use, SLE_UINT8, SLV_34, SL_MAX_VERSION),
SLE_CONDVAR(Livery, colour1, SLE_UINT8, SLV_34, SL_MAX_VERSION),
SLE_CONDVAR(Livery, colour2, SLE_UINT8, SLV_34, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _company_liveries_compat;
static inline const SaveLoadCompatTable compat_description = _company_liveries_compat;
/**
* Get the number of liveries used by this savegame version.
@ -447,10 +447,10 @@ public:
std::string key;
};
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_SSTR(KeyWrapper, key, SLE_STR),
};
inline const static SaveLoadCompatTable compat_description = {};
static inline const SaveLoadCompatTable compat_description = {};
std::vector<std::string> &GetVector(CompanyProperties *cprops) const override { return cprops->allow_list; }

View File

@ -120,10 +120,10 @@ static uint32_t _game_saveload_strings;
class SlGameLanguageString : public DefaultSaveLoadHandler<SlGameLanguageString, LanguageStrings> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_SSTR("string", _game_saveload_string, SLE_STR | SLF_ALLOW_CONTROL | SLF_REPLACE_TABCRLF),
};
inline const static SaveLoadCompatTable compat_description = _game_language_string_sl_compat;
static inline const SaveLoadCompatTable compat_description = _game_language_string_sl_compat;
void Save(LanguageStrings *ls) const override
{

View File

@ -21,11 +21,11 @@
class SlGamelogMode : public DefaultSaveLoadHandler<SlGamelogMode, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeMode, mode, "mode.mode", SLE_UINT8),
SLE_VARNAME(LoggedChangeMode, landscape, "mode.landscape", SLE_UINT8),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_mode_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_mode_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -47,14 +47,14 @@ public:
static const size_t GAMELOG_REVISION_LENGTH = 15;
static char revision_text[GAMELOG_REVISION_LENGTH];
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_CONDARR("revision.text", SlGamelogRevision::revision_text, SLE_UINT8, GAMELOG_REVISION_LENGTH, SL_MIN_VERSION, SLV_STRING_GAMELOG),
SLE_CONDSSTRNAME(LoggedChangeRevision, text, "revision.text", SLE_STR, SLV_STRING_GAMELOG, SL_MAX_VERSION),
SLE_VARNAME(LoggedChangeRevision, newgrf, "revision.newgrf", SLE_UINT32),
SLE_VARNAME(LoggedChangeRevision, slver, "revision.slver", SLE_UINT16),
SLE_VARNAME(LoggedChangeRevision, modified, "revision.modified", SLE_UINT8),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_revision_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_revision_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -79,11 +79,11 @@ public:
class SlGamelogOldver : public DefaultSaveLoadHandler<SlGamelogOldver, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeOldVersion, type, "oldver.type", SLE_UINT32),
SLE_VARNAME(LoggedChangeOldVersion, version, "oldver.version", SLE_UINT32),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_oldver_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_oldver_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -102,12 +102,12 @@ public:
class SlGamelogSetting : public DefaultSaveLoadHandler<SlGamelogSetting, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_SSTRNAME(LoggedChangeSettingChanged, name, "setting.name", SLE_STR),
SLE_VARNAME(LoggedChangeSettingChanged, oldval, "setting.oldval", SLE_INT32),
SLE_VARNAME(LoggedChangeSettingChanged, newval, "setting.newval", SLE_INT32),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_setting_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_setting_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -126,11 +126,11 @@ public:
class SlGamelogGrfadd : public DefaultSaveLoadHandler<SlGamelogGrfadd, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFAdd, grfid, "grfadd.grfid", SLE_UINT32 ),
SLE_ARRNAME(LoggedChangeGRFAdd, md5sum, "grfadd.md5sum", SLE_UINT8, 16),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfadd_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfadd_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -149,10 +149,10 @@ public:
class SlGamelogGrfrem : public DefaultSaveLoadHandler<SlGamelogGrfrem, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFRemoved, grfid, "grfrem.grfid", SLE_UINT32),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfrem_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfrem_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -171,11 +171,11 @@ public:
class SlGamelogGrfcompat : public DefaultSaveLoadHandler<SlGamelogGrfcompat, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFChanged, grfid, "grfcompat.grfid", SLE_UINT32 ),
SLE_ARRNAME(LoggedChangeGRFChanged, md5sum, "grfcompat.md5sum", SLE_UINT8, 16),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfcompat_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfcompat_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -194,10 +194,10 @@ public:
class SlGamelogGrfparam : public DefaultSaveLoadHandler<SlGamelogGrfparam, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFParameterChanged, grfid, "grfparam.grfid", SLE_UINT32),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfparam_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfparam_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -216,11 +216,11 @@ public:
class SlGamelogGrfmove : public DefaultSaveLoadHandler<SlGamelogGrfmove, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFMoved, grfid, "grfmove.grfid", SLE_UINT32),
SLE_VARNAME(LoggedChangeGRFMoved, offset, "grfmove.offset", SLE_INT32),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfmove_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfmove_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -239,12 +239,12 @@ public:
class SlGamelogGrfbug : public DefaultSaveLoadHandler<SlGamelogGrfbug, LoggedChange> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VARNAME(LoggedChangeGRFBug, data, "grfbug.data", SLE_UINT64),
SLE_VARNAME(LoggedChangeGRFBug, grfid, "grfbug.grfid", SLE_UINT32),
SLE_VARNAME(LoggedChangeGRFBug, bug, "grfbug.bug", SLE_UINT8),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_grfbug_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_grfbug_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -266,10 +266,10 @@ static bool _is_emergency_save = true;
class SlGamelogEmergency : public DefaultSaveLoadHandler<SlGamelogEmergency, LoggedChange> {
public:
/* We need to store something, so store a "true" value. */
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_CONDVAR("is_emergency_save", _is_emergency_save, SLE_BOOL, SLV_RIFF_TO_ARRAY, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_emergency_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_emergency_sl_compat;
void Save(LoggedChange *lc) const override
{
@ -312,7 +312,7 @@ static std::unique_ptr<LoggedChange> MakeLoggedChange(GamelogChangeType type)
class SlGamelogAction : public DefaultSaveLoadHandler<SlGamelogAction, LoggedAction> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_SAVEBYTE(LoggedChange, ct),
SLEG_STRUCT("mode", SlGamelogMode),
SLEG_STRUCT("revision", SlGamelogRevision),
@ -326,7 +326,7 @@ public:
SLEG_STRUCT("grfbug", SlGamelogGrfbug),
SLEG_STRUCT("emergency", SlGamelogEmergency),
};
inline const static SaveLoadCompatTable compat_description = _gamelog_action_sl_compat;
static inline const SaveLoadCompatTable compat_description = _gamelog_action_sl_compat;
void Save(LoggedAction *la) const override
{

View File

@ -21,12 +21,12 @@ static OldPersistentStorage _old_ind_persistent_storage;
class SlIndustryAccepted : public VectorSaveLoadHandler<SlIndustryAccepted, Industry, Industry::AcceptedCargo, INDUSTRY_NUM_INPUTS> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Industry::AcceptedCargo, cargo, SLE_UINT8),
SLE_VAR(Industry::AcceptedCargo, waiting, SLE_UINT16),
SLE_VAR(Industry::AcceptedCargo, last_accepted, SLE_INT32),
};
inline const static SaveLoadCompatTable compat_description = _industry_accepts_sl_compat;
static inline const SaveLoadCompatTable compat_description = _industry_accepts_sl_compat;
std::vector<Industry::AcceptedCargo> &GetVector(Industry *i) const override { return i->accepted; }
@ -45,11 +45,11 @@ public:
class SlIndustryProducedHistory : public DefaultSaveLoadHandler<SlIndustryProducedHistory, Industry::ProducedCargo> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Industry::ProducedHistory, production, SLE_UINT16),
SLE_VAR(Industry::ProducedHistory, transported, SLE_UINT16),
};
inline const static SaveLoadCompatTable compat_description = _industry_produced_history_sl_compat;
static inline const SaveLoadCompatTable compat_description = _industry_produced_history_sl_compat;
void Save(Industry::ProducedCargo *p) const override
{
@ -79,13 +79,13 @@ public:
class SlIndustryProduced : public VectorSaveLoadHandler<SlIndustryProduced, Industry, Industry::ProducedCargo, INDUSTRY_NUM_OUTPUTS> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Industry::ProducedCargo, cargo, SLE_UINT8),
SLE_VAR(Industry::ProducedCargo, waiting, SLE_UINT16),
SLE_VAR(Industry::ProducedCargo, rate, SLE_UINT8),
SLEG_STRUCTLIST("history", SlIndustryProducedHistory),
};
inline const static SaveLoadCompatTable compat_description = _industry_produced_sl_compat;
static inline const SaveLoadCompatTable compat_description = _industry_produced_sl_compat;
std::vector<Industry::ProducedCargo> &GetVector(Industry *i) const override { return i->produced; }

View File

@ -30,7 +30,7 @@ static NodeID _linkgraph_from; ///< Contains the current "from" node being saved
class SlLinkgraphEdge : public DefaultSaveLoadHandler<SlLinkgraphEdge, Node> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Edge, capacity, SLE_UINT32),
SLE_VAR(Edge, usage, SLE_UINT32),
SLE_CONDVAR(Edge, travel_time_sum, SLE_UINT64, SLV_LINKGRAPH_TRAVEL_TIME, SL_MAX_VERSION),
@ -39,7 +39,7 @@ public:
SLE_VAR(Edge, dest_node, SLE_UINT16),
SLE_CONDVARNAME(Edge, dest_node, "next_edge", SLE_UINT16, SL_MIN_VERSION, SLV_LINKGRAPH_EDGES),
};
inline const static SaveLoadCompatTable compat_description = _linkgraph_edge_sl_compat;
static inline const SaveLoadCompatTable compat_description = _linkgraph_edge_sl_compat;
void Save(Node *bn) const override
{
@ -95,7 +95,7 @@ public:
class SlLinkgraphNode : public DefaultSaveLoadHandler<SlLinkgraphNode, LinkGraph> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(Node, xy, SLE_UINT32, SLV_191, SL_MAX_VERSION),
SLE_VAR(Node, supply, SLE_UINT32),
SLE_VAR(Node, demand, SLE_UINT32),
@ -103,7 +103,7 @@ public:
SLE_VAR(Node, last_update, SLE_INT32),
SLEG_STRUCTLIST("edges", SlLinkgraphEdge),
};
inline const static SaveLoadCompatTable compat_description = _linkgraph_node_sl_compat;
static inline const SaveLoadCompatTable compat_description = _linkgraph_node_sl_compat;
void Save(LinkGraph *lg) const override
{
@ -153,9 +153,9 @@ SaveLoadTable GetLinkGraphDesc()
*/
class SlLinkgraphJobProxy : public DefaultSaveLoadHandler<SlLinkgraphJobProxy, LinkGraphJob> {
public:
inline static const SaveLoad description[] = {{}}; // Needed to keep DefaultSaveLoadHandler happy.
static inline const SaveLoad description[] = {{}}; // Needed to keep DefaultSaveLoadHandler happy.
SaveLoadTable GetDescription() const override { return GetLinkGraphDesc(); }
inline const static SaveLoadCompatTable compat_description = _linkgraph_sl_compat;
static inline const SaveLoadCompatTable compat_description = _linkgraph_sl_compat;
void Save(LinkGraphJob *lgj) const override
{

View File

@ -214,7 +214,7 @@ struct ORDRChunkHandler : ChunkHandler {
template <typename T>
class SlOrders : public VectorSaveLoadHandler<SlOrders<T>, T, Order> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Order, type, SLE_UINT8),
SLE_VAR(Order, flags, SLE_UINT8),
SLE_VAR(Order, dest, SLE_UINT16),
@ -223,7 +223,7 @@ public:
SLE_VAR(Order, travel_time, SLE_UINT16),
SLE_VAR(Order, max_speed, SLE_UINT16),
};
inline const static SaveLoadCompatTable compat_description = {};
static inline const SaveLoadCompatTable compat_description = {};
std::vector<Order> &GetVector(T *container) const override { return container->orders; }

View File

@ -208,12 +208,12 @@ static void SwapPackets(GoodsEntry *ge)
template <typename T>
class SlStationSpecList : public VectorSaveLoadHandler<SlStationSpecList<T>, BaseStation, SpecMapping<T>> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(SpecMapping<T>, grfid, SLE_UINT32, SLV_27, SL_MAX_VERSION),
SLE_CONDVAR(SpecMapping<T>, localidx, SLE_FILE_U8 | SLE_VAR_U16, SLV_27, SLV_EXTEND_ENTITY_MAPPING),
SLE_CONDVAR(SpecMapping<T>, localidx, SLE_UINT16, SLV_EXTEND_ENTITY_MAPPING, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _station_spec_list_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_spec_list_sl_compat;
static inline uint8_t last_num_specs; ///< Number of specs of the last loaded station.
@ -231,11 +231,11 @@ template class SlStationSpecList<RoadStopSpec>;
class SlStationCargo : public DefaultSaveLoadHandler<SlStationCargo, GoodsEntry> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(StationCargoPair, first, SLE_UINT16),
SLE_REFLIST(StationCargoPair, second, REF_CARGO_PACKET),
};
inline const static SaveLoadCompatTable compat_description = _station_cargo_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_cargo_sl_compat;
void Save(GoodsEntry *ge) const override
{
@ -277,13 +277,13 @@ public:
class SlStationFlow : public DefaultSaveLoadHandler<SlStationFlow, GoodsEntry> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(FlowSaveLoad, source, SLE_UINT16),
SLE_VAR(FlowSaveLoad, via, SLE_UINT16),
SLE_VAR(FlowSaveLoad, share, SLE_UINT32),
SLE_CONDVAR(FlowSaveLoad, restricted, SLE_BOOL, SLV_187, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _station_flow_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_flow_sl_compat;
void Save(GoodsEntry *ge) const override
{
@ -339,7 +339,7 @@ class SlStationGoods : public DefaultSaveLoadHandler<SlStationGoods, BaseStation
public:
static inline uint cargo_reserved_count;
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_CONDVAR("waiting_acceptance", _waiting_acceptance, SLE_UINT16, SL_MIN_VERSION, SLV_68),
SLE_CONDVAR(GoodsEntry, status, SLE_UINT8, SLV_68, SL_MAX_VERSION),
SLE_VAR(GoodsEntry, time_since_pickup, SLE_UINT8),
@ -364,7 +364,7 @@ public:
SLEG_CONDSTRUCTLIST("cargo", SlStationCargo, SLV_183, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _station_goods_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_goods_sl_compat;
/**
* Get the number of cargoes used by this savegame version.
@ -534,12 +534,12 @@ struct STNSChunkHandler : ChunkHandler {
class SlRoadStopTileData : public VectorSaveLoadHandler<SlRoadStopTileData, BaseStation, RoadStopTileData> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(RoadStopTileData, tile, SLE_UINT32),
SLE_VAR(RoadStopTileData, random_bits, SLE_UINT8),
SLE_VAR(RoadStopTileData, animation_frame, SLE_UINT8),
};
inline const static SaveLoadCompatTable compat_description = {};
static inline const SaveLoadCompatTable compat_description = {};
std::vector<RoadStopTileData> &GetVector(BaseStation *bst) const override { return bst->custom_roadstop_tile_data; }
};
@ -550,7 +550,7 @@ public:
*/
class SlStationBase : public DefaultSaveLoadHandler<SlStationBase, BaseStation> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(BaseStation, xy, SLE_UINT32),
SLE_REF(BaseStation, town, REF_TOWN),
SLE_VAR(BaseStation, string_id, SLE_STRINGID),
@ -565,7 +565,7 @@ public:
SLE_VARNAME(BaseStation, waiting_random_triggers, "waiting_triggers", SLE_UINT8),
SLEG_CONDVAR("num_specs", SlStationSpecList<StationSpec>::last_num_specs, SLE_UINT8, SL_MIN_VERSION, SLV_SAVELOAD_LIST_LENGTH),
};
inline const static SaveLoadCompatTable compat_description = _station_base_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_base_sl_compat;
void Save(BaseStation *bst) const override
{
@ -588,7 +588,7 @@ public:
*/
class SlStationNormal : public DefaultSaveLoadHandler<SlStationNormal, BaseStation> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("base", SlStationBase),
SLE_VAR(Station, train_station.tile, SLE_UINT32),
SLE_VAR(Station, train_station.w, SLE_FILE_U8 | SLE_VAR_U16),
@ -624,7 +624,7 @@ public:
SLEG_CONDSTRUCTLIST("speclist", SlRoadStopTileData, SLV_NEWGRF_ROAD_STOPS, SLV_ROAD_STOP_TILE_DATA),
SLEG_STRUCTLIST("goods", SlStationGoods),
};
inline const static SaveLoadCompatTable compat_description = _station_normal_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_normal_sl_compat;
void Save(BaseStation *bst) const override
{
@ -647,7 +647,7 @@ public:
class SlStationWaypoint : public DefaultSaveLoadHandler<SlStationWaypoint, BaseStation> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("base", SlStationBase),
SLE_VAR(Waypoint, town_cn, SLE_UINT16),
@ -659,7 +659,7 @@ public:
SLE_CONDVAR(Waypoint, road_waypoint_area.w, SLE_FILE_U8 | SLE_VAR_U16, SLV_ROAD_WAYPOINTS, SL_MAX_VERSION),
SLE_CONDVAR(Waypoint, road_waypoint_area.h, SLE_FILE_U8 | SLE_VAR_U16, SLV_ROAD_WAYPOINTS, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _station_waypoint_sl_compat;
static inline const SaveLoadCompatTable compat_description = _station_waypoint_sl_compat;
void Save(BaseStation *bst) const override
{

View File

@ -114,13 +114,13 @@ void UpdateHousesAndTowns()
class SlTownSupplied : public DefaultSaveLoadHandler<SlTownSupplied, Town> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(TransportedCargoStat<uint32_t>, old_max, SLE_UINT32, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint32_t>, new_max, SLE_UINT32, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint32_t>, old_act, SLE_UINT32, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint32_t>, new_act, SLE_UINT32, SLV_165, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _town_supplied_sl_compat;
static inline const SaveLoadCompatTable compat_description = _town_supplied_sl_compat;
/**
* Get the number of cargoes used by this savegame version.
@ -153,13 +153,13 @@ public:
class SlTownReceived : public DefaultSaveLoadHandler<SlTownReceived, Town> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_CONDVAR(TransportedCargoStat<uint16_t>, old_max, SLE_UINT16, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint16_t>, new_max, SLE_UINT16, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint16_t>, old_act, SLE_UINT16, SLV_165, SL_MAX_VERSION),
SLE_CONDVAR(TransportedCargoStat<uint16_t>, new_act, SLE_UINT16, SLV_165, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _town_received_sl_compat;
static inline const SaveLoadCompatTable compat_description = _town_received_sl_compat;
void Save(Town *t) const override
{
@ -186,12 +186,12 @@ private:
static const uint GRID = 4;
};
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(AcceptanceMatrix, area.tile, SLE_UINT32),
SLE_VAR(AcceptanceMatrix, area.w, SLE_UINT16),
SLE_VAR(AcceptanceMatrix, area.h, SLE_UINT16),
};
inline const static SaveLoadCompatTable compat_description = _town_acceptance_matrix_sl_compat;
static inline const SaveLoadCompatTable compat_description = _town_acceptance_matrix_sl_compat;
void Load(Town *) const override
{

View File

@ -644,7 +644,7 @@ static Money _cargo_feeder_share;
class SlVehicleCommon : public DefaultSaveLoadHandler<SlVehicleCommon, Vehicle> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Vehicle, subtype, SLE_UINT8),
SLE_REF(Vehicle, next, REF_VEHICLE_OLD),
@ -775,7 +775,7 @@ public:
SLE_CONDVAR(Vehicle, round_trip_time, SLE_INT32, SLV_DEPOT_UNBUNCHING, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_common_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_common_sl_compat;
void Save(Vehicle *v) const override
{
@ -795,7 +795,7 @@ public:
class SlVehicleTrain : public DefaultSaveLoadHandler<SlVehicleTrain, Vehicle> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("common", SlVehicleCommon),
SLE_VAR(Train, crash_anim_pos, SLE_UINT16),
SLE_VAR(Train, force_proceed, SLE_UINT8),
@ -807,7 +807,7 @@ public:
SLE_CONDVAR(Train, wait_counter, SLE_UINT16, SLV_136, SL_MAX_VERSION),
SLE_CONDVAR(Train, gv_flags, SLE_UINT16, SLV_139, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_train_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_train_sl_compat;
void Save(Vehicle *v) const override
{
@ -830,11 +830,11 @@ public:
class SlVehicleRoadVehPath : public VectorSaveLoadHandler<SlVehicleRoadVehPath, RoadVehicle, RoadVehPathElement> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(RoadVehPathElement, trackdir, SLE_UINT8),
SLE_VAR(RoadVehPathElement, tile, SLE_UINT32),
};
inline const static SaveLoadCompatTable compat_description = {};
static inline const SaveLoadCompatTable compat_description = {};
std::vector<RoadVehPathElement> &GetVector(RoadVehicle *rv) const override { return rv->path; }
};
@ -845,7 +845,7 @@ public:
static inline std::vector<Trackdir> rv_path_td;
static inline std::vector<TileIndex> rv_path_tile;
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("common", SlVehicleCommon),
SLE_VAR(RoadVehicle, state, SLE_UINT8),
SLE_VAR(RoadVehicle, frame, SLE_UINT8),
@ -859,7 +859,7 @@ public:
SLEG_CONDSTRUCTLIST("path", SlVehicleRoadVehPath, SLV_PATH_CACHE_FORMAT, SL_MAX_VERSION),
SLE_CONDVAR(RoadVehicle, gv_flags, SLE_UINT16, SLV_139, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_roadveh_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_roadveh_sl_compat;
static void ConvertPathCache(RoadVehicle &rv)
{
@ -904,10 +904,10 @@ public:
class SlVehicleShipPath : public VectorSaveLoadHandler<SlVehicleShipPath, Ship, ShipPathElement> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(ShipPathElement, trackdir, SLE_UINT8),
};
inline const static SaveLoadCompatTable compat_description = {};
static inline const SaveLoadCompatTable compat_description = {};
std::vector<ShipPathElement> &GetVector(Ship *s) const override { return s->path; }
};
@ -916,14 +916,14 @@ class SlVehicleShip : public DefaultSaveLoadHandler<SlVehicleShip, Vehicle> {
public:
static inline std::vector<Trackdir> ship_path_td;
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("common", SlVehicleCommon),
SLE_VAR(Ship, state, SLE_UINT8),
SLEG_CONDVECTOR("path", ship_path_td, SLE_UINT8, SLV_SHIP_PATH_CACHE, SLV_PATH_CACHE_FORMAT),
SLEG_CONDSTRUCTLIST("path", SlVehicleShipPath, SLV_PATH_CACHE_FORMAT, SL_MAX_VERSION),
SLE_CONDVAR(Ship, rotation, SLE_UINT8, SLV_SHIP_ROTATION, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_ship_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_ship_sl_compat;
void Save(Vehicle *v) const override
{
@ -952,7 +952,7 @@ public:
class SlVehicleAircraft : public DefaultSaveLoadHandler<SlVehicleAircraft, Vehicle> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLEG_STRUCT("common", SlVehicleCommon),
SLE_VAR(Aircraft, crashed_counter, SLE_UINT16),
SLE_VAR(Aircraft, pos, SLE_UINT8),
@ -969,7 +969,7 @@ public:
SLE_CONDVAR(Aircraft, turn_counter, SLE_UINT8, SLV_136, SL_MAX_VERSION),
SLE_CONDVAR(Aircraft, flags, SLE_UINT8, SLV_167, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_aircraft_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_aircraft_sl_compat;
void Save(Vehicle *v) const override
{
@ -992,7 +992,7 @@ public:
class SlVehicleEffect : public DefaultSaveLoadHandler<SlVehicleEffect, Vehicle> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_VAR(Vehicle, subtype, SLE_UINT8),
SLE_CONDVAR(Vehicle, tile, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_6),
@ -1014,7 +1014,7 @@ public:
SLE_CONDVAR(Vehicle, spritenum, SLE_UINT8, SLV_2, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_effect_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_effect_sl_compat;
void Save(Vehicle *v) const override
{
@ -1037,7 +1037,7 @@ public:
class SlVehicleDisaster : public DefaultSaveLoadHandler<SlVehicleDisaster, Vehicle> {
public:
inline static const SaveLoad description[] = {
static inline const SaveLoad description[] = {
SLE_REF(Vehicle, next, REF_VEHICLE_OLD),
SLE_VAR(Vehicle, subtype, SLE_UINT8),
@ -1072,7 +1072,7 @@ public:
SLE_CONDVAR(DisasterVehicle, flags, SLE_UINT8, SLV_194, SL_MAX_VERSION),
};
inline const static SaveLoadCompatTable compat_description = _vehicle_disaster_sl_compat;
static inline const SaveLoadCompatTable compat_description = _vehicle_disaster_sl_compat;
void Save(Vehicle *v) const override
{
@ -1093,7 +1093,7 @@ public:
}
};
const static SaveLoad _vehicle_desc[] = {
static const SaveLoad _vehicle_desc[] = {
SLE_SAVEBYTE(Vehicle, type),
SLEG_STRUCT("train", SlVehicleTrain),
SLEG_STRUCT("roadveh", SlVehicleRoadVeh),

View File

@ -139,7 +139,7 @@ static bool IsSignedVarMemType(VarType vt)
*/
class ConfigIniFile : public IniFile {
private:
inline static const IniGroupNameList list_group_names = {
static inline const IniGroupNameList list_group_names = {
"bans",
"newgrf",
"servers",