d struct. d->itemCache ( unsigned char s). , d->itemSize . , i ,
d->itemCache + i * d->itemSize
, , , i q
q * d->block_size + d->offset[q] % d->block_size
This is probably determined by the specifics of the data structure in question.
To make this macro more readable, you can split it into several macros
#define _GetItem(d, i) ((d)->itemCache + (i) * (d)->itemSize)
#define _GetFrontIndex(d, q) ((q) * (d)->block_size + (d)->offset[q] % (d)->block_size)
#define _GetFrontItem(d, q) _GetItem(d, _GetFrontIndex(d, q))
source
share