I have the following for
loop and would like to give the index a meaningful name, as required by my obsessive compulsive disorder coding standards.
/* Loop over 64-bit word */
for (i = 0; i < WORD_SIZE / ALIGNMENT; i++)
/* Do work with i */
I wanted to use offset
or word_offset
as the name of the index, until I stumbled upon the last sentence from the technical definition of offset
as given by Wikipedia:
The concept of a distance is valid only if all elements of the object are of the same size (typically given in bytes or words).
Unfortunately, all elements of a word are not the same size. I can have a 64-bit word of five elements of varying sizes (i.e. two chars
, one int
and one short
...or 2*8, 1*32, 1*16 = 64). So according to the above definition, offset
should not be the name of i
.
I suppose word_idx
would do since that is essentially what the index represents, however, I'm wondering if there is a more precise/technical term I'm forgetting or never heard of.
Is there a word (no pun intended) for word size divided by alignment?