Codechange: Use std::initializer_list for NWidgetPart data. (#14749)

Avoids using C/C++ arrays.
This commit is contained in:
Peter Nelson
2025-11-01 22:33:00 +00:00
committed by GitHub
parent 34bbae05db
commit 66b6d71e32
62 changed files with 157 additions and 157 deletions
+3 -3
View File
@@ -624,7 +624,7 @@ struct NewGRFInspectWindow : Window {
/* static */ uint32_t NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_newgrf_inspect_chain_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NGRFI_CAPTION), SetStringTip(STR_NEWGRF_INSPECT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -648,7 +648,7 @@ static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
EndContainer(),
};
static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_newgrf_inspect_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NGRFI_CAPTION), SetStringTip(STR_NEWGRF_INSPECT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1119,7 +1119,7 @@ private:
bool SpriteAlignerWindow::centre = true;
bool SpriteAlignerWindow::crosshair = true;
static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_sprite_aligner_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SA_CAPTION),