Codechange: Make all NWidgetPart arrays constexpr.

This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
This commit is contained in:
Peter Nelson
2024-01-15 22:49:24 +00:00
committed by Peter Nelson
parent 71b7ba0daa
commit 7737aa6640
61 changed files with 154 additions and 154 deletions

View File

@@ -326,7 +326,7 @@ struct BuildDocksToolbarWindow : Window {
* Nested widget parts of docks toolbar, game version.
* Position of #WID_DT_RIVER widget has changed.
*/
static const NWidgetPart _nested_build_docks_toolbar_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WATERWAYS_TOOLBAR_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -371,7 +371,7 @@ Window *ShowBuildDocksToolbar()
* Nested widget parts of docks toolbar, scenario editor version.
* Positions of #WID_DT_DEPOT, #WID_DT_STATION, and #WID_DT_BUOY widgets have changed.
*/
static const NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WATERWAYS_TOOLBAR_CAPTION_SE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -479,7 +479,7 @@ public:
};
/** Nested widget parts of a build dock station window. */
static const NWidgetPart _nested_build_dock_station_widgets[] = {
static constexpr NWidgetPart _nested_build_dock_station_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_DOCK_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -580,7 +580,7 @@ public:
}
};
static const NWidgetPart _nested_build_docks_depot_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_DEPOT_BUILD_SHIP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),