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:
@@ -158,21 +158,21 @@ static const SaveLoad _roadstop_desc[] = {
|
||||
SLE_REF(RoadStop, next, REF_ROADSTOPS),
|
||||
};
|
||||
|
||||
static uint16 _waiting_acceptance;
|
||||
static uint32 _old_num_flows;
|
||||
static uint16 _cargo_source;
|
||||
static uint32 _cargo_source_xy;
|
||||
static uint8 _cargo_periods;
|
||||
static uint16_t _waiting_acceptance;
|
||||
static uint32_t _old_num_flows;
|
||||
static uint16_t _cargo_source;
|
||||
static uint32_t _cargo_source_xy;
|
||||
static uint8_t _cargo_periods;
|
||||
static Money _cargo_feeder_share;
|
||||
|
||||
std::list<CargoPacket *> _packets;
|
||||
uint32 _old_num_dests;
|
||||
uint32_t _old_num_dests;
|
||||
|
||||
struct FlowSaveLoad {
|
||||
FlowSaveLoad() : source(0), via(0), share(0), restricted(false) {}
|
||||
StationID source;
|
||||
StationID via;
|
||||
uint32 share;
|
||||
uint32_t share;
|
||||
bool restricted;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
};
|
||||
inline const static SaveLoadCompatTable compat_description = _station_spec_list_sl_compat;
|
||||
|
||||
static uint8 last_num_specs; ///< Number of specs of the last loaded station.
|
||||
static uint8_t last_num_specs; ///< Number of specs of the last loaded station.
|
||||
|
||||
void Save(BaseStation *bst) const override
|
||||
{
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
|
||||
void Load(BaseStation *bst) const override
|
||||
{
|
||||
uint8 num_specs = IsSavegameVersionBefore(SLV_SAVELOAD_LIST_LENGTH) ? last_num_specs : (uint8)SlGetStructListLength(UINT8_MAX);
|
||||
uint8_t num_specs = IsSavegameVersionBefore(SLV_SAVELOAD_LIST_LENGTH) ? last_num_specs : (uint8_t)SlGetStructListLength(UINT8_MAX);
|
||||
|
||||
bst->speclist.resize(num_specs);
|
||||
for (uint i = 0; i < num_specs; i++) {
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
uint8 SlStationSpecList::last_num_specs;
|
||||
uint8_t SlStationSpecList::last_num_specs;
|
||||
|
||||
class SlRoadStopSpecList : public DefaultSaveLoadHandler<SlRoadStopSpecList, BaseStation> {
|
||||
public:
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
|
||||
void Load(BaseStation *bst) const override
|
||||
{
|
||||
uint8 num_specs = (uint8)SlGetStructListLength(UINT8_MAX);
|
||||
uint8_t num_specs = (uint8_t)SlGetStructListLength(UINT8_MAX);
|
||||
|
||||
bst->roadstop_speclist.resize(num_specs);
|
||||
for (uint i = 0; i < num_specs; i++) {
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
|
||||
for (const auto &outer_it : ge->flows) {
|
||||
const FlowStat::SharesMap *shares = outer_it.second.GetShares();
|
||||
uint32 sum_shares = 0;
|
||||
uint32_t sum_shares = 0;
|
||||
FlowSaveLoad flow;
|
||||
flow.source = outer_it.first;
|
||||
for (auto &inner_it : *shares) {
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
FlowSaveLoad flow;
|
||||
FlowStat *fs = nullptr;
|
||||
StationID prev_source = INVALID_STATION;
|
||||
for (uint32 j = 0; j < num_flows; ++j) {
|
||||
for (uint32_t j = 0; j < num_flows; ++j) {
|
||||
SlObject(&flow, this->GetLoadDescription());
|
||||
if (fs == nullptr || prev_source != flow.source) {
|
||||
fs = &(ge->flows.insert(std::make_pair(flow.source, FlowStat(flow.via, flow.share, flow.restricted))).first->second);
|
||||
@@ -563,7 +563,7 @@ public:
|
||||
};
|
||||
inline const static SaveLoadCompatTable compat_description = {};
|
||||
|
||||
static uint8 last_num_specs; ///< Number of specs of the last loaded station.
|
||||
static uint8_t last_num_specs; ///< Number of specs of the last loaded station.
|
||||
|
||||
void Save(BaseStation *bst) const override
|
||||
{
|
||||
@@ -575,7 +575,7 @@ public:
|
||||
|
||||
void Load(BaseStation *bst) const override
|
||||
{
|
||||
uint32 num_tiles = (uint32)SlGetStructListLength(UINT32_MAX);
|
||||
uint32_t num_tiles = (uint32_t)SlGetStructListLength(UINT32_MAX);
|
||||
bst->custom_roadstop_tile_data.resize(num_tiles);
|
||||
for (uint i = 0; i < num_tiles; i++) {
|
||||
SlObject(&bst->custom_roadstop_tile_data[i], this->GetLoadDescription());
|
||||
|
Reference in New Issue
Block a user