Re: Are these the best set of bitset macros in the world or what!?
- From: James Dow Allen <jdallen2000@xxxxxxxxx>
- Date: Thu, 16 Sep 2010 03:40:48 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Are these the best set of bitset macros in the world or what!?
- From: Marcin Grzegorczyk
- Re: Are these the best set of bitset macros in the world or what!?
- References:
- Are these the best set of bitset macros in the world or what!?
- From: Brian
- Re: Are these the best set of bitset macros in the world or what!?
- From: James Dow Allen
- Re: Are these the best set of bitset macros in the world or what!?
- From: Marcin Grzegorczyk
- Are these the best set of bitset macros in the world or what!?
- Prev by Date: Re: Are these the best set of bitset macros in the world or what!?
- Next by Date: Re: Software maintenance
- Previous by thread: Re: Are these the best set of bitset macros in the world or what!?
- Next by thread: Re: Are these the best set of bitset macros in the world or what!?
- Index(es):