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:
@@ -54,7 +54,7 @@
|
||||
#include "safeguards.h"
|
||||
|
||||
/** Delay counter for considering the next disaster. */
|
||||
uint16 _disaster_delay;
|
||||
uint16_t _disaster_delay;
|
||||
|
||||
static void DisasterClearSquare(TileIndex tile)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ static bool DisasterTick_Zeppeliner(DisasterVehicle *v)
|
||||
v->image_override = SPR_BLIMP_CRASHED;
|
||||
} else if (v->age <= 300) {
|
||||
if (GB(v->tick_counter, 0, 3) == 0) {
|
||||
uint32 r = Random();
|
||||
uint32_t r = Random();
|
||||
|
||||
CreateEffectVehicleRel(v,
|
||||
GB(r, 0, 4) - 7,
|
||||
@@ -422,7 +422,7 @@ static void DestructIndustry(Industry *i)
|
||||
* @param news_message The string that's used as news message.
|
||||
* @param industry_flag Only attack industries that have this flag set.
|
||||
*/
|
||||
static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16 image_override, bool leave_at_top, StringID news_message, IndustryBehaviour industry_flag)
|
||||
static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16_t image_override, bool leave_at_top, StringID news_message, IndustryBehaviour industry_flag)
|
||||
{
|
||||
v->tick_counter++;
|
||||
v->image_override = (v->state == 1 && HasBit(v->tick_counter, 2)) ? image_override : 0;
|
||||
@@ -440,7 +440,7 @@ static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16 image_override, boo
|
||||
Industry *i = Industry::Get(v->dest_tile); // Industry destructor calls ReleaseDisastersTargetingIndustry, so this is valid
|
||||
int x = TileX(i->location.tile) * TILE_SIZE;
|
||||
int y = TileY(i->location.tile) * TILE_SIZE;
|
||||
uint32 r = Random();
|
||||
uint32_t r = Random();
|
||||
|
||||
CreateEffectVehicleAbove(
|
||||
GB(r, 0, 6) + x,
|
||||
@@ -640,7 +640,7 @@ static bool DisasterTick_Big_Ufo_Destroyer(DisasterVehicle *v)
|
||||
delete u;
|
||||
|
||||
for (int i = 0; i != 80; i++) {
|
||||
uint32 r = Random();
|
||||
uint32_t r = Random();
|
||||
CreateEffectVehicleAbove(
|
||||
GB(r, 0, 6) + v->x_pos - 32,
|
||||
GB(r, 5, 6) + v->y_pos - 32,
|
||||
@@ -838,7 +838,7 @@ static void Disaster_Submarine_Init(DisasterSubType subtype)
|
||||
|
||||
int y;
|
||||
Direction dir;
|
||||
uint32 r = Random();
|
||||
uint32_t r = Random();
|
||||
int x = TileX(r) * TILE_SIZE + TILE_SIZE / 2;
|
||||
|
||||
if (HasBit(r, 31)) {
|
||||
@@ -961,7 +961,7 @@ void ReleaseDisastersTargetingIndustry(IndustryID i)
|
||||
/* primary disaster vehicles that have chosen target */
|
||||
if (v->subtype == ST_AIRPLANE || v->subtype == ST_HELICOPTER) {
|
||||
/* if it has chosen target, and it is this industry (yes, dest_tile is IndustryID here), set order to "leaving map peacefully" */
|
||||
if (v->state > 0 && v->dest_tile == (uint32)i) v->state = 3;
|
||||
if (v->state > 0 && v->dest_tile == (uint32_t)i) v->state = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user