From: Sebastian Hack Date: Tue, 30 Nov 2004 13:19:50 +0000 (+0000) Subject: Some bug fixes X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=90bb79fa74251fbf72b9eca9d60a71b7fff4cf5a;p=libfirm Some bug fixes [r4507] --- diff --git a/ir/adt/bitset.h b/ir/adt/bitset.h index 028c54fed..0a4789862 100644 --- a/ir/adt/bitset.h +++ b/ir/adt/bitset.h @@ -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 diff --git a/ir/adt/bitset_std.h b/ir/adt/bitset_std.h index e1fa6ebb7..b7860ec63 100644 --- a/ir/adt/bitset_std.h +++ b/ir/adt/bitset_std.h @@ -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.