[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: CHAR_BIT > 8 in LDAP C API



At 08:53 PM 6/20/99 +0200, Hallvard B Furuseth wrote:
>How should bit strings be represented on hosts where
>'char' has more than 8 bits?

You place the bits in an array sufficent to hold your bits.  If
you have 15 bits to send and your char is 8 bits, you need 2 chars.
If char is 9 bits, you need 2.  If char is 7 bits, you need 3.
If char is 16 bits, you need 1.

Regardless of the number of bits, I note that we might want
to clarify the bit order and padding of last 'char' requirements.

More interesting is 'char' less than 8 bits as the value 0xff
(boolean truth) is not representable.  This could be changed
to say "zero for FALSE or non-zero TRUE" or the page 5
architecture clarification ('int' at least 32) be extended:

	This API is designed for use in environments where
	'char' is at least 8 bits in size and 'int' is at
	least 32 bits in size.

Tbough I would prefer changing the truth value to non-zero,
I would not object to either change.