Adding of _t to (u)int types, and WChar to char32_t

See: eaae0bb5e
This commit is contained in:
Jonathan G Rennison
2024-01-07 16:41:53 +00:00
parent 55d78a23be
commit 97e6f3062e
655 changed files with 7555 additions and 7555 deletions

View File

@@ -80,8 +80,8 @@ static const uint RVC_DEPOT_STOP_FRAME = 11;
static const byte RV_OVERTAKE_TIMEOUT = 35;
/** Maximum segments of road vehicle path cache */
static const uint8 RV_PATH_CACHE_SEGMENTS = 16;
static const uint8 RV_PATH_CACHE_SEGMENT_MASK = (RV_PATH_CACHE_SEGMENTS - 1);
static const uint8_t RV_PATH_CACHE_SEGMENTS = 16;
static const uint8_t RV_PATH_CACHE_SEGMENT_MASK = (RV_PATH_CACHE_SEGMENTS - 1);
static_assert((RV_PATH_CACHE_SEGMENTS & RV_PATH_CACHE_SEGMENT_MASK) == 0, ""); // Must be a power of 2
void RoadVehUpdateCache(RoadVehicle *v, bool same_length = false);
@@ -90,12 +90,12 @@ void GetRoadVehSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs
struct RoadVehPathCache {
std::array<TileIndex, RV_PATH_CACHE_SEGMENTS> tile;
std::array<Trackdir, RV_PATH_CACHE_SEGMENTS> td;
uint32 layout_ctr = 0;
uint8 start = 0;
uint8 count = 0;
uint32_t layout_ctr = 0;
uint8_t start = 0;
uint8_t count = 0;
inline bool empty() const { return this->count == 0; }
inline uint8 size() const { return this->count; }
inline uint8_t size() const { return this->count; }
inline bool full() const { return this->count >= RV_PATH_CACHE_SEGMENTS; }
inline void clear()
@@ -107,7 +107,7 @@ struct RoadVehPathCache {
inline TileIndex front_tile() const { return this->tile[this->start]; }
inline Trackdir front_td() const { return this->td[this->start]; }
inline uint8 back_index() const { return (this->start + this->count - 1) & RV_PATH_CACHE_SEGMENT_MASK; }
inline uint8_t back_index() const { return (this->start + this->count - 1) & RV_PATH_CACHE_SEGMENT_MASK; }
inline TileIndex back_tile() const { return this->tile[this->back_index()]; }
inline Trackdir back_td() const { return this->td[this->back_index()]; }
@@ -143,18 +143,18 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
std::unique_ptr<RoadVehPathCache> cached_path; ///< Cached path.
byte state; ///< @see RoadVehicleStates
byte frame;
uint16 blocked_ctr;
uint16_t blocked_ctr;
byte overtaking; ///< Set to #RVSB_DRIVE_SIDE when overtaking, otherwise 0.
byte overtaking_ctr; ///< The length of the current overtake attempt.
uint16 crashed_ctr; ///< Animation counter when the vehicle has crashed. @see RoadVehIsCrashed
uint16_t crashed_ctr; ///< Animation counter when the vehicle has crashed. @see RoadVehIsCrashed
byte reverse_ctr;
RoadType roadtype; //!< Roadtype of this vehicle.
RoadTypes compatible_roadtypes; //!< Roadtypes this consist is powered on.
RoadType roadtype; ///< Roadtype of this vehicle.
RoadTypes compatible_roadtypes; ///< Roadtypes this consist is powered on.
byte critical_breakdown_count; ///< Counter for the number of critical breakdowns since last service
byte critical_breakdown_count; ///< Counter for the number of critical breakdowns since last service
uint8 rvflags; ///< Road vehicle flags
uint8_t rvflags; ///< Road vehicle flags
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
RoadVehicle() : GroundVehicleBase() {}
@@ -223,7 +223,7 @@ protected: // These functions should not be called outside acceleration code.
* Allows to know the power value that this vehicle will use.
* @return Power value from the engine in HP, or zero if the vehicle is not powered.
*/
inline uint16 GetPower() const
inline uint16_t GetPower() const
{
/* Power is not added for articulated parts */
if (!this->IsArticulatedPart()) {
@@ -237,7 +237,7 @@ protected: // These functions should not be called outside acceleration code.
* Returns a value if this articulated part is powered.
* @return Zero, because road vehicles don't have powered parts.
*/
inline uint16 GetPoweredPartPower(const RoadVehicle *head) const
inline uint16_t GetPoweredPartPower(const RoadVehicle *head) const
{
return 0;
}
@@ -246,9 +246,9 @@ protected: // These functions should not be called outside acceleration code.
* Allows to know the weight value that this vehicle will use (excluding cargo).
* @return Weight value from the engine in tonnes.
*/
inline uint16 GetWeightWithoutCargo() const
inline uint16_t GetWeightWithoutCargo() const
{
uint16 weight = 0;
uint16_t weight = 0;
/* Vehicle weight is not added for articulated parts. */
if (!this->IsArticulatedPart()) {
@@ -268,7 +268,7 @@ protected: // These functions should not be called outside acceleration code.
* Allows to know the weight value that this vehicle will use (cargo only).
* @return Weight value from the engine in tonnes.
*/
inline uint16 GetCargoWeight() const
inline uint16_t GetCargoWeight() const
{
return CargoSpec::Get(this->cargo_type)->WeightOfNUnits(this->cargo.StoredCount());
}
@@ -277,7 +277,7 @@ protected: // These functions should not be called outside acceleration code.
* Allows to know the weight value that this vehicle will use.
* @return Weight value from the engine in tonnes.
*/
inline uint16 GetWeight() const
inline uint16_t GetWeight() const
{
return this->GetWeightWithoutCargo() + this->GetCargoWeight();
}
@@ -286,7 +286,7 @@ protected: // These functions should not be called outside acceleration code.
* Calculates the weight value that this vehicle will have when fully loaded with its current cargo.
* @return Weight value in tonnes.
*/
uint16 GetMaxWeight() const override;
uint16_t GetMaxWeight() const override;
/**
* Allows to know the tractive effort value that this vehicle will use.
@@ -329,7 +329,7 @@ protected: // These functions should not be called outside acceleration code.
* Calculates the current speed of this vehicle.
* @return Current speed in km/h-ish.
*/
inline uint16 GetCurrentSpeed() const
inline uint16_t GetCurrentSpeed() const
{
return this->cur_speed / 2;
}
@@ -338,11 +338,11 @@ protected: // These functions should not be called outside acceleration code.
* Returns the rolling friction coefficient of this vehicle.
* @return Rolling friction coefficient in [1e-4].
*/
inline uint32 GetRollingFriction() const
inline uint32_t GetRollingFriction() const
{
/* Trams have a slightly greater friction coefficient than trains.
* The rest of road vehicles have bigger values. */
uint32 coeff = RoadTypeIsTram(this->roadtype) ? 40 : 75;
uint32_t coeff = RoadTypeIsTram(this->roadtype) ? 40 : 75;
/* The friction coefficient increases with speed in a way that
* it doubles at 128 km/h, triples at 256 km/h and so on. */
return coeff * (128 + this->GetCurrentSpeed()) / 128;
@@ -361,7 +361,7 @@ protected: // These functions should not be called outside acceleration code.
* Returns the slope steepness used by this vehicle.
* @return Slope steepness used by the vehicle.
*/
inline uint32 GetSlopeSteepness() const
inline uint32_t GetSlopeSteepness() const
{
return _settings_game.vehicle.roadveh_slope_steepness;
}
@@ -370,7 +370,7 @@ protected: // These functions should not be called outside acceleration code.
* Gets the maximum speed allowed by the track for this vehicle.
* @return Since roads don't limit road vehicle speed, it returns always zero.
*/
inline uint16 GetMaxTrackSpeed() const
inline uint16_t GetMaxTrackSpeed() const
{
return GetRoadTypeInfo(GetRoadType(this->tile, GetRoadTramType(this->roadtype)))->max_speed;
}