1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-15 10:39:10 +00:00

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:
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

@@ -33,7 +33,7 @@
#include "safeguards.h"
static const NWidgetPart _nested_errmsg_widgets[] = {
static constexpr NWidgetPart _nested_errmsg_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED),
NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL),
@@ -50,7 +50,7 @@ static WindowDesc _errmsg_desc(__FILE__, __LINE__,
std::begin(_nested_errmsg_widgets), std::end(_nested_errmsg_widgets)
);
static const NWidgetPart _nested_errmsg_face_widgets[] = {
static constexpr NWidgetPart _nested_errmsg_face_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED),
NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_NULL),