BRL-CAD

#include <bitv.h>

Collaboration diagram for bu_bitv:
[legend]

Data Fields

struct bu_list l
 
size_t nbits
 
bitv_t bits [2]
 

Detailed Description

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.

Definition at line 108 of file bitv.h.

Field Documentation

◆ l

struct bu_list l

linked list for caller's use

Definition at line 109 of file bitv.h.

◆ nbits

size_t nbits

actual size of bits[], in bits

Definition at line 110 of file bitv.h.

◆ bits

bitv_t bits[2]

variable size array

Definition at line 111 of file bitv.h.


The documentation for this struct was generated from the following file: