Codechange: rename byte to uint8_t (#12308)

This commit is contained in:
Patric Stout
2024-03-16 23:59:32 +01:00
committed by GitHub
parent bd7120bae4
commit a3cfd23cf9
355 changed files with 1654 additions and 1656 deletions

View File

@@ -19,7 +19,7 @@
#include "tilearea_type.h"
/** Copy from station_map.h */
typedef byte StationGfx;
typedef uint8_t StationGfx;
/** Tile-offset / AirportTileID pair. */
struct AirportTileTable {
@@ -91,7 +91,7 @@ enum TTDPAirportType {
struct HangarTileTable {
TileIndexDiffC ti; ///< Tile offset from the top-most airport tile.
Direction dir; ///< Direction of the exit.
byte hangar_num; ///< The hangar to which this tile belongs.
uint8_t hangar_num; ///< The hangar to which this tile belongs.
};
/**
@@ -101,13 +101,13 @@ struct AirportSpec {
const struct AirportFTAClass *fsm; ///< the finite statemachine for the default airports
const AirportTileTable * const *table; ///< list of the tiles composing the airport
const Direction *rotation; ///< the rotation of each tiletable
byte num_table; ///< number of elements in the table
uint8_t num_table; ///< number of elements in the table
const HangarTileTable *depot_table; ///< gives the position of the depots on the airports
byte nof_depots; ///< the number of hangar tiles in this airport
byte size_x; ///< size of airport in x direction
byte size_y; ///< size of airport in y direction
byte noise_level; ///< noise that this airport generates
byte catchment; ///< catchment area of this airport
uint8_t nof_depots; ///< the number of hangar tiles in this airport
uint8_t size_x; ///< size of airport in x direction
uint8_t size_y; ///< size of airport in y direction
uint8_t noise_level; ///< noise that this airport generates
uint8_t catchment; ///< catchment area of this airport
TimerGameCalendar::Year min_year; ///< first year the airport is available
TimerGameCalendar::Year max_year; ///< last year the airport is available
StringID name; ///< name of this airport
@@ -119,19 +119,19 @@ struct AirportSpec {
bool enabled; ///< Entity still available (by default true). Newgrf can disable it, though.
struct GRFFileProps grf_prop; ///< Properties related to the grf file.
static const AirportSpec *Get(byte type);
static AirportSpec *GetWithoutOverride(byte type);
static const AirportSpec *Get(uint8_t type);
static AirportSpec *GetWithoutOverride(uint8_t type);
bool IsAvailable() const;
bool IsWithinMapBounds(byte table, TileIndex index) const;
bool IsWithinMapBounds(uint8_t table, TileIndex index) const;
static void ResetAirports();
/** Get the index of this spec. */
byte GetIndex() const
uint8_t GetIndex() const
{
assert(this >= specs && this < endof(specs));
return (byte)(this - specs);
return (uint8_t)(this - specs);
}
static const AirportSpec dummy; ///< The dummy airport.
@@ -148,8 +148,8 @@ void BindAirportSpecs();
/** Resolver for the airport scope. */
struct AirportScopeResolver : public ScopeResolver {
struct Station *st; ///< Station of the airport for which the callback is run, or \c nullptr for build gui.
byte airport_id; ///< Type of airport for which the callback is run.
byte layout; ///< Layout of the airport to build.
uint8_t airport_id; ///< Type of airport for which the callback is run.
uint8_t layout; ///< Layout of the airport to build.
TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks.
/**
@@ -160,13 +160,13 @@ struct AirportScopeResolver : public ScopeResolver {
* @param airport_id Type of airport for which the callback is run.
* @param layout Layout of the airport to build.
*/
AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout)
AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, uint8_t airport_id, uint8_t layout)
: ScopeResolver(ro), st(st), airport_id(airport_id), layout(layout), tile(tile)
{
}
uint32_t GetRandomBits() const override;
uint32_t GetVariable(byte variable, [[maybe_unused]] uint32_t parameter, bool *available) const override;
uint32_t GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool *available) const override;
void StorePSA(uint pos, int32_t value) override;
};
@@ -176,12 +176,12 @@ struct AirportResolverObject : public ResolverObject {
AirportScopeResolver airport_scope;
std::unique_ptr<TownScopeResolver> town_scope; ///< The town scope resolver (created on the first call).
AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout,
AirportResolverObject(TileIndex tile, Station *st, uint8_t airport_id, uint8_t layout,
CallbackID callback = CBID_NO_CALLBACK, uint32_t callback_param1 = 0, uint32_t callback_param2 = 0);
TownScopeResolver *GetTown();
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, uint8_t relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->airport_scope;
@@ -199,6 +199,6 @@ struct AirportResolverObject : public ResolverObject {
uint32_t GetDebugID() const override;
};
StringID GetAirportTextCallback(const AirportSpec *as, byte layout, uint16_t callback);
StringID GetAirportTextCallback(const AirportSpec *as, uint8_t layout, uint16_t callback);
#endif /* NEWGRF_AIRPORT_H */