1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

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

@@ -46,7 +46,7 @@ static WindowDesc _errmsg_desc(
WDP_MANUAL, nullptr, 0, 0,
WC_ERRMSG, WC_NONE,
0,
_nested_errmsg_widgets, lengthof(_nested_errmsg_widgets)
std::begin(_nested_errmsg_widgets), std::end(_nested_errmsg_widgets)
);
static const NWidgetPart _nested_errmsg_face_widgets[] = {
@@ -66,7 +66,7 @@ static WindowDesc _errmsg_face_desc(
WDP_MANUAL, nullptr, 0, 0,
WC_ERRMSG, WC_NONE,
0,
_nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets)
std::begin(_nested_errmsg_face_widgets), std::end(_nested_errmsg_face_widgets)
);
/**