Codechange: rename byte to uint8_t (#12308)
This commit is contained in:
@@ -655,7 +655,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
* ~ acceleration * 77 (km-ish/h / 256)
|
||||
*/
|
||||
uint spd = v->acceleration * 77;
|
||||
byte t;
|
||||
uint8_t t;
|
||||
|
||||
/* Adjust speed limits by plane speed factor to prevent taxiing
|
||||
* and take-off speeds being too low. */
|
||||
@@ -672,7 +672,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
speed_limit = v->vcache.cached_max_speed;
|
||||
}
|
||||
|
||||
v->subspeed = (t = v->subspeed) + (byte)spd;
|
||||
v->subspeed = (t = v->subspeed) + (uint8_t)spd;
|
||||
|
||||
/* Aircraft's current speed is used twice so that very fast planes are
|
||||
* forced to slow down rapidly in the short distance needed. The magic
|
||||
@@ -699,7 +699,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
spd = v->GetOldAdvanceSpeed(spd);
|
||||
|
||||
spd += v->progress;
|
||||
v->progress = (byte)spd;
|
||||
v->progress = (uint8_t)spd;
|
||||
return spd >> 8;
|
||||
}
|
||||
|
||||
@@ -825,7 +825,7 @@ template int GetAircraftFlightLevel(Aircraft *v, bool takeoff);
|
||||
* @param rotation The rotation of the airport.
|
||||
* @return The index of the entry point
|
||||
*/
|
||||
static byte AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *apc, Direction rotation)
|
||||
static uint8_t AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *apc, Direction rotation)
|
||||
{
|
||||
assert(v != nullptr);
|
||||
assert(apc != nullptr);
|
||||
@@ -1666,7 +1666,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc)
|
||||
/* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
|
||||
* if it is an airplane, look for LANDING, for helicopter HELILANDING
|
||||
* it is possible to choose from multiple landing runways, so loop until a free one is found */
|
||||
byte landingtype = (v->subtype == AIR_HELICOPTER) ? HELILANDING : LANDING;
|
||||
uint8_t landingtype = (v->subtype == AIR_HELICOPTER) ? HELILANDING : LANDING;
|
||||
const AirportFTA *current = apc->layout[v->pos].next;
|
||||
while (current != nullptr) {
|
||||
if (current->heading == landingtype) {
|
||||
@@ -1813,8 +1813,8 @@ static bool AirportMove(Aircraft *v, const AirportFTAClass *apc)
|
||||
const AirportFTA *current = &apc->layout[v->pos];
|
||||
/* we have arrived in an important state (eg terminal, hangar, etc.) */
|
||||
if (current->heading == v->state) {
|
||||
byte prev_pos = v->pos; // location could be changed in state, so save it before-hand
|
||||
byte prev_state = v->state;
|
||||
uint8_t prev_pos = v->pos; // location could be changed in state, so save it before-hand
|
||||
uint8_t prev_state = v->state;
|
||||
_aircraft_state_handlers[v->state](v, apc);
|
||||
if (v->state != FLYING) v->previous_pos = prev_pos;
|
||||
if (v->state != prev_state || v->pos != prev_pos) UpdateAircraftCache(v);
|
||||
@@ -1950,7 +1950,7 @@ static const MovementTerminalMapping _airport_terminal_mapping[] = {
|
||||
* @param last_terminal Terminal number to stop examining.
|
||||
* @return A terminal or helipad has been found, and has been assigned to the aircraft.
|
||||
*/
|
||||
static bool FreeTerminal(Aircraft *v, byte i, byte last_terminal)
|
||||
static bool FreeTerminal(Aircraft *v, uint8_t i, uint8_t last_terminal)
|
||||
{
|
||||
assert(last_terminal <= lengthof(_airport_terminal_mapping));
|
||||
Station *st = Station::Get(v->targetairport);
|
||||
|
Reference in New Issue
Block a user