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:
@@ -148,7 +148,7 @@ static uint NPFHash(uint key1, uint key2)
|
||||
return ((part1 << NPF_HASH_HALFBITS | part2) + (NPF_HASH_SIZE * key2 / TRACKDIR_END)) % NPF_HASH_SIZE;
|
||||
}
|
||||
|
||||
static int32 NPFCalcZero(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
static int32_t NPFCalcZero(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ static int32 NPFCalcZero(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
/* Calculates the heuristic to the target station or tile. For train stations, it
|
||||
* takes into account the direction of approach.
|
||||
*/
|
||||
static int32 NPFCalcStationOrTileHeuristic(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
static int32_t NPFCalcStationOrTileHeuristic(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
{
|
||||
NPFFindStationOrTileData *fstd = (NPFFindStationOrTileData*)as->user_target;
|
||||
NPFFoundTargetData *ftd = (NPFFoundTargetData*)as->user_path;
|
||||
@@ -312,9 +312,9 @@ static Vehicle *CountShipProc(Vehicle *v, void *data)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
static int32_t NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
{
|
||||
int32 cost = 0;
|
||||
int32_t cost = 0;
|
||||
Trackdir trackdir = current->direction;
|
||||
|
||||
cost = _trackdir_length[trackdir]; // Should be different for diagonal tracks
|
||||
@@ -340,10 +340,10 @@ static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *par
|
||||
}
|
||||
|
||||
/* Determine the cost of this node, for road tracks */
|
||||
static int32 NPFRoadPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
static int32_t NPFRoadPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
{
|
||||
TileIndex tile = current->tile;
|
||||
int32 cost = 0;
|
||||
int32_t cost = 0;
|
||||
|
||||
/* Determine base length */
|
||||
switch (GetTileType(tile)) {
|
||||
@@ -399,11 +399,11 @@ static int32 NPFRoadPathCost(AyStar *as, AyStarNode *current, OpenListNode *pare
|
||||
|
||||
|
||||
/* Determine the cost of this node, for railway tracks */
|
||||
static int32 NPFRailPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
static int32_t NPFRailPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
{
|
||||
TileIndex tile = current->tile;
|
||||
Trackdir trackdir = current->direction;
|
||||
int32 cost = 0;
|
||||
int32_t cost = 0;
|
||||
/* HACK: We create a OpenListNode manually, so we can call EndNodeCheck */
|
||||
OpenListNode new_node;
|
||||
|
||||
@@ -550,7 +550,7 @@ static int32 NPFRailPathCost(AyStar *as, AyStarNode *current, OpenListNode *pare
|
||||
}
|
||||
|
||||
/* Will find any depot */
|
||||
static int32 NPFFindDepot(const AyStar *as, const OpenListNode *current)
|
||||
static int32_t NPFFindDepot(const AyStar *as, const OpenListNode *current)
|
||||
{
|
||||
AyStarUserData *user = (AyStarUserData *)as->user_data;
|
||||
/* It's not worth caching the result with NPF_FLAG_IS_TARGET here as below,
|
||||
@@ -560,7 +560,7 @@ static int32 NPFFindDepot(const AyStar *as, const OpenListNode *current)
|
||||
}
|
||||
|
||||
/** Find any safe and free tile. */
|
||||
static int32 NPFFindSafeTile(const AyStar *as, const OpenListNode *current)
|
||||
static int32_t NPFFindSafeTile(const AyStar *as, const OpenListNode *current)
|
||||
{
|
||||
const Train *v = Train::From(((NPFFindStationOrTileData *)as->user_target)->v);
|
||||
|
||||
@@ -570,7 +570,7 @@ static int32 NPFFindSafeTile(const AyStar *as, const OpenListNode *current)
|
||||
}
|
||||
|
||||
/* Will find a station identified using the NPFFindStationOrTileData */
|
||||
static int32 NPFFindStationOrTile(const AyStar *as, const OpenListNode *current)
|
||||
static int32_t NPFFindStationOrTile(const AyStar *as, const OpenListNode *current)
|
||||
{
|
||||
NPFFindStationOrTileData *fstd = (NPFFindStationOrTileData*)as->user_target;
|
||||
const AyStarNode *node = ¤t->path.node;
|
||||
|
||||
Reference in New Issue
Block a user