diff options
author | Ash Wolf <ninji@wuffs.org> | 2022-12-14 00:16:59 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2022-12-14 00:16:59 +0000 |
commit | 25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22 (patch) | |
tree | c0ee632aa3752884b996c562622e2ece88216ea4 /includes/compiler/IroBitVect.h | |
parent | 9d2728a5605f651934fe67a6fe6986b3e4a2c011 (diff) | |
download | MWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.tar.gz MWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.zip |
haha it's been a while since i last committed, hasn't it
Diffstat (limited to '')
-rw-r--r-- | includes/compiler/BitVector.h (renamed from includes/compiler/IroBitVect.h) | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/compiler/IroBitVect.h b/includes/compiler/BitVector.h index 7bbca22..f8f8143 100644 --- a/includes/compiler/IroBitVect.h +++ b/includes/compiler/BitVector.h @@ -25,11 +25,13 @@ extern Boolean Bv_IsEmpty(const BitVector *bv); inline void Bv_SetBit(UInt32 bit, BitVector *bv) { if ((bit / 32) < bv->size) { - bv->data[bit / 32] |= ~(1 << (bit & 31)); + bv->data[bit / 32] |= 1 << (bit & 31); } else { #line 56 CError_FATAL(); } } +#define Bv_IsBitSet(_bit, _bv) ( (((_bit) >> 5) < (_bv)->size) && ((_bv)->data[(_bit) >> 5] & (1 << ((_bit) & 31))) ) + #endif |