Codechange: replace static inline with static for non-class functions

This commit is contained in:
Rubidium
2024-01-06 12:19:27 +01:00
committed by rubidium42
parent 06a5fa6239
commit 3a676a5af0
87 changed files with 697 additions and 697 deletions

View File

@@ -100,13 +100,13 @@ bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks);
bool LoadTTDMain(LoadgameState *ls);
bool LoadTTOMain(LoadgameState *ls);
static inline uint16_t ReadUint16(LoadgameState *ls)
inline uint16_t ReadUint16(LoadgameState *ls)
{
byte x = ReadByte(ls);
return x | ReadByte(ls) << 8;
}
static inline uint32_t ReadUint32(LoadgameState *ls)
inline uint32_t ReadUint32(LoadgameState *ls)
{
uint16_t x = ReadUint16(ls);
return x | ReadUint16(ls) << 16;

View File

@@ -716,7 +716,7 @@ struct SaveLoadCompat {
* @param type VarType holding information about the variable-type
* @return the SLE_VAR_* part of a variable-type description
*/
static inline constexpr VarType GetVarMemType(VarType type)
inline constexpr VarType GetVarMemType(VarType type)
{
return GB(type, 4, 4) << 4;
}
@@ -727,7 +727,7 @@ static inline constexpr VarType GetVarMemType(VarType type)
* @param type VarType holding information about the file-type
* @return the SLE_FILE_* part of a variable-type description
*/
static inline constexpr VarType GetVarFileType(VarType type)
inline constexpr VarType GetVarFileType(VarType type)
{
return GB(type, 0, 4);
}
@@ -737,7 +737,7 @@ static inline constexpr VarType GetVarFileType(VarType type)
* @param conv the type to check
* @return True if it's a numeric type.
*/
static inline constexpr bool IsNumericType(VarType conv)
inline constexpr bool IsNumericType(VarType conv)
{
return GetVarMemType(conv) <= SLE_VAR_U64;
}
@@ -747,7 +747,7 @@ static inline constexpr bool IsNumericType(VarType conv)
* @param type VarType to get size of.
* @return size of type in bytes.
*/
static inline constexpr size_t SlVarSize(VarType type)
inline constexpr size_t SlVarSize(VarType type)
{
switch (GetVarMemType(type)) {
case SLE_VAR_BL: return sizeof(bool);
@@ -775,7 +775,7 @@ static inline constexpr size_t SlVarSize(VarType type)
* @param size Actual size of variable.
* @return true iff the sizes match.
*/
static inline constexpr bool SlCheckVarSize(SaveLoadType cmd, VarType type, size_t length, size_t size)
inline constexpr bool SlCheckVarSize(SaveLoadType cmd, VarType type, size_t length, size_t size)
{
switch (cmd) {
case SL_VAR: return SlVarSize(type) == size;
@@ -1191,7 +1191,7 @@ static inline constexpr bool SlCheckVarSize(SaveLoadType cmd, VarType type, size
* @param minor Minor number of the version to check against. If \a minor is 0 or not specified, only the major number is checked.
* @return Savegame version is earlier than the specified version.
*/
static inline bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor = 0)
inline bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor = 0)
{
extern SaveLoadVersion _sl_version;
extern byte _sl_minor_version;
@@ -1205,7 +1205,7 @@ static inline bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor = 0
* @param major Major number of the version to check against.
* @return Savegame version is at most the specified version.
*/
static inline bool IsSavegameVersionBeforeOrAt(SaveLoadVersion major)
inline bool IsSavegameVersionBeforeOrAt(SaveLoadVersion major)
{
extern SaveLoadVersion _sl_version;
return _sl_version <= major;
@@ -1218,7 +1218,7 @@ static inline bool IsSavegameVersionBeforeOrAt(SaveLoadVersion major)
* @param version_to Exclusive savegame version upper bound. SL_MAX_VERSION if no upper bound.
* @return Active savegame version falls within the given range.
*/
static inline bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLoadVersion version_to)
inline bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLoadVersion version_to)
{
extern const SaveLoadVersion SAVEGAME_VERSION;
return version_from <= SAVEGAME_VERSION && SAVEGAME_VERSION < version_to;
@@ -1229,7 +1229,7 @@ static inline bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLo
* everything else has a callback function that returns the address based
* on the saveload data and the current object for non-globals.
*/
static inline void *GetVariableAddress(const void *object, const SaveLoad &sld)
inline void *GetVariableAddress(const void *object, const SaveLoad &sld)
{
/* Entry is a null-variable, mostly used to read old savegames etc. */
if (GetVarMemType(sld.conv) == SLE_VAR_NULL) {
@@ -1273,7 +1273,7 @@ bool SaveloadCrashWithMissingNewGRFs();
* anything with them, discarding them in effect
* @param length The amount of bytes that is being treated this way
*/
static inline void SlSkipBytes(size_t length)
inline void SlSkipBytes(size_t length)
{
for (; length != 0; length--) SlReadByte();
}

View File

@@ -26,7 +26,7 @@ void NORETURN SlErrorCorrupt(const std::string &msg);
* break out of all the saveload code.
*/
template <typename T, typename ... Args>
static inline void NORETURN SlErrorCorruptFmt(const T &format, Args&&... fmt_args)
inline void NORETURN SlErrorCorruptFmt(const T &format, Args&&... fmt_args)
{
SlErrorCorrupt(fmt::format(format, fmt_args...));
}