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
@@ -637,7 +637,7 @@ struct NewGRFInspectWindow : Window {
|
||||
|
||||
/* static */ uint32_t NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
|
||||
|
||||
static const NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NGRFI_CAPTION), SetDataTip(STR_NEWGRF_INSPECT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -661,7 +661,7 @@ static const NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_newgrf_inspect_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NGRFI_CAPTION), SetDataTip(STR_NEWGRF_INSPECT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1090,7 +1090,7 @@ struct SpriteAlignerWindow : Window {
|
||||
bool SpriteAlignerWindow::centre = true;
|
||||
bool SpriteAlignerWindow::crosshair = true;
|
||||
|
||||
static const NWidgetPart _nested_sprite_aligner_widgets[] = {
|
||||
static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SA_CAPTION), SetDataTip(STR_SPRITE_ALIGNER_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
|
Reference in New Issue
Block a user