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:
@@ -542,7 +542,7 @@ static WindowDesc _company_finances_desc(
|
||||
WDP_AUTO, "company_finances", 0, 0,
|
||||
WC_FINANCES, WC_NONE,
|
||||
0,
|
||||
_nested_company_finances_widgets, lengthof(_nested_company_finances_widgets)
|
||||
std::begin(_nested_company_finances_widgets), std::end(_nested_company_finances_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -1160,7 +1160,7 @@ static WindowDesc _select_company_livery_desc(
|
||||
WDP_AUTO, nullptr, 0, 0,
|
||||
WC_COMPANY_COLOUR, WC_NONE,
|
||||
0,
|
||||
_nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets)
|
||||
std::begin(_nested_select_company_livery_widgets), std::end(_nested_select_company_livery_widgets)
|
||||
);
|
||||
|
||||
void ShowCompanyLiveryWindow(CompanyID company, GroupID group)
|
||||
@@ -1777,7 +1777,7 @@ static WindowDesc _select_company_manager_face_desc(
|
||||
WDP_AUTO, nullptr, 0, 0,
|
||||
WC_COMPANY_MANAGER_FACE, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets)
|
||||
std::begin(_nested_select_company_manager_face_widgets), std::end(_nested_select_company_manager_face_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -2149,7 +2149,7 @@ static WindowDesc _company_infrastructure_desc(
|
||||
WDP_AUTO, "company_infrastructure", 0, 0,
|
||||
WC_COMPANY_INFRASTRUCTURE, WC_NONE,
|
||||
0,
|
||||
_nested_company_infrastructure_widgets, lengthof(_nested_company_infrastructure_widgets)
|
||||
std::begin(_nested_company_infrastructure_widgets), std::end(_nested_company_infrastructure_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -2686,7 +2686,7 @@ static WindowDesc _company_desc(
|
||||
WDP_AUTO, "company", 0, 0,
|
||||
WC_COMPANY, WC_NONE,
|
||||
0,
|
||||
_nested_company_widgets, lengthof(_nested_company_widgets)
|
||||
std::begin(_nested_company_widgets), std::end(_nested_company_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -2820,7 +2820,7 @@ static WindowDesc _buy_company_desc(
|
||||
WDP_AUTO, nullptr, 0, 0,
|
||||
WC_BUY_COMPANY, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_buy_company_widgets, lengthof(_nested_buy_company_widgets)
|
||||
std::begin(_nested_buy_company_widgets), std::end(_nested_buy_company_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user