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:
@@ -626,7 +626,7 @@ typedef GUIList<const Group*> GUIGroupList;
|
||||
/** Company livery colour scheme window. */
|
||||
struct SelectCompanyLiveryWindow : public Window {
|
||||
private:
|
||||
uint32 sel;
|
||||
uint32_t sel;
|
||||
LiveryClass livery_class;
|
||||
Dimension square;
|
||||
uint rows;
|
||||
@@ -635,9 +635,9 @@ private:
|
||||
std::vector<int> indents;
|
||||
Scrollbar *vscroll;
|
||||
|
||||
void ShowColourDropDownMenu(uint32 widget)
|
||||
void ShowColourDropDownMenu(uint32_t widget)
|
||||
{
|
||||
uint32 used_colours = 0;
|
||||
uint32_t used_colours = 0;
|
||||
const Livery *livery, *default_livery = nullptr;
|
||||
bool primary = widget == WID_SCL_PRI_COL_DROPDOWN;
|
||||
byte default_col = 0;
|
||||
@@ -1387,7 +1387,7 @@ class SelectCompanyManagerFaceWindow : public Window
|
||||
* @param val the value which will be displayed
|
||||
* @param is_bool_widget is it a bool button
|
||||
*/
|
||||
void SetFaceStringParameters(byte widget_index, uint8 val, bool is_bool_widget) const
|
||||
void SetFaceStringParameters(byte widget_index, uint8_t val, bool is_bool_widget) const
|
||||
{
|
||||
const NWidgetCore *nwi_widget = this->GetWidget<NWidgetCore>(widget_index);
|
||||
if (nwi_widget->IsDisabled()) {
|
||||
@@ -1881,14 +1881,14 @@ struct CompanyInfrastructureWindow : Window
|
||||
const Company *c = Company::Get((CompanyID)this->window_number);
|
||||
Money total;
|
||||
|
||||
uint32 rail_total = c->infrastructure.GetRailTotal();
|
||||
uint32_t rail_total = c->infrastructure.GetRailTotal();
|
||||
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
|
||||
if (HasBit(this->railtypes, rt)) total += RailMaintenanceCost(rt, c->infrastructure.rail[rt], rail_total);
|
||||
}
|
||||
total += SignalMaintenanceCost(c->infrastructure.signal);
|
||||
|
||||
uint32 road_total = c->infrastructure.GetRoadTotal();
|
||||
uint32 tram_total = c->infrastructure.GetTramTotal();
|
||||
uint32_t road_total = c->infrastructure.GetRoadTotal();
|
||||
uint32_t tram_total = c->infrastructure.GetTramTotal();
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
|
||||
if (HasBit(this->roadtypes, rt)) total += RoadMaintenanceCost(rt, c->infrastructure.road[rt], RoadTypeIsRoad(rt) ? road_total : tram_total);
|
||||
}
|
||||
@@ -1969,17 +1969,17 @@ struct CompanyInfrastructureWindow : Window
|
||||
case WID_CI_STATION_COUNT:
|
||||
case WID_CI_TOTAL: {
|
||||
/* Find the maximum count that is displayed. */
|
||||
uint32 max_val = 1000; // Some random number to reserve enough space.
|
||||
uint32_t max_val = 1000; // Some random number to reserve enough space.
|
||||
Money max_cost = 10000; // Some random number to reserve enough space.
|
||||
uint32 rail_total = c->infrastructure.GetRailTotal();
|
||||
uint32_t rail_total = c->infrastructure.GetRailTotal();
|
||||
for (RailType rt = RAILTYPE_BEGIN; rt < RAILTYPE_END; rt++) {
|
||||
max_val = std::max(max_val, c->infrastructure.rail[rt]);
|
||||
max_cost = std::max(max_cost, RailMaintenanceCost(rt, c->infrastructure.rail[rt], rail_total));
|
||||
}
|
||||
max_val = std::max(max_val, c->infrastructure.signal);
|
||||
max_cost = std::max(max_cost, SignalMaintenanceCost(c->infrastructure.signal));
|
||||
uint32 road_total = c->infrastructure.GetRoadTotal();
|
||||
uint32 tram_total = c->infrastructure.GetTramTotal();
|
||||
uint32_t road_total = c->infrastructure.GetRoadTotal();
|
||||
uint32_t tram_total = c->infrastructure.GetTramTotal();
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt < ROADTYPE_END; rt++) {
|
||||
max_val = std::max(max_val, c->infrastructure.road[rt]);
|
||||
max_cost = std::max(max_cost, RoadMaintenanceCost(rt, c->infrastructure.road[rt], RoadTypeIsRoad(rt) ? road_total : tram_total));
|
||||
@@ -2062,7 +2062,7 @@ struct CompanyInfrastructureWindow : Window
|
||||
|
||||
case WID_CI_RAIL_COUNT: {
|
||||
/* Draw infrastructure count for each valid railtype. */
|
||||
uint32 rail_total = c->infrastructure.GetRailTotal();
|
||||
uint32_t rail_total = c->infrastructure.GetRailTotal();
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
if (HasBit(this->railtypes, rt)) {
|
||||
this->DrawCountLine(r, y, c->infrastructure.rail[rt], RailMaintenanceCost(rt, c->infrastructure.rail[rt], rail_total));
|
||||
@@ -2090,7 +2090,7 @@ struct CompanyInfrastructureWindow : Window
|
||||
|
||||
case WID_CI_ROAD_COUNT:
|
||||
case WID_CI_TRAM_COUNT: {
|
||||
uint32 road_tram_total = widget == WID_CI_ROAD_COUNT ? c->infrastructure.GetRoadTotal() : c->infrastructure.GetTramTotal();
|
||||
uint32_t road_tram_total = widget == WID_CI_ROAD_COUNT ? c->infrastructure.GetRoadTotal() : c->infrastructure.GetTramTotal();
|
||||
for (const auto &rt : _sorted_roadtypes) {
|
||||
if (HasBit(this->roadtypes, rt) && RoadTypeIsRoad(rt) == (widget == WID_CI_ROAD_COUNT)) {
|
||||
this->DrawCountLine(r, y, c->infrastructure.road[rt], RoadMaintenanceCost(rt, c->infrastructure.road[rt], road_tram_total));
|
||||
|
Reference in New Issue
Block a user