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:
@@ -1025,14 +1025,14 @@ static WindowDesc _generate_landscape_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_GENERATE_LANDSCAPE, WC_NONE,
|
||||
0,
|
||||
_nested_generate_landscape_widgets, lengthof(_nested_generate_landscape_widgets)
|
||||
std::begin(_nested_generate_landscape_widgets), std::end(_nested_generate_landscape_widgets)
|
||||
);
|
||||
|
||||
static WindowDesc _heightmap_load_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_GENERATE_LANDSCAPE, WC_NONE,
|
||||
0,
|
||||
_nested_heightmap_load_widgets, lengthof(_nested_heightmap_load_widgets)
|
||||
std::begin(_nested_heightmap_load_widgets), std::end(_nested_heightmap_load_widgets)
|
||||
);
|
||||
|
||||
static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode)
|
||||
@@ -1328,7 +1328,7 @@ static WindowDesc _create_scenario_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_GENERATE_LANDSCAPE, WC_NONE,
|
||||
0,
|
||||
_nested_create_scenario_widgets, lengthof(_nested_create_scenario_widgets)
|
||||
std::begin(_nested_create_scenario_widgets), std::end(_nested_create_scenario_widgets)
|
||||
);
|
||||
|
||||
/** Show the window to create a scenario. */
|
||||
@@ -1354,7 +1354,7 @@ static WindowDesc _generate_progress_desc(
|
||||
WDP_CENTER, nullptr, 0, 0,
|
||||
WC_MODAL_PROGRESS, WC_NONE,
|
||||
0,
|
||||
_nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets)
|
||||
std::begin(_nested_generate_progress_widgets), std::end(_nested_generate_progress_widgets)
|
||||
);
|
||||
|
||||
struct GenWorldStatus {
|
||||
|
Reference in New Issue
Block a user