Re: Are these the best set of bitset macros in the world or what!?



On Sep 16, 3:59 am, Marcin Grzegorczyk <mgrze...@xxxxxxxxxxxxxx>
wrote:
James Dow Allen wrote:
(A real pain on Little-Endian machines is that bit
numbers depend on data-type, i.e. bit #21 is in different
places depending on whether you access the "bit array"
with short or long.  This is not a problem with Big-Endian.)

I think you've got it the wrong way.  It's little-endian machines that
are consistent in this respect.

This confused me for a while. But I now realize we're BOTH right!!
It all depends on how you number the bits.

Big-endian machines work "properly" according to the
above criterion with Bit 0 = MSB and so on.
Little-endian machines work properly with Bit 0 = LSB.
(Which is "better" is a topic for another thread
in another forum, probably after too many drinks.)

Anyway, the only portable way is to access the array with unsigned char.

My concern arose in an application where fastest possible
speed is my highest priority (though I *do* want "my cake
and to eat it too" for readability and portability as possible!)

James
.