Some bug fixes
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Tue, 30 Nov 2004 13:19:50 +0000 (13:19 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Tue, 30 Nov 2004 13:19:50 +0000 (13:19 +0000)
[r4507]

ir/adt/bitset.h
ir/adt/bitset_std.h

index 028c54f..0a47898 100644 (file)
@@ -18,7 +18,8 @@
 
 #include "bitset_std.h"
 
-#if defined(__GNUC__) && defined(__i386__)
+/* #if defined(__GNUC__) && defined(__i386__) */
+#if 0
 #include "bitset_ia32.h"
 #endif
 
@@ -119,7 +120,7 @@ static INLINE unsigned long *_bitset_get_unit(const bitset_t *bs, unsigned long
 static INLINE void bitset_set(bitset_t *bs, unsigned long bit)
 {
        unsigned long *unit = _bitset_get_unit(bs, bit);
-       _bitset_inside_set(*unit, bit & BS_UNIT_MASK);
+       _bitset_inside_set(unit, bit & BS_UNIT_MASK);
 }
 
 /**
@@ -328,7 +329,7 @@ static INLINE int bitset_contains(const bitset_t *lhs, const bitset_t *rhs)
  * @param file The stream.
  * @param bs The bitset.
  */
-static INLINE void bitset_fprint(FILE *file, bitset_t *bs)
+static INLINE void bitset_fprint(FILE *file, const bitset_t *bs)
 {
        const char *prefix = "";
        int i;
@@ -363,5 +364,4 @@ BINARY_OP(andnot)
 BINARY_OP(or)
 BINARY_OP(xor)
 
-
 #endif
index e1fa6eb..b7860ec 100644 (file)
@@ -63,8 +63,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 +85,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.