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:

committed by
Peter Nelson

parent
71b7ba0daa
commit
7737aa6640
@@ -1567,7 +1567,7 @@ public:
|
||||
};
|
||||
|
||||
/** Nested widget definition for "your" train orders. */
|
||||
static const NWidgetPart _nested_orders_train_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_orders_train_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1645,7 +1645,7 @@ static WindowDesc _orders_train_desc(__FILE__, __LINE__,
|
||||
);
|
||||
|
||||
/** Nested widget definition for "your" orders (non-train). */
|
||||
static const NWidgetPart _nested_orders_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_orders_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1718,7 +1718,7 @@ static WindowDesc _orders_desc(__FILE__, __LINE__,
|
||||
);
|
||||
|
||||
/** Nested widget definition for competitor orders. */
|
||||
static const NWidgetPart _nested_other_orders_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_other_orders_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
|
Reference in New Issue
Block a user