diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-05-14 11:16:04 -0700 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-11-19 19:26:07 -0500 |
commit | 0f7b9136ed566f4a79b2d6ca33299babcce3049e (patch) | |
tree | 4d7e50ccc92c0917ec491c23aadaf93b5b0c5047 /src/dfa.c | |
parent | 09eae589d3954a1e1206aa01108ee75ef57776da (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/dfa.c')
-rw-r--r-- | src/dfa.c | 34 |
1 files changed, 10 insertions, 24 deletions
@@ -49,9 +49,7 @@ int symfollowset PROTO ((int[], int, int, int[])); * indexed by equivalence class. */ -void check_for_backing_up (ds, state) - int ds; - int state[]; +void check_for_backing_up (int ds, int state[]) { if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */ ++num_backing_up; @@ -96,10 +94,7 @@ void check_for_backing_up (ds, state) * accset[1 .. nacc] is the list of accepting numbers for the DFA state. */ -void check_trailing_context (nfa_states, num_states, accset, nacc) - int *nfa_states, num_states; - int *accset; - int nacc; +void check_trailing_context (int *nfa_states, int num_states, int *accset, int nacc) { int i, j; @@ -137,9 +132,7 @@ void check_trailing_context (nfa_states, num_states, accset, nacc) * and writes a report to the given file. */ -void dump_associated_rules (file, ds) - FILE *file; - int ds; +void dump_associated_rules (FILE *file, int ds) { int i, j; int num_associated_rules = 0; @@ -187,9 +180,7 @@ void dump_associated_rules (file, ds) * is done to the given file. */ -void dump_transitions (file, state) - FILE *file; - int state[]; +void dump_transitions (FILE *file, int state[]) { int i, ec; int out_char_set[CSIZE]; @@ -235,8 +226,7 @@ void dump_transitions (file, state) * hashval is the hash value for the dfa corresponding to the state set. */ -int *epsclosure (t, ns_addr, accset, nacc_addr, hv_addr) - int *t, *ns_addr, accset[], *nacc_addr, *hv_addr; +int *epsclosure (int *t, int *ns_addr, int accset[], int *nacc_addr, int *hv_addr) { int stkpos, ns, tsp; int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum; @@ -351,7 +341,7 @@ ADD_STATE(state); \ /* increase_max_dfas - increase the maximum number of DFAs */ -void increase_max_dfas () +void increase_max_dfas (void) { current_max_dfas += MAX_DFAS_INCREMENT; @@ -378,7 +368,7 @@ void increase_max_dfas () * dfa starts out in state #1. */ -void ntod () +void ntod (void) { int *accset, ds, nacc, newds; int sym, hashval, numstates, dsize; @@ -820,8 +810,7 @@ void ntod () * On return, the dfa state number is in newds. */ -int snstods (sns, numstates, accset, nacc, hashval, newds_addr) - int sns[], numstates, accset[], nacc, hashval, *newds_addr; +int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int *newds_addr) { int didsort = 0; int i, j; @@ -942,8 +931,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) * int transsym, int nset[current_max_dfa_size] ); */ -int symfollowset (ds, dsize, transsym, nset) - int ds[], dsize, transsym, nset[]; +int symfollowset (int ds[], int dsize, int transsym, int nset[]) { int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist; @@ -1020,9 +1008,7 @@ int symfollowset (ds, dsize, transsym, nset) * int symlist[numecs], int duplist[numecs] ); */ -void sympartition (ds, numstates, symlist, duplist) - int ds[], numstates; - int symlist[], duplist[]; +void sympartition (int ds[], int numstates, int symlist[], int duplist[]) { int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich; |