1
0
Fork 0

Cleanup: Remove `lastof` macro.

pull/12849/head
Peter Nelson 2024-07-09 00:59:26 +01:00
parent 8ed33d1e6f
commit c4693200b4
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
2 changed files with 1 additions and 9 deletions

View File

@ -285,14 +285,6 @@ char (&ArraySizeHelper(T (&array)[N]))[N];
*/ */
#define lengthof(array) (sizeof(ArraySizeHelper(array))) #define lengthof(array) (sizeof(ArraySizeHelper(array)))
/**
* Get the last element of an fixed size array.
*
* @param x The pointer to the first element of the array
* @return The pointer to the last element of the array
*/
#define lastof(x) (&x[lengthof(x) - 1])
/** /**
* Gets the size of a variable within a class. * Gets the size of a variable within a class.
* @param base The class the variable is in. * @param base The class the variable is in.

View File

@ -1420,7 +1420,7 @@ public:
uint spacer_i = 0; uint spacer_i = 0;
uint button_i = 0; uint button_i = 0;
/* Index into the arrangement indices. The macro lastof cannot be used here! */ /* Index into the arrangement indices. */
const WidgetID *slotp = rtl ? &arrangement[arrangable_count - 1] : arrangement; const WidgetID *slotp = rtl ? &arrangement[arrangable_count - 1] : arrangement;
for (uint i = 0; i < arrangable_count; i++) { for (uint i = 0; i < arrangable_count; i++) {
uint slot = lookup[*slotp]; uint slot = lookup[*slotp];