mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
* lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
* lib/bitset_stats.c (bitset_stats_init): Likewise. * lib/bitsetv.c (bitsetv_alloc): Likewise.
This commit is contained in:
@@ -138,7 +138,7 @@ bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
|
|||||||
|
|
||||||
bytes = bitset_bytes (type, n_bits);
|
bytes = bitset_bytes (type, n_bits);
|
||||||
|
|
||||||
bset = (bitset) xcalloc (1, bytes);
|
bset = xcalloc (1, bytes);
|
||||||
|
|
||||||
/* The cache is disabled until some elements are allocated. If we
|
/* The cache is disabled until some elements are allocated. If we
|
||||||
have variable length arrays, then we may need to allocate a dummy
|
have variable length arrays, then we may need to allocate a dummy
|
||||||
|
|||||||
@@ -698,25 +698,25 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
|
|||||||
{
|
{
|
||||||
case BITSET_ARRAY:
|
case BITSET_ARRAY:
|
||||||
bytes = abitset_bytes (n_bits);
|
bytes = abitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
abitset_init (sbset, n_bits);
|
abitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_LIST:
|
case BITSET_LIST:
|
||||||
bytes = lbitset_bytes (n_bits);
|
bytes = lbitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
lbitset_init (sbset, n_bits);
|
lbitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_TABLE:
|
case BITSET_TABLE:
|
||||||
bytes = ebitset_bytes (n_bits);
|
bytes = ebitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
ebitset_init (sbset, n_bits);
|
ebitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_VARRAY:
|
case BITSET_VARRAY:
|
||||||
bytes = vbitset_bytes (n_bits);
|
bytes = vbitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
vbitset_init (sbset, n_bits);
|
vbitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
|
|||||||
/* Allocate vector table at head of bitset array. */
|
/* Allocate vector table at head of bitset array. */
|
||||||
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
|
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
|
||||||
vector_bytes -= vector_bytes % bytes;
|
vector_bytes -= vector_bytes % bytes;
|
||||||
bsetv = (bitset *) xcalloc (1, vector_bytes + bytes * n_vecs);
|
bsetv = xcalloc (1, vector_bytes + bytes * n_vecs);
|
||||||
|
|
||||||
for (i = 0; i < n_vecs; i++)
|
for (i = 0; i < n_vecs; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user