From f0250de62e88cff12f9e5cb45b7757792a10e9fe Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 4 Mar 2002 13:56:41 +0000 Subject: [PATCH] * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c, * src/reduce.c: Remove the `bitset_zero's following the `bitset_create's, as now it is performed by the latter. --- ChangeLog | 7 +++++++ src/closure.c | 7 +------ src/conflicts.c | 2 -- src/lalr.c | 10 ++-------- src/print.c | 2 -- src/reduce.c | 7 ------- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46fed1c7..9555475f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-03-04 Akim Demaille + + * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c, + * src/reduce.c: Remove the `bitset_zero's following the + `bitset_create's, as now it is performed by the latter. + + 2002-03-04 Akim Demaille * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h, diff --git a/src/closure.c b/src/closure.c index ab745b8d..b20e98c0 100644 --- a/src/closure.c +++ b/src/closure.c @@ -124,7 +124,6 @@ set_firsts (void) for (i = ntokens; i < nsyms; i++) { FIRSTS (i) = bitset_create (nvars, BITSET_FIXED); - bitset_zero (FIRSTS (i)); for (j = 0; derives[i][j] >= 0; ++j) { int symbol = ritem[rules[derives[i][j]].rhs]; @@ -157,10 +156,7 @@ set_fderives (void) fderives = XCALLOC (bitset, nvars); bitset_stats_init (); for (i = 0 ; i < nvars; ++i) - { - fderives[i] = bitset_create (nrules + 1, BITSET_FIXED); - bitset_zero (fderives[i]); - } + fderives[i] = bitset_create (nrules + 1, BITSET_FIXED); set_firsts (); @@ -185,7 +181,6 @@ new_closure (int n) itemset = XCALLOC (short, n); ruleset = bitset_create (nrules + 1, BITSET_FIXED); - bitset_zero (ruleset); set_fderives (); } diff --git a/src/conflicts.c b/src/conflicts.c index e08256a1..1cb7183f 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -203,9 +203,7 @@ solve_conflicts (void) conflicts = XCALLOC (char, nstates); shiftset = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (shiftset); lookaheadset = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (lookaheadset); for (i = 0; i < nstates; i++) set_conflicts (states[i]); diff --git a/src/lalr.c b/src/lalr.c index 5b2761c3..9dda7f05 100644 --- a/src/lalr.c +++ b/src/lalr.c @@ -141,10 +141,7 @@ initialize_LA (void) LA = XCALLOC (bitset, nLA); for (i = 0; i < nLA; ++i) - { - LA[i] = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (LA[i]); - } + LA[i] = bitset_create (ntokens, BITSET_FIXED); LAruleno = XCALLOC (short, nLA); lookback = XCALLOC (shorts *, nLA); @@ -258,10 +255,7 @@ initialize_F (void) F = XCALLOC (bitset, ngotos); for (i = 0; i < ngotos; ++i) - { - F[i] = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (F[i]); - } + F[i] = bitset_create (ntokens, BITSET_FIXED); for (i = 0; i < ngotos; i++) { diff --git a/src/print.c b/src/print.c index 6dd25096..7ea46bec 100644 --- a/src/print.c +++ b/src/print.c @@ -492,9 +492,7 @@ print_results (void) new_closure (nritems); /* Storage for print_reductions. */ shiftset = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (shiftset); lookaheadset = bitset_create (ntokens, BITSET_FIXED); - bitset_zero (lookaheadset); for (i = 0; i < nstates; i++) print_state (out, states[i]); bitset_free (shiftset); diff --git a/src/reduce.c b/src/reduce.c index 973e5ede..21a83b1a 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -103,7 +103,6 @@ useless_nonterminals (void) set of all productions which have a RHS all in N. */ Np = bitset_create (nvars, BITSET_FIXED); - bitset_zero (Np); /* The set being computed is a set of nonterminals which can derive @@ -175,9 +174,7 @@ inaccessable_symbols (void) user can know. */ Vp = bitset_create (nsyms, BITSET_FIXED); - bitset_zero (Vp); Pp = bitset_create (nrules + 1, BITSET_FIXED); - bitset_zero (Pp); /* If the start symbol isn't useful, then nothing will be useful. */ if (bitset_test (N, start_symbol - ntokens)) @@ -495,13 +492,9 @@ reduce_grammar (void) /* Allocate the global sets used to compute the reduced grammar */ N = bitset_create (nvars, BITSET_FIXED); - bitset_zero (N); P = bitset_create (nrules + 1, BITSET_FIXED); - bitset_zero (P); V = bitset_create (nsyms, BITSET_FIXED); - bitset_zero (V); V1 = bitset_create (nsyms, BITSET_FIXED); - bitset_zero (V1); useless_nonterminals (); inaccessable_symbols (); -- 2.45.2