diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h index 72ec56d61d..323158d230 100644 --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -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; } diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h index 8e08711060..a43a2d5df0 100644 --- a/src/linkgraph/linkgraphjob.h +++ b/src/linkgraph/linkgraphjob.h @@ -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); } diff --git a/src/misc/hashtable.hpp b/src/misc/hashtable.hpp index 36eeaf421c..52a06462c9 100644 --- a/src/misc/hashtable.hpp +++ b/src/misc/hashtable.hpp @@ -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()); } diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp index 4e10328512..2af15089dd 100644 --- a/src/pathfinder/follow_track.hpp +++ b/src/pathfinder/follow_track.hpp @@ -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) diff --git a/src/pathfinder/yapf/yapf_costbase.hpp b/src/pathfinder/yapf/yapf_costbase.hpp index 66579e01b6..8211ddee12 100644 --- a/src/pathfinder/yapf/yapf_costbase.hpp +++ b/src/pathfinder/yapf/yapf_costbase.hpp @@ -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)) { diff --git a/src/pathfinder/yapf/yapf_costcache.hpp b/src/pathfinder/yapf/yapf_costcache.hpp index 3e5a51dab1..43f3f31b21 100644 --- a/src/pathfinder/yapf/yapf_costcache.hpp +++ b/src/pathfinder/yapf/yapf_costcache.hpp @@ -124,7 +124,7 @@ protected: return *static_cast(this); } - inline static Cache &stGetGlobalCache() + static inline Cache &stGetGlobalCache() { static int last_rail_change_counter = 0; static Cache C; diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index 4beeca6a23..810f977fdf 100644 --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -246,8 +246,8 @@ struct CompanyOldAI { class SlCompanyOldAIBuildRec : public DefaultSaveLoadHandler { 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 { 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 { 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 { 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 { 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 &GetVector(CompanyProperties *cprops) const override { return cprops->allow_list; } diff --git a/src/saveload/game_sl.cpp b/src/saveload/game_sl.cpp index a4a37282ae..d6a35ffa20 100644 --- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -120,10 +120,10 @@ static uint32_t _game_saveload_strings; class SlGameLanguageString : public DefaultSaveLoadHandler { 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 { diff --git a/src/saveload/gamelog_sl.cpp b/src/saveload/gamelog_sl.cpp index fe85af5727..c0c904ae6a 100644 --- a/src/saveload/gamelog_sl.cpp +++ b/src/saveload/gamelog_sl.cpp @@ -21,11 +21,11 @@ class SlGamelogMode : public DefaultSaveLoadHandler { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 MakeLoggedChange(GamelogChangeType type) class SlGamelogAction : public DefaultSaveLoadHandler { 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 { diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp index 43441c110d..750a729136 100644 --- a/src/saveload/industry_sl.cpp +++ b/src/saveload/industry_sl.cpp @@ -21,12 +21,12 @@ static OldPersistentStorage _old_ind_persistent_storage; class SlIndustryAccepted : public VectorSaveLoadHandler { 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 &GetVector(Industry *i) const override { return i->accepted; } @@ -45,11 +45,11 @@ public: class SlIndustryProducedHistory : public DefaultSaveLoadHandler { 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 { 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 &GetVector(Industry *i) const override { return i->produced; } diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp index 793eaa1298..00533f4afc 100644 --- a/src/saveload/linkgraph_sl.cpp +++ b/src/saveload/linkgraph_sl.cpp @@ -30,7 +30,7 @@ static NodeID _linkgraph_from; ///< Contains the current "from" node being saved class SlLinkgraphEdge : public DefaultSaveLoadHandler { 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 { 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 { 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 { diff --git a/src/saveload/order_sl.cpp b/src/saveload/order_sl.cpp index 6e3c20e1a3..2e1ecaea76 100644 --- a/src/saveload/order_sl.cpp +++ b/src/saveload/order_sl.cpp @@ -214,7 +214,7 @@ struct ORDRChunkHandler : ChunkHandler { template class SlOrders : public VectorSaveLoadHandler, 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 &GetVector(T *container) const override { return container->orders; } diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 7d3690d112..901c939dde 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -208,12 +208,12 @@ static void SwapPackets(GoodsEntry *ge) template class SlStationSpecList : public VectorSaveLoadHandler, BaseStation, SpecMapping> { public: - inline static const SaveLoad description[] = { + static inline const SaveLoad description[] = { SLE_CONDVAR(SpecMapping, grfid, SLE_UINT32, SLV_27, SL_MAX_VERSION), SLE_CONDVAR(SpecMapping, localidx, SLE_FILE_U8 | SLE_VAR_U16, SLV_27, SLV_EXTEND_ENTITY_MAPPING), SLE_CONDVAR(SpecMapping, 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; class SlStationCargo : public DefaultSaveLoadHandler { 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 { 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 { 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 &GetVector(BaseStation *bst) const override { return bst->custom_roadstop_tile_data; } }; @@ -550,7 +550,7 @@ public: */ class SlStationBase : public DefaultSaveLoadHandler { 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::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 { 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 { 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 { diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index c446b18cea..fdf92738a6 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -114,13 +114,13 @@ void UpdateHousesAndTowns() class SlTownSupplied : public DefaultSaveLoadHandler { public: - inline static const SaveLoad description[] = { + static inline const SaveLoad description[] = { SLE_CONDVAR(TransportedCargoStat, old_max, SLE_UINT32, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, new_max, SLE_UINT32, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, old_act, SLE_UINT32, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, 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 { public: - inline static const SaveLoad description[] = { + static inline const SaveLoad description[] = { SLE_CONDVAR(TransportedCargoStat, old_max, SLE_UINT16, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, new_max, SLE_UINT16, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, old_act, SLE_UINT16, SLV_165, SL_MAX_VERSION), SLE_CONDVAR(TransportedCargoStat, 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 { diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index e9e6033911..f3b4fcaa57 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -644,7 +644,7 @@ static Money _cargo_feeder_share; class SlVehicleCommon : public DefaultSaveLoadHandler { 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 { 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 { 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 &GetVector(RoadVehicle *rv) const override { return rv->path; } }; @@ -845,7 +845,7 @@ public: static inline std::vector rv_path_td; static inline std::vector 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 { 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 &GetVector(Ship *s) const override { return s->path; } }; @@ -916,14 +916,14 @@ class SlVehicleShip : public DefaultSaveLoadHandler { public: static inline std::vector 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 { 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 { 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 { 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), diff --git a/src/settings.cpp b/src/settings.cpp index 1be8716ef9..9efb21a057 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -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",