CALLOC, MALLOC, REALLOC. All uses of XFREE changed to free.
-/* Generate the nondeterministic finite state machine for bison,
+/* Generate the nondeterministic finite state machine for Bison.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software
Foundation, Inc.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software
Foundation, Inc.
static state *
state_list_append (symbol_number sym, size_t core_size, item_number *core)
{
static state *
state_list_append (symbol_number sym, size_t core_size, item_number *core)
{
- state_list *node = XMALLOC (state_list, 1);
+ state_list *node = MALLOC (node, 1);
state *s = state_new (sym, core_size, core);
if (trace_flag & trace_automaton)
state *s = state_new (sym, core_size, core);
if (trace_flag & trace_automaton)
browsed too, hence we need to allocate room for _all_ the
symbols. */
int count = 0;
browsed too, hence we need to allocate room for _all_ the
symbols. */
int count = 0;
- short *symbol_count = XCALLOC (short, nsyms + nuseless_nonterminals);
+ short *symbol_count = CALLOC (symbol_count, nsyms + nuseless_nonterminals);
for (r = 0; r < nrules; ++r)
for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)
for (r = 0; r < nrules; ++r)
for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)
appears as an item, which is SYMBOL_COUNT[S].
We allocate that much space for each symbol. */
appears as an item, which is SYMBOL_COUNT[S].
We allocate that much space for each symbol. */
- kernel_base = XCALLOC (item_number *, nsyms);
+ CALLOC (kernel_base, nsyms);
- kernel_items = XCALLOC (item_number, count);
+ CALLOC (kernel_items, count);
count = 0;
for (i = 0; i < nsyms; i++)
count = 0;
for (i = 0; i < nsyms; i++)
- kernel_size = XCALLOC (int, nsyms);
+ CALLOC (kernel_size, nsyms);
- shiftset = XCALLOC (state *, nsyms);
- redset = XCALLOC (rule *, nrules);
+ CALLOC (shiftset, nsyms);
+ CALLOC (redset, nrules);
- shift_symbol = XCALLOC (symbol_number, nsyms);
+ CALLOC (shift_symbol, nsyms);
free (shiftset);
free (kernel_base);
free (kernel_size);
free (shiftset);
free (kernel_base);
free (kernel_size);
static void
set_states (void)
{
static void
set_states (void)
{
- states = XCALLOC (state *, nstates);
+ CALLOC (states, nstates);
{
state_number i;
/* List of lookaheads on which we explicitly raise a syntax error. */
{
state_number i;
/* List of lookaheads on which we explicitly raise a syntax error. */
- symbol **errors = XMALLOC (symbol *, ntokens + 1);
+ symbol **errors = MALLOC (errors, ntokens + 1);
- conflicts = XCALLOC (char, nstates);
+ CALLOC (conflicts, nstates);
shiftset = bitset_create (ntokens, BITSET_FIXED);
lookaheadset = bitset_create (ntokens, BITSET_FIXED);
obstack_init (&solved_conflicts_obstack);
shiftset = bitset_create (ntokens, BITSET_FIXED);
lookaheadset = bitset_create (ntokens, BITSET_FIXED);
obstack_init (&solved_conflicts_obstack);
void
conflicts_free (void)
{
void
conflicts_free (void)
{
bitset_free (shiftset);
bitset_free (lookaheadset);
obstack_free (&solved_conflicts_obstack, NULL);
bitset_free (shiftset);
bitset_free (lookaheadset);
obstack_free (&solved_conflicts_obstack, NULL);