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:
@@ -17,13 +17,13 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/* virtual */ uint32 RoadTypeScopeResolver::GetRandomBits() const
|
||||
/* virtual */ uint32_t RoadTypeScopeResolver::GetRandomBits() const
|
||||
{
|
||||
uint tmp = CountBits(static_cast<uint32>(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE));
|
||||
uint tmp = CountBits(static_cast<uint32_t>(this->tile + (TileX(this->tile) + TileY(this->tile)) * TILE_SIZE));
|
||||
return GB(tmp, 0, 2);
|
||||
}
|
||||
|
||||
/* virtual */ uint32 RoadTypeScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const
|
||||
/* virtual */ uint32_t RoadTypeScopeResolver::GetVariable(byte variable, uint32_t parameter, bool *available) const
|
||||
{
|
||||
if (this->tile == INVALID_TILE) {
|
||||
switch (variable) {
|
||||
@@ -69,7 +69,7 @@ GrfSpecFeature RoadTypeResolverObject::GetFeature() const
|
||||
}
|
||||
}
|
||||
|
||||
uint32 RoadTypeResolverObject::GetDebugID() const
|
||||
uint32_t RoadTypeResolverObject::GetDebugID() const
|
||||
{
|
||||
return this->roadtype_scope.rti->label;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ uint32 RoadTypeResolverObject::GetDebugID() const
|
||||
* @param param1 Extra parameter (first parameter of the callback, except roadtypes do not have callbacks).
|
||||
* @param param2 Extra parameter (second parameter of the callback, except roadtypes do not have callbacks).
|
||||
*/
|
||||
RoadTypeResolverObject::RoadTypeResolverObject(const RoadTypeInfo *rti, TileIndex tile, TileContext context, RoadTypeSpriteGroup rtsg, uint32 param1, uint32 param2)
|
||||
RoadTypeResolverObject::RoadTypeResolverObject(const RoadTypeInfo *rti, TileIndex tile, TileContext context, RoadTypeSpriteGroup rtsg, uint32_t param1, uint32_t param2)
|
||||
: ResolverObject(rti != nullptr ? rti->grffile[rtsg] : nullptr, CBID_NO_CALLBACK, param1, param2), roadtype_scope(*this, rti, tile, context)
|
||||
{
|
||||
this->root_spritegroup = rti != nullptr ? rti->group[rtsg] : nullptr;
|
||||
@@ -120,7 +120,7 @@ SpriteID GetCustomRoadSprite(const RoadTypeInfo *rti, TileIndex tile, RoadTypeSp
|
||||
* @param grffile Originating GRF file.
|
||||
* @return RoadType or INVALID_ROADTYPE if the roadtype is unknown.
|
||||
*/
|
||||
RoadType GetRoadTypeTranslation(RoadTramType rtt, uint8 tracktype, const GRFFile *grffile)
|
||||
RoadType GetRoadTypeTranslation(RoadTramType rtt, uint8_t tracktype, const GRFFile *grffile)
|
||||
{
|
||||
/* Because OpenTTD mixes RoadTypes and TramTypes into the same type,
|
||||
* the mapping of the original road- and tramtypes does not match the default GRF-local mapping.
|
||||
@@ -150,7 +150,7 @@ RoadType GetRoadTypeTranslation(RoadTramType rtt, uint8 tracktype, const GRFFile
|
||||
* @param grffile The GRF to do the lookup for.
|
||||
* @return the GRF internal ID.
|
||||
*/
|
||||
uint8 GetReverseRoadTypeTranslation(RoadType roadtype, const GRFFile *grffile)
|
||||
uint8_t GetReverseRoadTypeTranslation(RoadType roadtype, const GRFFile *grffile)
|
||||
{
|
||||
/* No road type table present, return road type as-is */
|
||||
if (grffile == nullptr) return roadtype;
|
||||
|
Reference in New Issue
Block a user