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

@@ -1896,14 +1896,14 @@ public:
};
/** Widget parts of the smallmap display. */
static const NWidgetPart _nested_smallmap_display[] = {
static constexpr NWidgetPart _nested_smallmap_display[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SM_MAP_BORDER),
NWidget(WWT_INSET, COLOUR_BROWN, WID_SM_MAP), SetMinimalSize(346, 140), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(),
EndContainer(),
};
/** Widget parts of the smallmap legend bar + image buttons. */
static const NWidgetPart _nested_smallmap_bar[] = {
static constexpr NWidgetPart _nested_smallmap_bar[] = {
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SM_LEGEND), SetResize(1, 1),
@@ -1954,7 +1954,7 @@ static std::unique_ptr<NWidgetBase> SmallMapDisplay()
}
static const NWidgetPart _nested_smallmap_widgets[] = {
static constexpr NWidgetPart _nested_smallmap_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SM_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),