Cosmetic
[libfirm] / ir / adt / bitset_std.h
index e1fa6eb..2253c27 100644 (file)
        ((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.
@@ -63,8 +71,8 @@
  * @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));
@@ -85,7 +93,7 @@ static INLINE int _std_bitset_ntz(unsigned long *unit_ptr)
  * @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.
@@ -100,8 +108,3 @@ static INLINE int _std_bitset_ntz(unsigned long *unit_ptr)
 #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)