From: Paul Eggert Date: Tue, 22 Oct 2002 04:46:28 +0000 (+0000) Subject: Use C99-style bool instead of our own style. X-Git-Tag: BISON-1_875~407 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/8307162d58343d40c8e6630326575edd71771957 Use C99-style bool instead of our own style. --- diff --git a/src/conflicts.c b/src/conflicts.c index 24f27cc8..3b4ab7d6 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -450,7 +450,7 @@ conflict_report_yacc (int src_num, int rrc_num) void conflicts_output (FILE *out) { - bool printed_sth = FALSE; + bool printed_sth = false; state_number_t i; for (i = 0; i < nstates; i++) { @@ -460,8 +460,8 @@ conflicts_output (FILE *out) fprintf (out, _("State %d contains "), i); fprintf (out, "%s.\n", conflict_report (count_sr_conflicts (s), - count_rr_conflicts (s, TRUE))); - printed_sth = TRUE; + count_rr_conflicts (s, true))); + printed_sth = true; } } if (printed_sth) @@ -487,7 +487,7 @@ conflicts_total_count (void) if (conflicts[i]) { count += count_sr_conflicts (states[i]); - count += count_rr_conflicts (states[i], FALSE); + count += count_rr_conflicts (states[i], false); } return count; } @@ -516,7 +516,7 @@ conflicts_print (void) if (conflicts[i]) { src_total += count_sr_conflicts (states[i]); - rrc_total += count_rr_conflicts (states[i], TRUE); + rrc_total += count_rr_conflicts (states[i], true); } } diff --git a/src/print.c b/src/print.c index 6e11dfb5..ae2ead9a 100644 --- a/src/print.c +++ b/src/print.c @@ -366,7 +366,7 @@ print_reductions (FILE *out, state_t *state) if (redp->rules[j] != default_rule) print_reduction (out, width, symbols[i]->tag, - redp->rules[j], TRUE); + redp->rules[j], true); else defaulted = 1; count++; @@ -376,18 +376,18 @@ print_reductions (FILE *out, state_t *state) if (defaulted) print_reduction (out, width, symbols[i]->tag, - default_rule, TRUE); + default_rule, true); defaulted = 0; print_reduction (out, width, symbols[i]->tag, - redp->rules[j], FALSE); + redp->rules[j], false); } } } if (default_rule) print_reduction (out, width, - _("$default"), default_rule, TRUE); + _("$default"), default_rule, true); } @@ -400,11 +400,11 @@ static void print_actions (FILE *out, state_t *state) { /* Print shifts. */ - print_transitions (state, out, TRUE); + print_transitions (state, out, true); print_errs (out, state); print_reductions (out, state); /* Print gotos. */ - print_transitions (state, out, FALSE); + print_transitions (state, out, false); } diff --git a/src/reduce.c b/src/reduce.c index 7bbd8954..3b19cc12 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -71,8 +71,8 @@ useful_production (rule_number_t r, bitset N0) for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp) if (ISVAR (*rhsp) && !bitset_test (N0, *rhsp - ntokens)) - return FALSE; - return TRUE; + return false; + return true; } @@ -353,14 +353,14 @@ reduce_output (FILE *out) } { - bool b = FALSE; + bool b = false; int i; for (i = 0; i < ntokens; i++) if (!bitset_test (V, i) && !bitset_test (V1, i)) { if (!b) fprintf (out, "%s\n\n", _("Terminals which are not used")); - b = TRUE; + b = true; fprintf (out, " %s\n", symbols[i]->tag); } if (b) diff --git a/src/state.c b/src/state.c index 71914025..b258ceeb 100644 --- a/src/state.c +++ b/src/state.c @@ -266,13 +266,13 @@ state_compare (const state_t *s1, const state_t *s2) int i; if (s1->nitems != s2->nitems) - return FALSE; + return false; for (i = 0; i < s1->nitems; ++i) if (s1->items[i] != s2->items[i]) - return FALSE; + return false; - return TRUE; + return true; } static unsigned int diff --git a/src/tables.c b/src/tables.c index 0b4fd275..333e789c 100644 --- a/src/tables.c +++ b/src/tables.c @@ -418,7 +418,7 @@ token_actions (void) /* Find the rules which are reduced. */ if (!glr_parser) for (r = 0; r < nrules; ++r) - rules[r].useful = FALSE; + rules[r].useful = false; for (i = 0; i < nstates; ++i) { @@ -433,9 +433,9 @@ token_actions (void) { for (j = 0; j < ntokens; ++j) if (actrow[j] < 0 && actrow[j] != ACTION_MIN) - rules[item_number_as_rule_number (actrow[j])].useful = TRUE; + rules[item_number_as_rule_number (actrow[j])].useful = true; if (yydefact[i]) - rules[yydefact[i] - 1].useful = TRUE; + rules[yydefact[i] - 1].useful = true; } }