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:
Rubidium
2023-05-08 19:01:06 +02:00
committed by rubidium42
parent 4f4810dc28
commit eaae0bb5e7
564 changed files with 4561 additions and 4561 deletions

View File

@@ -2271,7 +2271,7 @@ bool AfterLoadGame()
* So taking the 16 bit fractional part into account there are plenty of bits left
* for unmodified savegames ...
*/
uint64 aimed_inflation = (_economy.old_max_loan_unround << 16 | _economy.old_max_loan_unround_fract) / _settings_game.difficulty.max_loan;
uint64_t aimed_inflation = (_economy.old_max_loan_unround << 16 | _economy.old_max_loan_unround_fract) / _settings_game.difficulty.max_loan;
/* ... well, just clamp it then. */
if (aimed_inflation > MAX_INFLATION) aimed_inflation = MAX_INFLATION;
@@ -2708,7 +2708,7 @@ bool AfterLoadGame()
_settings_game.pf.reverse_at_signals = IsSavegameVersionBefore(SLV_100) || (_settings_game.pf.wait_oneway_signal != 255 && _settings_game.pf.wait_twoway_signal != 255 && _settings_game.pf.wait_for_pbs_path != 255);
for (Train *t : Train::Iterate()) {
_settings_game.vehicle.max_train_length = std::max<uint8>(_settings_game.vehicle.max_train_length, CeilDiv(t->gcache.cached_total_length, TILE_SIZE));
_settings_game.vehicle.max_train_length = std::max<uint8_t>(_settings_game.vehicle.max_train_length, CeilDiv(t->gcache.cached_total_length, TILE_SIZE));
}
}
@@ -2851,7 +2851,7 @@ bool AfterLoadGame()
}
if (IsSavegameVersionBefore(SLV_178)) {
extern uint8 _old_diff_level;
extern uint8_t _old_diff_level;
/* Initialise script settings profile */
_settings_game.script.settings_profile = IsInsideMM(_old_diff_level, SP_BEGIN, SP_END) ? _old_diff_level : (uint)SP_MEDIUM;
}
@@ -2876,7 +2876,7 @@ bool AfterLoadGame()
if (IsSavegameVersionBefore(SLV_184)) {
/* The global units configuration is split up in multiple configurations. */
extern uint8 _old_units;
extern uint8_t _old_units;
_settings_game.locale.units_velocity = Clamp(_old_units, 0, 2);
_settings_game.locale.units_power = Clamp(_old_units, 0, 2);
_settings_game.locale.units_weight = Clamp(_old_units, 1, 2);
@@ -3134,7 +3134,7 @@ bool AfterLoadGame()
if (IsSavegameVersionBefore(SLV_GROUP_REPLACE_WAGON_REMOVAL)) {
/* Propagate wagon removal flag for compatibility */
/* Temporary bitmask of company wagon removal setting */
uint16 wagon_removal = 0;
uint16_t wagon_removal = 0;
for (const Company *c : Company::Iterate()) {
if (c->settings.renew_keep_length) SetBit(wagon_removal, c->index);
}
@@ -3151,7 +3151,7 @@ bool AfterLoadGame()
/* Use current order time to approximate last loading time */
if (IsSavegameVersionBefore(SLV_LAST_LOADING_TICK)) {
for (Vehicle *v : Vehicle::Iterate()) {
v->last_loading_tick = std::max(TimerGameTick::counter, static_cast<uint64>(v->current_order_time)) - v->current_order_time;
v->last_loading_tick = std::max(TimerGameTick::counter, static_cast<uint64_t>(v->current_order_time)) - v->current_order_time;
}
}