diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:44:22 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:55:42 +0000 |
commit | 860c270c73048b4930ac8cbebcd60be746eb9782 (patch) | |
tree | a88a8acb208cf426ae8fac05dda202c57b59426a /src/vehicle_gui.cpp | |
parent | 395a5d9991b500c681ff384f8d3b4e153e687abb (diff) | |
download | openttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz |
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 2cc9f9d74..50a011c8e 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2009,10 +2009,10 @@ void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type, TileInde /* Unified vehicle GUI - Vehicle Details Window */ -assert_compile(WID_VD_DETAILS_CARGO_CARRIED == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_CARGO ); -assert_compile(WID_VD_DETAILS_TRAIN_VEHICLES == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_INFO ); -assert_compile(WID_VD_DETAILS_CAPACITY_OF_EACH == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_CAPACITY); -assert_compile(WID_VD_DETAILS_TOTAL_CARGO == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_TOTALS ); +static_assert(WID_VD_DETAILS_CARGO_CARRIED == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_CARGO ); +static_assert(WID_VD_DETAILS_TRAIN_VEHICLES == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_INFO ); +static_assert(WID_VD_DETAILS_CAPACITY_OF_EACH == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_CAPACITY); +static_assert(WID_VD_DETAILS_TOTAL_CARGO == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_TOTALS ); /** Vehicle details widgets (other than train). */ static const NWidgetPart _nested_nontrain_vehicle_details_widgets[] = { @@ -2554,10 +2554,10 @@ static WindowDesc _train_view_desc( /* Just to make sure, nobody has changed the vehicle type constants, as we are using them for array indexing in a number of places here. */ -assert_compile(VEH_TRAIN == 0); -assert_compile(VEH_ROAD == 1); -assert_compile(VEH_SHIP == 2); -assert_compile(VEH_AIRCRAFT == 3); +static_assert(VEH_TRAIN == 0); +static_assert(VEH_ROAD == 1); +static_assert(VEH_SHIP == 2); +static_assert(VEH_AIRCRAFT == 3); /** Zoom levels for vehicle views indexed by vehicle type. */ static const ZoomLevel _vehicle_view_zoom_levels[] = { |