BRL-CAD
|
#include <bitv.h>
Data Fields | |
struct bu_list | l |
size_t | nbits |
bitv_t | bits [2] |
Bit vector data structure.
bu_bitv uses a little-endian encoding, placing bit 0 on the right side of the 0th word.
This is done only because left-shifting a 1 can be done in an efficient word-length-independent manner; going the other way would require a compile-time constant with only the sign bit set, and an unsigned right shift, which some machines don't have in hardware, or an extra subtraction.
Application code should never peek at the bit-buffer; use the macros. The external hex form is most significant byte first (bit 0 is at the right). Note that MUVES does it differently.