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
@@ -32,7 +32,7 @@
|
||||
#include "safeguards.h"
|
||||
|
||||
/** Widgets for the background window to prevent smearing. */
|
||||
static const NWidgetPart _background_widgets[] = {
|
||||
static constexpr NWidgetPart _background_widgets[] = {
|
||||
NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1),
|
||||
EndContainer(),
|
||||
};
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
};
|
||||
|
||||
/** Nested widgets for the error window. */
|
||||
static const NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetDataTip(STR_MISSING_GRAPHICS_ERROR_TITLE, STR_NULL),
|
||||
EndContainer(),
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
};
|
||||
|
||||
/** Nested widgets for the download window. */
|
||||
static const NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY),
|
||||
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
};
|
||||
|
||||
/** The widgets for the query. It has no close box as that sprite does not exist yet. */
|
||||
static const NWidgetPart _bootstrap_query_widgets[] = {
|
||||
static constexpr NWidgetPart _bootstrap_query_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
EndContainer(),
|
||||
|
Reference in New Issue
Block a user