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:
@@ -66,17 +66,17 @@ void ClearCargoDeliveryMonitoring(CompanyID company)
|
||||
* @param keep_monitoring After returning from this call, continue monitoring.
|
||||
* @return Amount collected since last query/activation for the monitored combination.
|
||||
*/
|
||||
static int32 GetAmount(CargoMonitorMap &monitor_map, CargoMonitorID monitor, bool keep_monitoring)
|
||||
static int32_t GetAmount(CargoMonitorMap &monitor_map, CargoMonitorID monitor, bool keep_monitoring)
|
||||
{
|
||||
CargoMonitorMap::iterator iter = monitor_map.find(monitor);
|
||||
if (iter == monitor_map.end()) {
|
||||
if (keep_monitoring) {
|
||||
std::pair<CargoMonitorID, uint32> p(monitor, 0);
|
||||
std::pair<CargoMonitorID, uint32_t> p(monitor, 0);
|
||||
monitor_map.insert(p);
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
int32 result = iter->second;
|
||||
int32_t result = iter->second;
|
||||
iter->second = 0;
|
||||
if (!keep_monitoring) monitor_map.erase(iter);
|
||||
return result;
|
||||
@@ -89,7 +89,7 @@ static int32 GetAmount(CargoMonitorMap &monitor_map, CargoMonitorID monitor, boo
|
||||
* @param keep_monitoring After returning from this call, continue monitoring.
|
||||
* @return Amount of delivered cargo for the monitored combination.
|
||||
*/
|
||||
int32 GetDeliveryAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
int32_t GetDeliveryAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
{
|
||||
return GetAmount(_cargo_deliveries, monitor, keep_monitoring);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ int32 GetDeliveryAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
* @return Amount of picked up cargo for the monitored combination.
|
||||
* @note Cargo pick up is counted on final delivery, to prevent users getting credit for picking up cargo without delivering it.
|
||||
*/
|
||||
int32 GetPickupAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
int32_t GetPickupAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
{
|
||||
return GetAmount(_cargo_pickups, monitor, keep_monitoring);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ int32 GetPickupAmount(CargoMonitorID monitor, bool keep_monitoring)
|
||||
* @param st station where the cargo is delivered to.
|
||||
* @param dest industry index where the cargo is delivered to.
|
||||
*/
|
||||
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, SourceType src_type, SourceID src, const Station *st, IndustryID dest)
|
||||
void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32_t amount, SourceType src_type, SourceID src, const Station *st, IndustryID dest)
|
||||
{
|
||||
if (amount == 0) return;
|
||||
|
||||
|
Reference in New Issue
Block a user