]> granicus.if.org Git - flex/commitdiff
declared void functions as such
authorVern Paxson <vern@ee.lbl.gov>
Sat, 26 May 1990 16:51:47 +0000 (16:51 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sat, 26 May 1990 16:51:47 +0000 (16:51 +0000)
added prototypes for forward references

nfa.c
tblcmp.c

diff --git a/nfa.c b/nfa.c
index f17126cdcae8fe3a01fdd45fbd6db75376b0e820..a6def314a9f0ebcb5e7ac32b73792ed4a733a31f 100644 (file)
--- a/nfa.c
+++ b/nfa.c
@@ -37,6 +37,13 @@ static char rcsid[] =
 
 #include "flexdef.h"
 
+
+/* declare functions that have forward references */
+
+int dupmachine PROTO((int));
+void mkxtion PROTO((int, int));
+
+
 /* add_accept - add an accepting state to a machine
  *
  * synopsis
@@ -46,8 +53,8 @@ static char rcsid[] =
  * accepting_number becomes mach's accepting number.
  */
 
-add_accept( mach, accepting_number )
-int mach;
+void add_accept( mach, accepting_number )
+int mach, accepting_number;
 
     {
     /* hang the accepting number off an epsilon state.  if it is associated
@@ -101,7 +108,7 @@ int singl, num;
  *    dumpnfa( state1 );
  */
 
-dumpnfa( state1 )
+void dumpnfa( state1 )
 int state1;
 
     {
@@ -191,6 +198,7 @@ int mach;
     return ( init );
     }
 
+
 /* finish_rule - finish up the processing for a rule
  *
  * synopsis
@@ -207,7 +215,7 @@ int mach;
  * context has variable length.
  */
 
-finish_rule( mach, variable_trail_rule, headcnt, trailcnt )
+void finish_rule( mach, variable_trail_rule, headcnt, trailcnt )
 int mach, variable_trail_rule, headcnt, trailcnt;
 
     {
@@ -318,7 +326,7 @@ int first, last;
  * The "beginning" states are the epsilon closure of the first state
  */
 
-mark_beginning_as_normal( mach )
+void mark_beginning_as_normal( mach )
 register int mach;
 
     {
@@ -666,7 +674,7 @@ int sym;
  *     stateto   - the state to which the transition is to be made
  */
 
-mkxtion( statefrom, stateto )
+void mkxtion( statefrom, stateto )
 int statefrom, stateto;
 
     {
@@ -694,7 +702,7 @@ int statefrom, stateto;
  * arrays (such as rule_type[]) are grown as needed.
  */
 
-new_rule()
+void new_rule()
 
     {
     if ( ++num_rules >= current_max_rules )
index 2ffb38db470f1d240b6008cc351bb2a35cf10b8c..dbdf28f50b123a8e3074a5b065f94a49b779a9ac 100644 (file)
--- a/tblcmp.c
+++ b/tblcmp.c
@@ -37,6 +37,16 @@ static char rcsid[] =
 
 #include "flexdef.h"
 
+
+/* declarations for functions that have forward references */
+
+void mkentry PROTO((register int*, int, int, int, int));
+void mkprot PROTO((int[], int, int));
+void mktemplate PROTO((int[], int, int));
+void mv2front PROTO((int));
+int tbldiff PROTO((int[], int, int[]));
+
+
 /* bldtbl - build table entries for dfa state
  *
  * synopsis
@@ -72,7 +82,7 @@ static char rcsid[] =
  * cost only one difference.
  */
 
-bldtbl( state, statenum, totaltrans, comstate, comfreq )
+void bldtbl( state, statenum, totaltrans, comstate, comfreq )
 int state[], statenum, totaltrans, comstate, comfreq;
 
     {
@@ -218,7 +228,7 @@ int state[], statenum, totaltrans, comstate, comfreq;
  *  table entries made for them.
  */
 
-cmptmps()
+void cmptmps()
 
     {
     int tmpstorage[CSIZE + 1];
@@ -290,7 +300,7 @@ cmptmps()
 
 /* expand_nxt_chk - expand the next check arrays */
 
-expand_nxt_chk()
+void expand_nxt_chk()
 
     {
     register int old_max = current_max_xpairs;
@@ -424,7 +434,7 @@ int *state, numtrans;
  * own tbase/tdef tables.  They are shifted down to be contiguous
  * with the non-template entries during table generation.
  */
-inittbl()
+void inittbl()
 
     {
     register int i;
@@ -461,7 +471,7 @@ inittbl()
  *   mkdeftbl();
  */
 
-mkdeftbl()
+void mkdeftbl()
 
     {
     int i;
@@ -512,7 +522,7 @@ mkdeftbl()
  * state array.
  */
 
-mkentry( state, numchars, statenum, deflink, totaltrans )
+void mkentry( state, numchars, statenum, deflink, totaltrans )
 register int *state;
 int numchars, statenum, deflink, totaltrans;
 
@@ -645,7 +655,7 @@ int numchars, statenum, deflink, totaltrans;
  *   mk1tbl( state, sym, onenxt, onedef );
  */
 
-mk1tbl( state, sym, onenxt, onedef )
+void mk1tbl( state, sym, onenxt, onedef )
 int state, sym, onenxt, onedef;
 
     {
@@ -678,7 +688,7 @@ int state, sym, onenxt, onedef;
  *   mkprot( state, statenum, comstate );
  */
 
-mkprot( state, statenum, comstate )
+void mkprot( state, statenum, comstate )
 int state[], statenum, comstate;
 
     {
@@ -722,7 +732,7 @@ int state[], statenum, comstate;
  *   mktemplate( state, statenum, comstate, totaltrans );
  */
 
-mktemplate( state, statenum, comstate )
+void mktemplate( state, statenum, comstate )
 int state[], statenum, comstate;
 
     {
@@ -780,7 +790,7 @@ int state[], statenum, comstate;
  *   mv2front( qelm );
  */
 
-mv2front( qelm )
+void mv2front( qelm )
 int qelm;
 
     {
@@ -813,7 +823,7 @@ int qelm;
  * Transnum is the number of out-transitions for the state.
  */
 
-place_state( state, statenum, transnum )
+void place_state( state, statenum, transnum )
 int *state, statenum, transnum;
 
     {
@@ -859,7 +869,7 @@ int *state, statenum, transnum;
  * no room, we process the sucker right now.
  */
 
-stack1( statenum, sym, nextstate, deflink )
+void stack1( statenum, sym, nextstate, deflink )
 int statenum, sym, nextstate, deflink;
 
     {