# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1347572446 -7200 # Node ID f339499ecd79fe27bf1f9eab4eb36339b702d3db # Parent bd7ca4ceefec7d8eb543da7cc63409d8138d208f Remove multiplexing. Comment on defines which should be removed from header. diff -r bd7ca4ceefec -r f339499ecd79 BitArray.hpp --- a/BitArray.hpp Thu Sep 13 23:36:16 2012 +0200 +++ b/BitArray.hpp Thu Sep 13 23:40:46 2012 +0200 @@ -1,20 +1,15 @@ #ifndef BITARRAY_HPP #define BITARRAY_HPP - -#if 0 -#include -typedef QBitArray BitArray; -#else #include +//We should remove these defines from the header, but we keep them for +//now until we have stabilized the API and removed any bugs. #define HIGH(B) ((B) >> 3) #define LOW(B) ((B) & 0x07) - #define MASK(X) (0x1 << (7 - X)) #define SELECTMASK(X) (uchar(MASK(X))) #define DESELECTMASK(X) (uchar(~MASK(X))) - #define NUMCHARS(X) HIGH(X + 7) #include @@ -38,6 +33,8 @@ BitArray(uint size) : size_(size), bits(new uchar[NUMCHARS(size)]) { + //We need to initialize the bits beyond size, since they are + //implicitly used in certain functions. bits[NUMCHARS(size) - 1] = 0; } @@ -89,6 +86,4 @@ std::ostream& operator<<(std::ostream& out, const BitArray& rhs); -#endif - #endif //BITARRAY_HPP