summaryrefslogtreecommitdiff
path: root/src/nfa.c
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-05-14 11:16:04 -0700
committerWill Estes <westes575@gmail.com>2015-11-19 19:26:07 -0500
commit0f7b9136ed566f4a79b2d6ca33299babcce3049e (patch)
tree4d7e50ccc92c0917ec491c23aadaf93b5b0c5047 /src/nfa.c
parent09eae589d3954a1e1206aa01108ee75ef57776da (diff)
Switch function definitions from mixed K&R to consistent ANSI C.
flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/nfa.c')
-rw-r--r--src/nfa.c50
1 files changed, 17 insertions, 33 deletions
diff --git a/src/nfa.c b/src/nfa.c
index ee06578..b84a6e5 100644
--- a/src/nfa.c
+++ b/src/nfa.c
@@ -45,8 +45,7 @@ void mkxtion PROTO ((int, int));
* accepting_number becomes mach's accepting number.
*/
-void add_accept (mach, accepting_number)
- int mach, accepting_number;
+void add_accept (int mach, int accepting_number)
{
/* Hang the accepting number off an epsilon state. if it is associated
* with a state that has a non-epsilon out-transition, then the state
@@ -77,8 +76,7 @@ void add_accept (mach, accepting_number)
* num - the number of copies of singl to be present in newsng
*/
-int copysingl (singl, num)
- int singl, num;
+int copysingl (int singl, int num)
{
int copy, i;
@@ -93,9 +91,7 @@ int copysingl (singl, num)
/* dumpnfa - debugging routine to write out an nfa */
-void dumpnfa (state1)
- int state1;
-
+void dumpnfa (int state1)
{
int sym, tsp1, tsp2, anum, ns;
@@ -148,8 +144,7 @@ void dumpnfa (state1)
* states accessible by the arrays firstst and lastst
*/
-int dupmachine (mach)
- int mach;
+int dupmachine (int mach)
{
int i, init, state_offset;
int state = 0;
@@ -196,9 +191,8 @@ int dupmachine (mach)
* context has variable length.
*/
-void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
- pcont_act)
- int mach, variable_trail_rule, headcnt, trailcnt, pcont_act;
+void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt,
+ int pcont_act)
{
char action_text[MAXLINE];
@@ -312,8 +306,7 @@ void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
* FIRST is set to new by the operation. last is unmolested.
*/
-int link_machines (first, last)
- int first, last;
+int link_machines (int first, int last)
{
if (first == NIL)
return last;
@@ -339,8 +332,7 @@ int link_machines (first, last)
* The "beginning" states are the epsilon closure of the first state
*/
-void mark_beginning_as_normal (mach)
- int mach;
+void mark_beginning_as_normal (int mach)
{
switch (state_type[mach]) {
case STATE_NORMAL:
@@ -381,8 +373,7 @@ void mark_beginning_as_normal (mach)
* more mkbranch's. Compare with mkor()
*/
-int mkbranch (first, second)
- int first, second;
+int mkbranch (int first, int second)
{
int eps;
@@ -409,8 +400,7 @@ int mkbranch (first, second)
* new - a new state which matches the closure of "state"
*/
-int mkclos (state)
- int state;
+int mkclos (int state)
{
return mkopt (mkposcl (state));
}
@@ -430,8 +420,7 @@ int mkclos (state)
* 2. mach is destroyed by the call
*/
-int mkopt (mach)
- int mach;
+int mkopt (int mach)
{
int eps;
@@ -467,8 +456,7 @@ int mkopt (mach)
* the number of epsilon states needed
*/
-int mkor (first, second)
- int first, second;
+int mkor (int first, int second)
{
int eps, orend;
@@ -523,8 +511,7 @@ int mkor (first, second)
* new - a machine matching the positive closure of "state"
*/
-int mkposcl (state)
- int state;
+int mkposcl (int state)
{
int eps;
@@ -553,8 +540,7 @@ int mkposcl (state)
* if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach"
*/
-int mkrep (mach, lb, ub)
- int mach, lb, ub;
+int mkrep (int mach, int lb, int ub)
{
int base_mach, tail, copy, i;
@@ -600,8 +586,7 @@ int mkrep (mach, lb, ub)
* that it admittedly is)
*/
-int mkstate (sym)
- int sym;
+int mkstate (int sym)
{
if (++lastnfa >= current_mns) {
if ((current_mns += MNS_INCREMENT) >= maximum_mns)
@@ -677,8 +662,7 @@ current_mns);
* stateto - the state to which the transition is to be made
*/
-void mkxtion (statefrom, stateto)
- int statefrom, stateto;
+void mkxtion (int statefrom, int stateto)
{
if (trans1[statefrom] == NO_TRANSITION)
trans1[statefrom] = stateto;
@@ -695,7 +679,7 @@ void mkxtion (statefrom, stateto)
/* new_rule - initialize for a new rule */
-void new_rule ()
+void new_rule (void)
{
if (++num_rules >= current_max_rules) {
++num_reallocs;