((unsigned long *) ((char *) data + bitset_base_size))
+/**
+ * Clear some units from a certain address on.
+ * @param addr The address from where to clear.
+ * @param n The number of units to set to 0.
+ */
+#define _bitset_inside_clear_units(addr,n) \
+ memset(addr, 0, n * BS_UNIT_SIZE)
+
/**
* Set a bit in a unit.
* @param unit A pointer to the unit.
* @param unit A pointer to the unit.
* @return The Number of leading zeroes.
*/
-#define _bitset_inside_ntz(unit_ptr) _std_bitset_inside_ntz(unit_ptr)
-static INLINE int _std_bitset_ntz(unsigned long *unit_ptr)
+#define _bitset_inside_ntz(unit_ptr) _bitset_std_inside_ntz(unit_ptr)
+static INLINE int _bitset_std_inside_ntz(unsigned long *unit_ptr)
{
unsigned long data = *unit_ptr;
return 32 - nlz(~data & (data - 1));
* @return 1, if the bit is set, 0 otherise.
*/
#define _bitset_inside_is_set(unit_ptr,bit) \
-(((*unit_ptr) & (1 << (bit))) != NULL)
+ (((*unit_ptr) & (1 << (bit))) != 0)
/**
* count the number of bits set in a unit.
#define _bitset_inside_binop_andnot(tgt,src) ((*tgt) &= ~(*src))
#define _bitset_inside_binop_or(tgt,src) ((*tgt) |= (*src))
#define _bitset_inside_binop_xor(tgt,src) ((*tgt) ^= (*src))
-
-#define _bitset_inside_binop_with_zero_and(tgt) ((*tgt) &= 0UL)
-#define _bitset_inside_binop_with_zero_andnot(tgt) ((*tgt) &= ~0UL)
-#define _bitset_inside_binop_with_zero_or(tgt) ((*tgt) |= 0UL)
-#define _bitset_inside_binop_with_zero_xor(tgt) ((*tgt) ^= 0UL)