[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIZEOF macro
From: |
Bruno Haible |
Subject: |
Re: SIZEOF macro |
Date: |
Sat, 26 Dec 2009 10:40:07 +0100 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> Is there some other short but acceptable name? Maybe COUNTOF or
> ARRAY_COUNT? END_INDEX or LAST_INDEX?
I don't see a better name than SIZEOF:
- The terms "length", "count", "used" etc. allude to the used portion
of an array, not its allocated size.
- "cardinality" is longer, for no added value.
- The word "end_index" would be reasonable if the only use was in
'for' loops. But when you concatenate two arrays, and you've got to write
XNMALLOC (END_INDEX (a1) + END_INDEX (a2), type)
you realize that it is not capturing the entire semantics.
Bruno
- Re: ASSERT macro, (continued)
- Re: ASSERT macro, Bruno Haible, 2009/12/24
- SIZEOF macro (was: ASSERT macro), Eric Blake, 2009/12/24
- Re: SIZEOF macro, Eric Blake, 2009/12/24
- Re: SIZEOF macro, Jim Meyering, 2009/12/25
- Re: SIZEOF macro, Jim Meyering, 2009/12/25
- Re: SIZEOF macro, Ben Pfaff, 2009/12/24
- Re: SIZEOF macro, Bruno Haible, 2009/12/24
- Re: SIZEOF macro, Pádraig Brady, 2009/12/24
- Re: SIZEOF macro, Bruno Haible, 2009/12/25
- Re: SIZEOF macro, Eric Blake, 2009/12/25
- Re: SIZEOF macro,
Bruno Haible <=
- Re: ASSERT macro, Eric Blake, 2009/12/26
- Re: ASSERT macro, Bruno Haible, 2009/12/26