diff --git a/src/flexdef.h b/src/flexdef.h index 0852fd684..1127a4157 100644 --- a/src/flexdef.h +++ b/src/flexdef.h @@ -455,7 +455,7 @@ extern struct env_bundle_t env; * reject_really_used - same for REJECT */ -extern int syntaxerror, eofseen; +extern bool syntaxerror, eofseen; extern int yymore_used, reject, real_reject, continued_action, in_rule; /* Variables used in the flex input routines: @@ -568,7 +568,7 @@ extern int current_state_type; /* True if the input rules include a rule with both variable-length head * and trailing context, false otherwise. */ -extern int variable_trailing_context_rules; +extern bool variable_trailing_context_rules; /* Variables for protos: @@ -945,7 +945,7 @@ extern int copysingl(int, int); extern void dumpnfa(int); /* Finish up the processing for a rule. */ -extern void finish_rule(int, int, int, int, int); +extern void finish_rule(int, bool, int, int, int); /* Connect two machines together. */ extern int link_machines(int, int); diff --git a/src/main.c b/src/main.c index d2b688a71..c3f18f702 100644 --- a/src/main.c +++ b/src/main.c @@ -47,7 +47,7 @@ void readin(void); void set_up_initial_allocations(void); /* these globals are all defined and commented in flexdef.h */ -int syntaxerror, eofseen; +bool syntaxerror, eofseen; int yymore_used, reject, real_reject, continued_action, in_rule; int datapos, dataline, linenum; FILE *skelfile = NULL; @@ -65,7 +65,7 @@ int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2; int *accptnum, *assoc_rule, *state_type; int *rule_type, *rule_linenum, *rule_useful; int current_state_type; -int variable_trailing_context_rules; +bool variable_trailing_context_rules; int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP]; int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE]; int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, @@ -1166,7 +1166,8 @@ void flexinit (int argc, char **argv) numas = numsnpairs = tmpuses = 0; numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0; - numuniq = numdup = hshsave = eofseen = datapos = dataline = 0; + numuniq = numdup = hshsave = datapos = dataline = 0; + eofseen = false; num_backing_up = onesp = numprots = 0; variable_trailing_context_rules = bol_needed = false; diff --git a/src/nfa.c b/src/nfa.c index 47faecc6d..16e32a723 100644 --- a/src/nfa.c +++ b/src/nfa.c @@ -191,7 +191,7 @@ int dupmachine (int mach) * context has variable length. */ -void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt, +void finish_rule (int mach, bool variable_trail_rule, int headcnt, int trailcnt, int pcont_act) { char action_text[MAXLINE]; diff --git a/src/parse.y b/src/parse.y index 1b0d64b4d..7d8a3ef3b 100644 --- a/src/parse.y +++ b/src/parse.y @@ -68,7 +68,9 @@ #include "tables.h" int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen; -int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule; +static int currccl; +bool trlcontxt; +static bool xcluflg, cclsorted, varlength, variable_trail_rule; int *scon_stk; int scon_stk_ptr; diff --git a/src/scan.l b/src/scan.l index 9fd3453e9..53e249873 100644 --- a/src/scan.l +++ b/src/scan.l @@ -40,7 +40,7 @@ #include "parse.h" extern bool tablesverify, tablesext; -extern int trlcontxt; /* Set in parse.y for each rule. */ +extern bool trlcontxt; /* Set in parse.y for each rule. */ extern const char *escaped_qstart, *escaped_qend; #define M4QSTART "[""[" @@ -155,10 +155,10 @@ void context_member(char *, const char *); %} %% static int bracelevel, didadef, indented_code; - static int doing_rule_action = false; - static int option_sense; + static bool doing_rule_action = false; + static bool option_sense; - int doing_codeblock = false; + static bool doing_codeblock = false; int brace_depth=0, brace_start_line=0; char nmdef[MAXLINE]; @@ -395,7 +395,7 @@ void context_member(char *, const char *); main { ctrl.do_main = option_sense; /* Override yywrap */ - if( option_sense == true ) + if (option_sense) ctrl.do_yywrap = false; } meta-ecs ctrl.usemecs = option_sense; @@ -471,7 +471,7 @@ void context_member(char *, const char *); tables-file return TOK_TABLES_FILE; tables-verify { tablesverify = option_sense; - if(!tablesext && option_sense) + if (!tablesext && option_sense) tablesext = true; } diff --git a/src/yylex.c b/src/yylex.c index 9a2e59f83..32fdfd858 100644 --- a/src/yylex.c +++ b/src/yylex.c @@ -51,7 +51,7 @@ int yylex (void) toktype = flexscan (); } if (toktype == EOF || toktype == 0) { - eofseen = 1; + eofseen = true; if (sectnum == 1) { synerr (_("premature EOF"));