diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-07-26 14:32:53 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-26 14:32:53 +0200 |
commit | cbff661dca89de78570dc665868c76e71ad24e2e (patch) | |
tree | 1db340b6c24953c5a8caa8ea2ac687e0dc4ad4e1 /crawl-ref/source/bitary.cc | |
parent | 42facf2424f12ef1be983b9b9f6ec2996d3981bf (diff) | |
download | crawl-ref-cbff661dca89de78570dc665868c76e71ad24e2e.tar.gz crawl-ref-cbff661dca89de78570dc665868c76e71ad24e2e.zip |
Rename bit_array to bit_vector.
Diffstat (limited to 'crawl-ref/source/bitary.cc')
-rw-r--r-- | crawl-ref/source/bitary.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/bitary.cc b/crawl-ref/source/bitary.cc index 61137c771a..a450df727e 100644 --- a/crawl-ref/source/bitary.cc +++ b/crawl-ref/source/bitary.cc @@ -9,7 +9,7 @@ #include "debug.h" -bit_array::bit_array(unsigned long s) +bit_vector::bit_vector(unsigned long s) : size(s) { nwords = static_cast<int>((size + LONGSIZE - 1) / LONGSIZE); @@ -17,18 +17,18 @@ bit_array::bit_array(unsigned long s) reset(); } -bit_array::~bit_array() +bit_vector::~bit_vector() { delete[] data; } -void bit_array::reset() +void bit_vector::reset() { for (int w = 0; w < nwords; ++w) data[w] = 0; } -bool bit_array::get(unsigned long index) const +bool bit_vector::get(unsigned long index) const { ASSERT(index < size); int w = index / LONGSIZE; @@ -36,7 +36,7 @@ bool bit_array::get(unsigned long index) const return (data[w] & (1UL << b)); } -void bit_array::set(unsigned long index, bool value) +void bit_vector::set(unsigned long index, bool value) { ASSERT(index < size); int w = index / LONGSIZE; @@ -47,7 +47,7 @@ void bit_array::set(unsigned long index, bool value) data[w] &= ~(1UL << b); } -bit_array& bit_array::operator |= (const bit_array& other) +bit_vector& bit_vector::operator |= (const bit_vector& other) { ASSERT(size == other.size); for (int w = 0; w < nwords; ++w) @@ -55,7 +55,7 @@ bit_array& bit_array::operator |= (const bit_array& other) return *this; } -bit_array& bit_array::operator &= (const bit_array& other) +bit_vector& bit_vector::operator &= (const bit_vector& other) { ASSERT(size == other.size); for (int w = 0; w < nwords; ++w) @@ -63,10 +63,10 @@ bit_array& bit_array::operator &= (const bit_array& other) return *this; } -bit_array bit_array::operator & (const bit_array& other) const +bit_vector bit_vector::operator & (const bit_vector& other) const { ASSERT(size == other.size); - bit_array res = bit_array(size); + bit_vector res = bit_vector(size); for (int w = 0; w < nwords; ++w) res.data[w] = data[w] & other.data[w]; return res; |