used new new_type_frame() to generate frame types
[libfirm] / ir / adt / bitset.h
index 18ae3b4..4f249be 100644 (file)
@@ -73,7 +73,7 @@ static INLINE bitset_t *_bitset_prepare(void *area, bitset_pos_t size)
  */
 static INLINE bitset_t *_bitset_mask_highest(bitset_t *bs)
 {
-  bs->data[bs->units - 1] &= (bs->size & BS_UNIT_MASK) - 1;
+  bs->data[bs->units - 1] &= (1 << (bs->size & BS_UNIT_MASK)) - 1;
   return bs;
 }
 
@@ -345,8 +345,8 @@ static INLINE bitset_t *bitset_clear_all(bitset_t *bs)
  */
 static INLINE bitset_t *bitset_set_all(bitset_t *bs)
 {
-       memset(bs->data, -1, BS_UNIT_SIZE * bs->units);
-  return bs;
+       memset(bs->data, -1, bs->units * BS_UNIT_SIZE);
+  return _bitset_mask_highest(bs);
 }
 
 /**
@@ -390,9 +390,10 @@ static INLINE int bitset_contains(const bitset_t *lhs, const bitset_t *rhs)
  */
 static INLINE void bitset_minus1(bitset_t *bs)
 {
-       int i;
 #define _SH (sizeof(bitset_unit_t) * 8 - 1)
 
+  bitset_pos_t i;
+
   for(i = 0; i < bs->units; ++i) {
     bitset_unit_t unit = bs->data[i];
     bitset_unit_t um1  = unit - 1;