22 #ifndef COMMON_BITARRAY_H 23 #define COMMON_BITARRAY_H 25 #include "common/scummsys.h" 45 void set_size(uint bitcount) {
48 _bits = (byte*)malloc((bitcount + 7) / 8);
51 void set_bits(
const byte *bits) {
52 memcpy(_bits, bits, (_bitcount + 7) / 8);
56 memset(_bits, 0, (_bitcount + 7) / 8);
60 _bits[bit / 8] |= (1 << (bit % 8));
63 void unset(uint bit) {
64 _bits[bit / 8] &= ~(1 << (bit % 8));
67 bool get(uint bit)
const {
68 return _bits[bit / 8] & (1 << (bit % 8));
Definition: algorithm.h:29
Definition: bitarray.h:29