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:
@@ -31,7 +31,7 @@ enum PersistentStorageMode {
|
||||
* so we have a generalised access to the virtual methods.
|
||||
*/
|
||||
struct BasePersistentStorageArray {
|
||||
uint32 grfid; ///< GRFID associated to this persistent storage. A value of zero means "default".
|
||||
uint32_t grfid; ///< GRFID associated to this persistent storage. A value of zero means "default".
|
||||
byte feature; ///< NOSAVE: Used to identify in the owner of the array in debug output.
|
||||
TileIndex tile; ///< NOSAVE: Used to identify in the owner of the array in debug output.
|
||||
|
||||
@@ -93,7 +93,7 @@ struct PersistentStorageArray : BasePersistentStorageArray {
|
||||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void StoreValue(uint pos, int32 value)
|
||||
void StoreValue(uint pos, int32_t value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
@@ -150,8 +150,8 @@ struct PersistentStorageArray : BasePersistentStorageArray {
|
||||
template <typename TYPE, uint SIZE>
|
||||
struct TemporaryStorageArray {
|
||||
TYPE storage[SIZE]; ///< Memory to for the storage array
|
||||
uint16 init[SIZE]; ///< Storage has been assigned, if this equals 'init_key'.
|
||||
uint16 init_key; ///< Magic key to 'init'.
|
||||
uint16_t init[SIZE]; ///< Storage has been assigned, if this equals 'init_key'.
|
||||
uint16_t init_key; ///< Magic key to 'init'.
|
||||
|
||||
/** Simply construct the array */
|
||||
TemporaryStorageArray()
|
||||
@@ -166,7 +166,7 @@ struct TemporaryStorageArray {
|
||||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void StoreValue(uint pos, int32 value)
|
||||
void StoreValue(uint pos, int32_t value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
@@ -207,9 +207,9 @@ struct TemporaryStorageArray {
|
||||
|
||||
void AddChangedPersistentStorage(BasePersistentStorageArray *storage);
|
||||
|
||||
typedef PersistentStorageArray<int32, 16> OldPersistentStorage;
|
||||
typedef PersistentStorageArray<int32_t, 16> OldPersistentStorage;
|
||||
|
||||
typedef uint32 PersistentStorageID;
|
||||
typedef uint32_t PersistentStorageID;
|
||||
|
||||
struct PersistentStorage;
|
||||
typedef Pool<PersistentStorage, PersistentStorageID, 1, 0xFF000> PersistentStoragePool;
|
||||
@@ -219,9 +219,9 @@ extern PersistentStoragePool _persistent_storage_pool;
|
||||
/**
|
||||
* Class for pooled persistent storage of data.
|
||||
*/
|
||||
struct PersistentStorage : PersistentStorageArray<int32, 256>, PersistentStoragePool::PoolItem<&_persistent_storage_pool> {
|
||||
struct PersistentStorage : PersistentStorageArray<int32_t, 256>, PersistentStoragePool::PoolItem<&_persistent_storage_pool> {
|
||||
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
|
||||
PersistentStorage(const uint32 new_grfid, byte feature, TileIndex tile)
|
||||
PersistentStorage(const uint32_t new_grfid, byte feature, TileIndex tile)
|
||||
{
|
||||
this->grfid = new_grfid;
|
||||
this->feature = feature;
|
||||
|
Reference in New Issue
Block a user