mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 09:43:03 +00:00
(lbitset_set, lbitset_reset): Do not assume that
bitset_word is the same width as int. (lbitset_op1): Use -1, not ~0, as memset arg (for portability to one's complement hosts!).
This commit is contained in:
@@ -585,7 +585,8 @@ lbitset_set (dst, bitno)
|
|||||||
|
|
||||||
lbitset_elt_find (dst, windex, LBITSET_CREATE);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -600,7 +601,8 @@ lbitset_reset (dst, bitno)
|
|||||||
if (!lbitset_elt_find (dst, windex, LBITSET_FIND))
|
if (!lbitset_elt_find (dst, windex, LBITSET_FIND))
|
||||||
return;
|
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... */
|
/* If all the data is zero, perhaps we should unlink it now... */
|
||||||
}
|
}
|
||||||
@@ -951,7 +953,7 @@ lbitset_op1 (dst, op)
|
|||||||
{
|
{
|
||||||
/* Create new elements if they cannot be found. */
|
/* Create new elements if they cannot be found. */
|
||||||
elt = lbitset_elt_find (dst, i, LBITSET_CREATE);
|
elt = lbitset_elt_find (dst, i, LBITSET_CREATE);
|
||||||
memset (elt->words, ~0, sizeof (elt->words));
|
memset (elt->words, -1, sizeof (elt->words));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user