[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: PCB Patches: Use c99 bool instead of manual typedef.
On 5/27/10 4:07 PM, Armin Faltl wrote:
>> I have it here but don't feel like digging through it, and it seems
>> like it's fresh in your mind so I'll ask...Is there anything in C99
>> that'd allow for packing bools into a byte or word value, a-la Pascal's
>> "packed array of boolean"?
>>
> What you are looking for is a bit-vector - it is possible to name every
> bit in it like
> components in a structure. It's a standard but rarely used datatype in C.
I believe K&R called them "bit fields", but yes, I'm aware of that.
What I was talking about, though, was declaring "bool" variables and
have the compiler do the packing and unpacking, and have the actual bit
positions opaque to the programmer. It was more an academic question
than anything else. Being primarily an embedded systems developer, my
brain is well-trained to look for ways to minimize data structure size.
-Dave
--
Dave McGuire
Port Charlotte, FL
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user