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:
@@ -296,7 +296,7 @@ static WindowDesc _build_industry_desc(
|
||||
WDP_AUTO, "build_industry", 170, 212,
|
||||
WC_BUILD_INDUSTRY, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_build_industry_widgets, lengthof(_nested_build_industry_widgets)
|
||||
std::begin(_nested_build_industry_widgets), std::end(_nested_build_industry_widgets)
|
||||
);
|
||||
|
||||
/** Build (fund or prospect) a new industry, */
|
||||
@@ -1206,7 +1206,7 @@ static WindowDesc _industry_view_desc(
|
||||
WDP_AUTO, "view_industry", 260, 120,
|
||||
WC_INDUSTRY_VIEW, WC_NONE,
|
||||
0,
|
||||
_nested_industry_view_widgets, lengthof(_nested_industry_view_widgets)
|
||||
std::begin(_nested_industry_view_widgets), std::end(_nested_industry_view_widgets)
|
||||
);
|
||||
|
||||
void ShowIndustryViewWindow(int industry)
|
||||
@@ -1867,7 +1867,7 @@ static WindowDesc _industry_directory_desc(
|
||||
WDP_AUTO, "list_industries", 428, 190,
|
||||
WC_INDUSTRY_DIRECTORY, WC_NONE,
|
||||
0,
|
||||
_nested_industry_directory_widgets, lengthof(_nested_industry_directory_widgets)
|
||||
std::begin(_nested_industry_directory_widgets), std::end(_nested_industry_directory_widgets)
|
||||
);
|
||||
|
||||
void ShowIndustryDirectory()
|
||||
@@ -1905,7 +1905,7 @@ static WindowDesc _industry_cargoes_desc(
|
||||
WDP_AUTO, "industry_cargoes", 300, 210,
|
||||
WC_INDUSTRY_CARGOES, WC_NONE,
|
||||
0,
|
||||
_nested_industry_cargoes_widgets, lengthof(_nested_industry_cargoes_widgets)
|
||||
std::begin(_nested_industry_cargoes_widgets), std::end(_nested_industry_cargoes_widgets)
|
||||
);
|
||||
|
||||
/** Available types of field. */
|
||||
|
Reference in New Issue
Block a user