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:
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
extern uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile);
|
||||
extern uint32_t GetRelativePosition(TileIndex tile, TileIndex ind_tile);
|
||||
|
||||
AirportTileSpec AirportTileSpec::tiles[NUM_AIRPORTTILES];
|
||||
|
||||
@@ -107,7 +107,7 @@ StationGfx GetTranslatedAirportTileID(StationGfx gfx)
|
||||
* @param grf_version8 True, if we are dealing with a new NewGRF which uses GRF version >= 8.
|
||||
* @return a construction of bits obeying the newgrf format
|
||||
*/
|
||||
static uint32 GetNearbyAirportTileInformation(byte parameter, TileIndex tile, StationID index, bool grf_version8)
|
||||
static uint32_t GetNearbyAirportTileInformation(byte parameter, TileIndex tile, StationID index, bool grf_version8)
|
||||
{
|
||||
if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required
|
||||
bool is_same_airport = (IsTileType(tile, MP_STATION) && IsAirport(tile) && GetStationIndex(tile) == index);
|
||||
@@ -124,7 +124,7 @@ static uint32 GetNearbyAirportTileInformation(byte parameter, TileIndex tile, St
|
||||
* @param cur_grfid GRFID of the current callback
|
||||
* @return value encoded as per NFO specs
|
||||
*/
|
||||
static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32 cur_grfid)
|
||||
static uint32_t GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32_t cur_grfid)
|
||||
{
|
||||
if (!st->TileBelongsToAirport(tile)) {
|
||||
return 0xFFFF;
|
||||
@@ -159,7 +159,7 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32
|
||||
return 0xFF << 8 | ats->grf_prop.subst_id; // so just give it the substitute
|
||||
}
|
||||
|
||||
/* virtual */ uint32 AirportTileScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const
|
||||
/* virtual */ uint32_t AirportTileScopeResolver::GetVariable(byte variable, uint32_t parameter, bool *available) const
|
||||
{
|
||||
assert(this->st != nullptr);
|
||||
|
||||
@@ -198,7 +198,7 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
/* virtual */ uint32 AirportTileScopeResolver::GetRandomBits() const
|
||||
/* virtual */ uint32_t AirportTileScopeResolver::GetRandomBits() const
|
||||
{
|
||||
return (this->st == nullptr ? 0 : this->st->random_bits) | (this->tile == INVALID_TILE ? 0 : GetStationTileRandomBits(this->tile) << 16);
|
||||
}
|
||||
@@ -213,7 +213,7 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32
|
||||
* @param callback_param2 Second parameter (var 18) of the callback.
|
||||
*/
|
||||
AirportTileResolverObject::AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st,
|
||||
CallbackID callback, uint32 callback_param1, uint32 callback_param2)
|
||||
CallbackID callback, uint32_t callback_param1, uint32_t callback_param2)
|
||||
: ResolverObject(ats->grf_prop.grffile, callback, callback_param1, callback_param2), tiles_scope(*this, ats, tile, st)
|
||||
{
|
||||
this->root_spritegroup = ats->grf_prop.spritegroup[0];
|
||||
@@ -224,12 +224,12 @@ GrfSpecFeature AirportTileResolverObject::GetFeature() const
|
||||
return GSF_AIRPORTTILES;
|
||||
}
|
||||
|
||||
uint32 AirportTileResolverObject::GetDebugID() const
|
||||
uint32_t AirportTileResolverObject::GetDebugID() const
|
||||
{
|
||||
return this->tiles_scope.ats->grf_prop.local_id;
|
||||
}
|
||||
|
||||
uint16 GetAirportTileCallback(CallbackID callback, uint32 param1, uint32 param2, const AirportTileSpec *ats, Station *st, TileIndex tile, int extra_data = 0)
|
||||
uint16_t GetAirportTileCallback(CallbackID callback, uint32_t param1, uint32_t param2, const AirportTileSpec *ats, Station *st, TileIndex tile, int extra_data = 0)
|
||||
{
|
||||
AirportTileResolverObject object(ats, tile, st, callback, param1, param2);
|
||||
return object.ResolveCallback();
|
||||
@@ -259,7 +259,7 @@ bool DrawNewAirportTile(TileInfo *ti, Station *st, StationGfx gfx, const Airport
|
||||
bool draw_old_one = true;
|
||||
if (HasBit(airts->callback_mask, CBM_AIRT_DRAW_FOUNDATIONS)) {
|
||||
/* Called to determine the type (if any) of foundation to draw */
|
||||
uint32 callback_res = GetAirportTileCallback(CBID_AIRPTILE_DRAW_FOUNDATIONS, 0, 0, airts, st, ti->tile);
|
||||
uint32_t callback_res = GetAirportTileCallback(CBID_AIRPTILE_DRAW_FOUNDATIONS, 0, 0, airts, st, ti->tile);
|
||||
if (callback_res != CALLBACK_FAILED) draw_old_one = ConvertBooleanCallback(airts->grf_prop.grffile, CBID_AIRPTILE_DRAW_FOUNDATIONS, callback_res);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ void AirportTileAnimationTrigger(Station *st, TileIndex tile, AirpAnimationTrigg
|
||||
const AirportTileSpec *ats = AirportTileSpec::GetByTile(tile);
|
||||
if (!HasBit(ats->animation.triggers, trigger)) return;
|
||||
|
||||
AirportTileAnimationBase::ChangeAnimationFrame(CBID_AIRPTILE_ANIM_START_STOP, ats, st, tile, Random(), (uint8)trigger | (cargo_type << 8));
|
||||
AirportTileAnimationBase::ChangeAnimationFrame(CBID_AIRPTILE_ANIM_START_STOP, ats, st, tile, Random(), (uint8_t)trigger | (cargo_type << 8));
|
||||
}
|
||||
|
||||
void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID cargo_type)
|
||||
|
||||
Reference in New Issue
Block a user