mirror of https://github.com/OpenTTD/OpenTTD
Cleanup: Remove `lastof` macro.
parent
8ed33d1e6f
commit
c4693200b4
|
@ -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.
|
||||||
|
|
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue