X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/345cea780a4d3d11673c176cde39e20a043a1dea..158e69f984ddc49f0d7febe20234482c8d3cfbb0:/lib/lbitset.c diff --git a/lib/lbitset.c b/lib/lbitset.c index f426c301..f5f8c4fa 100644 --- a/lib/lbitset.c +++ b/lib/lbitset.c @@ -40,9 +40,7 @@ but the more memory wasted for sparse bitsets and the longer the time to search for set bits. */ -#ifndef LBITSET_ELT_WORDS #define LBITSET_ELT_WORDS 2 -#endif typedef bitset_word lbitset_word; @@ -139,9 +137,6 @@ lbitset_elt_alloc () } else { - /* We can't use gcc_obstack_init to initialize the obstack since - print-rtl.c now calls bitset functions, and bitset is linked - into the gen* functions. */ if (!lbitset_obstack_init) { lbitset_obstack_init = 1; @@ -184,7 +179,7 @@ lbitset_elt_alloc () } -/* Allocate a lbitset element. The bits are not cleared. */ +/* Allocate a lbitset element. The bits are cleared. */ static inline lbitset_elt * lbitset_elt_calloc () { @@ -590,7 +585,8 @@ lbitset_set (dst, bitno) lbitset_elt_find (dst, windex, LBITSET_CREATE); - dst->b.cdata[windex - dst->b.cindex] |= (1 << (bitno % BITSET_WORD_BITS)); + dst->b.cdata[windex - dst->b.cindex] |= + (bitset_word) 1 << (bitno % BITSET_WORD_BITS); } @@ -605,7 +601,8 @@ lbitset_reset (dst, bitno) if (!lbitset_elt_find (dst, windex, LBITSET_FIND)) return; - dst->b.cdata[windex - dst->b.cindex] &= ~(1 << (bitno % BITSET_WORD_BITS)); + dst->b.cdata[windex - dst->b.cindex] &= + ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS)); /* If all the data is zero, perhaps we should unlink it now... */ } @@ -956,7 +953,7 @@ lbitset_op1 (dst, op) { /* Create new elements if they cannot be found. */ elt = lbitset_elt_find (dst, i, LBITSET_CREATE); - memset (elt->words, ~0, sizeof (elt->words)); + memset (elt->words, -1, sizeof (elt->words)); } break;