Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
*
|
||||
* Note that this list must not be reordered.
|
||||
*/
|
||||
enum SaveLoadVersion : uint16 {
|
||||
enum SaveLoadVersion : uint16_t {
|
||||
SL_MIN_VERSION, ///< First savegame version
|
||||
|
||||
SLV_1, ///< 1.0 0.1.x, 0.2.x
|
||||
@@ -282,7 +282,7 @@ enum SaveLoadVersion : uint16 {
|
||||
SLV_198, ///< 198 PR#6763 Switch town growth rate and counter to actual game ticks
|
||||
SLV_EXTEND_CARGOTYPES, ///< 199 PR#6802 Extend cargotypes to 64
|
||||
|
||||
SLV_EXTEND_RAILTYPES, ///< 200 PR#6805 Extend railtypes to 64, adding uint16 to map array.
|
||||
SLV_EXTEND_RAILTYPES, ///< 200 PR#6805 Extend railtypes to 64, adding uint16_t to map array.
|
||||
SLV_EXTEND_PERSISTENT_STORAGE, ///< 201 PR#6885 Extend NewGRF persistent storages.
|
||||
SLV_EXTEND_INDUSTRY_CARGO_SLOTS, ///< 202 PR#6867 Increase industry cargo slots to 16 in, 16 out
|
||||
SLV_SHIP_PATH_CACHE, ///< 203 PR#7072 Add path cache for ships
|
||||
@@ -342,7 +342,7 @@ enum SaveLoadVersion : uint16 {
|
||||
SLV_LAST_LOADING_TICK, ///< 301 PR#9693 Store tick of last loading for vehicles.
|
||||
SLV_MULTITRACK_LEVEL_CROSSINGS, ///< 302 PR#9931 v13.0 Multi-track level crossings.
|
||||
SLV_NEWGRF_ROAD_STOPS, ///< 303 PR#10144 NewGRF road stops.
|
||||
SLV_LINKGRAPH_EDGES, ///< 304 PR#10314 Explicitly store link graph edges destination, PR#10471 int64 instead of uint64 league rating
|
||||
SLV_LINKGRAPH_EDGES, ///< 304 PR#10314 Explicitly store link graph edges destination, PR#10471 int64_t instead of uint64_t league rating
|
||||
|
||||
SLV_VELOCITY_NAUTICAL, ///< 305 PR#10594 Separation of land and nautical velocity (knots!)
|
||||
SLV_CONSISTENT_PARTIAL_Z, ///< 306 PR#10570 Conversion from an inconsistent partial Z calculation for slopes, to one that is (more) consistent.
|
||||
@@ -423,10 +423,10 @@ enum ChunkType {
|
||||
|
||||
/** Handlers and description of chunk. */
|
||||
struct ChunkHandler {
|
||||
uint32 id; ///< Unique ID (4 letters).
|
||||
uint32_t id; ///< Unique ID (4 letters).
|
||||
ChunkType type; ///< Type of the chunk. @see ChunkType
|
||||
|
||||
ChunkHandler(uint32 id, ChunkType type) : id(id), type(type) {}
|
||||
ChunkHandler(uint32_t id, ChunkType type) : id(id), type(type) {}
|
||||
|
||||
virtual ~ChunkHandler() = default;
|
||||
|
||||
@@ -651,7 +651,7 @@ enum VarTypes {
|
||||
SLF_ALLOW_NEWLINE = 1 << 9, ///< Allow new lines in the strings.
|
||||
};
|
||||
|
||||
typedef uint32 VarType;
|
||||
typedef uint32_t VarType;
|
||||
|
||||
/** Type of data saved. */
|
||||
enum SaveLoadType : byte {
|
||||
@@ -678,7 +678,7 @@ struct SaveLoad {
|
||||
std::string name; ///< Name of this field (optional, used for tables).
|
||||
SaveLoadType cmd; ///< The action to take with the saved/loaded type, All types need different action.
|
||||
VarType conv; ///< Type of the variable to be saved; this field combines both FileVarType and MemVarType.
|
||||
uint16 length; ///< (Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).
|
||||
uint16_t length; ///< (Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).
|
||||
SaveLoadVersion version_from; ///< Save/load the variable starting from this savegame version.
|
||||
SaveLoadVersion version_to; ///< Save/load the variable before this savegame version.
|
||||
size_t size; ///< The sizeof size.
|
||||
@@ -697,7 +697,7 @@ struct SaveLoad {
|
||||
*/
|
||||
struct SaveLoadCompat {
|
||||
std::string name; ///< Name of the field.
|
||||
uint16 length; ///< Length of the NULL field.
|
||||
uint16_t length; ///< Length of the NULL field.
|
||||
SaveLoadVersion version_from; ///< Save/load the variable starting from this savegame version.
|
||||
SaveLoadVersion version_to; ///< Save/load the variable before this savegame version.
|
||||
};
|
||||
@@ -1176,8 +1176,8 @@ static inline void *GetVariableAddress(const void *object, const SaveLoad &sld)
|
||||
return sld.address_proc(const_cast<void *>(object), sld.extra_data);
|
||||
}
|
||||
|
||||
int64 ReadValue(const void *ptr, VarType conv);
|
||||
void WriteValue(void *ptr, VarType conv, int64 val);
|
||||
int64_t ReadValue(const void *ptr, VarType conv);
|
||||
void WriteValue(void *ptr, VarType conv, int64_t val);
|
||||
|
||||
void SlSetArrayIndex(uint index);
|
||||
int SlIterateArray();
|
||||
|
Reference in New Issue
Block a user