added set_all func
authorDaniel Grund <grund@cs.uni-saarland.de>
Tue, 19 Apr 2005 10:18:45 +0000 (10:18 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Tue, 19 Apr 2005 10:18:45 +0000 (10:18 +0000)
[r5715]

ir/adt/bitset.h

index 1f62168..5d86c23 100644 (file)
@@ -306,6 +306,18 @@ static INLINE void bitset_clear_all(bitset_t *bs)
        memset(bs->data, 0, BS_UNIT_SIZE * bs->units);
 }
 
+/**
+ * Set the bitset.
+ * This sets all bits to one.
+ * @param bs The bitset.
+ */
+static INLINE void bitset_set_all(bitset_t *bs)
+{
+       //TODO is this correct (last unit)?
+       //TODO is -1 correct == all bits equal 1
+       memset(bs->data, -1, BS_UNIT_SIZE * bs->units);
+}
+
 /**
  * Check, if one bitset is contained by another.
  * That is, each bit set in lhs is also set in rhs.