Re: [PATCH 2/3] refactor: use bitsizeof() instead of 8 * sizeof()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Wed, Jul 22, 2009 at 10:09:56PM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@xxxxxxxx> writes:
>> 
>> > On Wed, Jul 22, 2009 at 11:34:34PM +0200, Pierre Habouzit wrote:
>> >
>> >>  #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
>> >> +#define bitsizeof(x)  (CHAR_BIT * sizeof(x))
>> >
>> > Isn't our style to use all-caps for macros? I.e., BITSIZEOF?
>> 
>> Perhaps but I'd say similarity between sizeof() and bitsizeof() calls for
>> consistency in the lowercase in this particular case.
>
> Fair enough. I just wanted to point it out in case nobody thought of it.

I've actually thought of using elemof() to call what is known as
ARRAY_SIZE() when we introduced it, but now it is way _too_ late ;-)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]