From: Michael Beck Date: Thu, 19 Mar 2009 14:00:05 +0000 (+0000) Subject: - add rbitset_set_all() X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=5b85eca02c4414a007d566cd0c673bcb918b468a;p=libfirm - add rbitset_set_all() [r25702] --- diff --git a/include/libfirm/adt/raw_bitset.h b/include/libfirm/adt/raw_bitset.h index f14bf85e3..64601507b 100644 --- a/include/libfirm/adt/raw_bitset.h +++ b/include/libfirm/adt/raw_bitset.h @@ -159,6 +159,18 @@ static inline void rbitset_set(unsigned *bitset, unsigned pos) { BITSET_ELEM(bitset,pos) |= 1 << (pos % BITS_PER_ELEM); } +/** + * Set all bits in a given bitset. + * + * @param bitset the bitset + * @param size number of bits in the bitset + */ +static inline void rbitset_set_all(unsigned *bitset, unsigned size) { + unsigned size_bytes = BITSET_SIZE_BYTES(size); + memset(bitset, ~0, size_bytes); +} + + /** * Clear a bit at position pos. *