Codechange: Use begin/end of nwidget parts of begin/length.

This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
This commit is contained in:
2023-09-03 21:54:13 +01:00
committed by PeterN
parent e4613fc04c
commit e8015e497d
65 changed files with 231 additions and 232 deletions

View File

@@ -925,7 +925,7 @@ static WindowDesc _game_options_desc(
WDP_CENTER, nullptr, 0, 0,
WC_GAME_OPTIONS, WC_NONE,
0,
_nested_game_options_widgets, lengthof(_nested_game_options_widgets)
std::begin(_nested_game_options_widgets), std::end(_nested_game_options_widgets)
);
/** Open the game options window. */
@@ -2657,7 +2657,7 @@ static WindowDesc _settings_selection_desc(
WDP_CENTER, "settings", 510, 450,
WC_GAME_OPTIONS, WC_NONE,
0,
_nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets)
std::begin(_nested_settings_selection_widgets), std::end(_nested_settings_selection_widgets)
);
/** Open advanced settings window. */
@@ -2956,7 +2956,7 @@ static WindowDesc _cust_currency_desc(
WDP_CENTER, nullptr, 0, 0,
WC_CUSTOM_CURRENCY, WC_NONE,
0,
_nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets)
std::begin(_nested_cust_currency_widgets), std::end(_nested_cust_currency_widgets)
);
/** Open custom currency window. */