This commit is contained in:
David Rose 2006-01-20 20:51:28 +00:00
parent 3c39318b34
commit 3be2b77316

View File

@ -211,16 +211,14 @@ has_bits_in_common(const BitArray &other) const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: BitArray::output // Function: BitArray::output
// Access: Published // Access: Published
// Description: Writes the BitArray out as a binary or a hex number, // Description: Writes the BitArray out as a hex number. For a
// according to the number of bits. // BitArray, this is always the same as output_hex();
// it's too confusing for the output format to change
// back and forth at runtime.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void BitArray:: void BitArray::
output(ostream &out) const { output(ostream &out) const {
if (get_num_bits() >= 40) {
output_hex(out); output_hex(out);
} else {
output_binary(out);
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -495,7 +493,7 @@ operator <<= (int shift) {
// Finally, the top n bits. // Finally, the top n bits.
if (_highest_bits) { if (_highest_bits) {
next_bits |= upper_mask; next_bits |= ~MaskType::lower_on(b);
} }
new_array.push_back(next_bits); new_array.push_back(next_bits);
_array.swap(new_array); _array.swap(new_array);
@ -563,7 +561,7 @@ operator >>= (int shift) {
// Finally, the top n bits. // Finally, the top n bits.
if (_highest_bits) { if (_highest_bits) {
next_bits |= upper_mask; next_bits |= ~MaskType::lower_on(upshift_count);
} }
new_array.push_back(next_bits); new_array.push_back(next_bits);
_array.swap(new_array); _array.swap(new_array);