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
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Bruno Haible on 12/25/2009 3:58 AM:
> Pádraig Brady wrote:
>> I use LENGTHOF in my personal code.
>
> It's certainly handy and easy to remember. But in C we often make the
> distinction between "length" (= number of elements that matter)
Jim Meyering wrote:
> Eric Blake wrote:
>> According to Eric Blake on 12/24/2009 4:21 PM:
>>> According to Bruno Haible on 12/24/2009 1:08 PM:
>> Either way we create macros.h and put ASSERT there
Done this this big commit, now.
>>>
>>> Hmm. macros.h defines SIZEOF, and test-argv-iter.c d
Pádraig Brady wrote:
> I use LENGTHOF in my personal code.
It's certainly handy and easy to remember. But in C we often make the
distinction between "length" (= number of elements that matter) and
"size" (= number of elements for which room is allocated).
The array L"abc" has length 3, as determin
Eric Blake wrote:
> According to Eric Blake on 12/24/2009 4:21 PM:
>> According to Bruno Haible on 12/24/2009 1:08 PM:
> Either way we create macros.h and put ASSERT there
>>> Done this this big commit, now.
>>
>> Hmm. macros.h defines SIZEOF, and test-argv-iter.c defines
>> ARRAY_CARDINALITY
On 24/12/09 23:21, Eric Blake wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Bruno Haible on 12/24/2009 1:08 PM:
Either way we create macros.h and put ASSERT there
Done this this big commit, now.
Hmm. macros.h defines SIZEOF, and test-argv-iter.c defines
ARRAY_CARDINALIT
Eric Blake wrote:
> macros.h defines SIZEOF, and test-argv-iter.c defines
> ARRAY_CARDINALITY, both of which are used to determine the size of an
> array. I kind of prefer the name in test-argv-iter (to me, sizeof implies
> a size_t count of bytes, not the number of elements). Is it okay to
> ren
Eric Blake writes:
> Hmm. macros.h defines SIZEOF, and test-argv-iter.c defines
> ARRAY_CARDINALITY, both of which are used to determine the size of an
> array. I kind of prefer the name in test-argv-iter (to me, sizeof implies
> a size_t count of bytes, not the number of elements). Is it okay
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Eric Blake on 12/24/2009 4:21 PM:
> According to Bruno Haible on 12/24/2009 1:08 PM:
Either way we create macros.h and put ASSERT there
>> Done this this big commit, now.
>
> Hmm. macros.h defines SIZEOF, and test-argv-iter.c defines
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Bruno Haible on 12/24/2009 1:08 PM:
>>> Either way we create macros.h and put ASSERT there
>
> Done this this big commit, now.
Hmm. macros.h defines SIZEOF, and test-argv-iter.c defines
ARRAY_CARDINALITY, both of which are used to deter
10 matches
Mail list logo