aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2010-11-07 22:51:54 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2010-11-07 22:51:54 +0000
commitf5015507b07855af4eb8eb6fff313f49b6cc3797 (patch)
treea63a6ed3b06ef82be22f83c6c1605999ba845645 /usr.bin/yacc
parentbb595df94d70fe6803a463290d6e60e20e4c7c85 (diff)
downloadsrc-f5015507b07855af4eb8eb6fff313f49b6cc3797.tar.gz
src-f5015507b07855af4eb8eb6fff313f49b6cc3797.zip
Change to ANSI-C function definitions.
Notes
Notes: svn path=/head/; revision=214959
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/Makefile2
-rw-r--r--usr.bin/yacc/closure.c17
-rw-r--r--usr.bin/yacc/error.c108
-rw-r--r--usr.bin/yacc/lalr.c42
-rw-r--r--usr.bin/yacc/lr0.c42
-rw-r--r--usr.bin/yacc/main.c21
-rw-r--r--usr.bin/yacc/mkpar.c34
-rw-r--r--usr.bin/yacc/output.c58
-rw-r--r--usr.bin/yacc/reader.c83
-rw-r--r--usr.bin/yacc/skeleton.c3
-rw-r--r--usr.bin/yacc/symtab.c15
-rw-r--r--usr.bin/yacc/verbose.c31
-rw-r--r--usr.bin/yacc/warshall.c8
13 files changed, 182 insertions, 282 deletions
diff --git a/usr.bin/yacc/Makefile b/usr.bin/yacc/Makefile
index c2f31a78fe19..621cb7449c2e 100644
--- a/usr.bin/yacc/Makefile
+++ b/usr.bin/yacc/Makefile
@@ -9,6 +9,6 @@ MAN= yacc.1 yyfix.1
LINKS= ${BINDIR}/yacc ${BINDIR}/byacc
MLINKS= yacc.1 byacc.1
-WARNS?= 2
+WARNS?= 6
.include <bsd.prog.mk>
diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c
index 2124417f5c5d..9b7ed80cfb5c 100644
--- a/usr.bin/yacc/closure.c
+++ b/usr.bin/yacc/closure.c
@@ -62,7 +62,7 @@ static unsigned *EFF;
static void
-set_EFF()
+set_EFF(void)
{
unsigned *row;
int symbol;
@@ -99,7 +99,7 @@ set_EFF()
void
-set_first_derives()
+set_first_derives(void)
{
unsigned *rrow;
unsigned *vrow;
@@ -154,9 +154,7 @@ set_first_derives()
void
-closure(nucleus, n)
-short *nucleus;
-int n;
+closure(short *nucleus, int n)
{
int ruleno;
unsigned word;
@@ -224,7 +222,7 @@ int n;
void
-finalize_closure()
+finalize_closure(void)
{
FREE(itemset);
FREE(ruleset);
@@ -235,8 +233,7 @@ finalize_closure()
#ifdef DEBUG
static void
-print_closure(n)
-int n;
+print_closure(int n)
{
short *isp;
@@ -247,7 +244,7 @@ int n;
static void
-print_EFF()
+print_EFF(void)
{
int i, j;
unsigned *rowp;
@@ -279,7 +276,7 @@ print_EFF()
static void
-print_first_derives()
+print_first_derives(void)
{
int i;
int j;
diff --git a/usr.bin/yacc/error.c b/usr.bin/yacc/error.c
index 9940dbc050c5..ed269b6886fa 100644
--- a/usr.bin/yacc/error.c
+++ b/usr.bin/yacc/error.c
@@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$");
static void print_pos(char *, char *);
void
-fatal(msg)
-const char *msg;
+fatal(const char *msg)
{
warnx("f - %s", msg);
done(2);
@@ -58,7 +57,7 @@ const char *msg;
void
-no_space()
+no_space(void)
{
warnx("f - out of space");
done(2);
@@ -66,8 +65,7 @@ no_space()
void
-open_error(filename)
-const char *filename;
+open_error(const char *filename)
{
warnx("f - cannot open \"%s\"", filename);
done(2);
@@ -75,7 +73,7 @@ const char *filename;
void
-unexpected_EOF()
+unexpected_EOF(void)
{
warnx("e - line %d of \"%s\", unexpected end-of-file",
lineno, input_file_name);
@@ -84,9 +82,7 @@ unexpected_EOF()
static void
-print_pos(st_line, st_cptr)
-char *st_line;
-char *st_cptr;
+print_pos(char *st_line, char *st_cptr)
{
char *s;
@@ -112,10 +108,7 @@ char *st_cptr;
void
-syntax_error(st_lineno, st_line, st_cptr)
-int st_lineno;
-char *st_line;
-char *st_cptr;
+syntax_error(int st_lineno, char *st_line, char *st_cptr)
{
warnx("e - line %d of \"%s\", syntax error",
st_lineno, input_file_name);
@@ -125,10 +118,7 @@ char *st_cptr;
void
-unterminated_comment(c_lineno, c_line, c_cptr)
-int c_lineno;
-char *c_line;
-char *c_cptr;
+unterminated_comment(int c_lineno, char *c_line, char *c_cptr)
{
warnx("e - line %d of \"%s\", unmatched /*",
c_lineno, input_file_name);
@@ -138,10 +128,7 @@ char *c_cptr;
void
-unterminated_string(s_lineno, s_line, s_cptr)
-int s_lineno;
-char *s_line;
-char *s_cptr;
+unterminated_string(int s_lineno, char *s_line, char *s_cptr)
{
warnx("e - line %d of \"%s\", unterminated string",
s_lineno, input_file_name);
@@ -151,10 +138,7 @@ char *s_cptr;
void
-unterminated_text(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
+unterminated_text(int t_lineno, char *t_line, char *t_cptr)
{
warnx("e - line %d of \"%s\", unmatched %%{",
t_lineno, input_file_name);
@@ -164,10 +148,7 @@ char *t_cptr;
void
-unterminated_union(u_lineno, u_line, u_cptr)
-int u_lineno;
-char *u_line;
-char *u_cptr;
+unterminated_union(int u_lineno, char *u_line, char *u_cptr)
{
warnx("e - line %d of \"%s\", unterminated %%union declaration",
u_lineno, input_file_name);
@@ -177,8 +158,7 @@ char *u_cptr;
void
-over_unionized(u_cptr)
-char *u_cptr;
+over_unionized(char *u_cptr)
{
warnx("e - line %d of \"%s\", too many %%union declarations",
lineno, input_file_name);
@@ -188,10 +168,7 @@ char *u_cptr;
void
-illegal_tag(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
+illegal_tag(int t_lineno, char *t_line, char *t_cptr)
{
warnx("e - line %d of \"%s\", illegal tag", t_lineno, input_file_name);
print_pos(t_line, t_cptr);
@@ -200,8 +177,7 @@ char *t_cptr;
void
-illegal_character(c_cptr)
-char *c_cptr;
+illegal_character(char *c_cptr)
{
warnx("e - line %d of \"%s\", illegal character", lineno, input_file_name);
print_pos(line, c_cptr);
@@ -210,8 +186,7 @@ char *c_cptr;
void
-used_reserved(s)
-char *s;
+used_reserved(char *s)
{
warnx("e - line %d of \"%s\", illegal use of reserved symbol %s",
lineno, input_file_name, s);
@@ -220,8 +195,7 @@ char *s;
void
-tokenized_start(s)
-char *s;
+tokenized_start(char *s)
{
warnx("e - line %d of \"%s\", the start symbol %s cannot be \
declared to be a token", lineno, input_file_name, s);
@@ -230,8 +204,7 @@ declared to be a token", lineno, input_file_name, s);
void
-retyped_warning(s)
-char *s;
+retyped_warning(char *s)
{
warnx("w - line %d of \"%s\", the type of %s has been redeclared",
lineno, input_file_name, s);
@@ -239,8 +212,7 @@ char *s;
void
-reprec_warning(s)
-char *s;
+reprec_warning(char *s)
{
warnx("w - line %d of \"%s\", the precedence of %s has been redeclared",
lineno, input_file_name, s);
@@ -248,8 +220,7 @@ char *s;
void
-revalued_warning(s)
-char *s;
+revalued_warning(char *s)
{
warnx("w - line %d of \"%s\", the value of %s has been redeclared",
lineno, input_file_name, s);
@@ -257,8 +228,7 @@ char *s;
void
-terminal_start(s)
-char *s;
+terminal_start(char *s)
{
warnx("e - line %d of \"%s\", the start symbol %s is a token",
lineno, input_file_name, s);
@@ -267,7 +237,7 @@ char *s;
void
-restarted_warning()
+restarted_warning(void)
{
warnx("w - line %d of \"%s\", the start symbol has been redeclared",
lineno, input_file_name);
@@ -275,7 +245,7 @@ restarted_warning()
void
-no_grammar()
+no_grammar(void)
{
warnx("e - line %d of \"%s\", no grammar has been specified",
lineno, input_file_name);
@@ -284,8 +254,7 @@ no_grammar()
void
-terminal_lhs(s_lineno)
-int s_lineno;
+terminal_lhs(int s_lineno)
{
warnx("e - line %d of \"%s\", a token appears on the lhs of a production",
s_lineno, input_file_name);
@@ -294,7 +263,7 @@ int s_lineno;
void
-prec_redeclared()
+prec_redeclared(void)
{
warnx("w - line %d of \"%s\", conflicting %%prec specifiers",
lineno, input_file_name);
@@ -302,10 +271,7 @@ prec_redeclared()
void
-unterminated_action(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
+unterminated_action(int a_lineno, char *a_line, char *a_cptr)
{
warnx("e - line %d of \"%s\", unterminated action",
a_lineno, input_file_name);
@@ -315,9 +281,7 @@ char *a_cptr;
void
-dollar_warning(a_lineno, i)
-int a_lineno;
-int i;
+dollar_warning(int a_lineno, int i)
{
warnx("w - line %d of \"%s\", $%d references beyond the \
end of the current rule", a_lineno, input_file_name, i);
@@ -325,10 +289,7 @@ end of the current rule", a_lineno, input_file_name, i);
void
-dollar_error(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
+dollar_error(int a_lineno, char *a_line, char *a_cptr)
{
warnx("e - line %d of \"%s\", illegal $-name", a_lineno, input_file_name);
print_pos(a_line, a_cptr);
@@ -337,7 +298,7 @@ char *a_cptr;
void
-untyped_lhs()
+untyped_lhs(void)
{
warnx("e - line %d of \"%s\", $$ is untyped", lineno, input_file_name);
done(1);
@@ -345,9 +306,7 @@ untyped_lhs()
void
-untyped_rhs(i, s)
-int i;
-char *s;
+untyped_rhs(int i, char *s)
{
warnx("e - line %d of \"%s\", $%d (%s) is untyped",
lineno, input_file_name, i, s);
@@ -356,8 +315,7 @@ char *s;
void
-unknown_rhs(i)
-int i;
+unknown_rhs(int i)
{
warnx("e - line %d of \"%s\", $%d is untyped", lineno, input_file_name, i);
done(1);
@@ -365,7 +323,7 @@ int i;
void
-default_action_warning()
+default_action_warning(void)
{
warnx("w - line %d of \"%s\", the default action assigns an \
undefined value to $$", lineno, input_file_name);
@@ -373,8 +331,7 @@ undefined value to $$", lineno, input_file_name);
void
-undefined_goal(s)
-char *s;
+undefined_goal(char *s)
{
warnx("e - the start symbol %s is undefined", s);
done(1);
@@ -382,8 +339,7 @@ char *s;
void
-undefined_symbol_warning(s)
-char *s;
+undefined_symbol_warning(char *s)
{
warnx("w - the symbol %s is undefined", s);
}
diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c
index 95d87de2dc1e..21bae484963d 100644
--- a/usr.bin/yacc/lalr.c
+++ b/usr.bin/yacc/lalr.c
@@ -96,7 +96,7 @@ static int top;
void
-lalr()
+lalr(void)
{
tokensetsize = WORDSIZE(ntokens);
@@ -116,7 +116,7 @@ lalr()
static void
-set_state_table()
+set_state_table(void)
{
core *sp;
@@ -128,7 +128,7 @@ set_state_table()
static void
-set_accessing_symbol()
+set_accessing_symbol(void)
{
core *sp;
@@ -140,7 +140,7 @@ set_accessing_symbol()
static void
-set_shift_table()
+set_shift_table(void)
{
shifts *sp;
@@ -152,7 +152,7 @@ set_shift_table()
static void
-set_reduction_table()
+set_reduction_table(void)
{
reductions *rp;
@@ -164,7 +164,7 @@ set_reduction_table()
static void
-set_maxrhs()
+set_maxrhs(void)
{
short *itemp;
short *item_end;
@@ -193,7 +193,7 @@ set_maxrhs()
static void
-initialize_LA()
+initialize_LA(void)
{
int i, j, k;
reductions *rp;
@@ -231,7 +231,7 @@ initialize_LA()
static void
-set_goto_map()
+set_goto_map(void)
{
shifts *sp;
int i;
@@ -301,9 +301,7 @@ set_goto_map()
/* Map_goto maps a state/symbol pair into its numeric representation. */
static int
-map_goto(state, symbol)
-int state;
-int symbol;
+map_goto(int state, int symbol)
{
int high;
int low;
@@ -330,7 +328,7 @@ int symbol;
static void
-initialize_F()
+initialize_F(void)
{
int i;
int j;
@@ -408,7 +406,7 @@ initialize_F()
static void
-build_relations()
+build_relations(void)
{
int i;
int j;
@@ -501,8 +499,7 @@ build_relations()
static void
-add_lookback_edge(stateno, ruleno, gotono)
-int stateno, ruleno, gotono;
+add_lookback_edge(int stateno, int ruleno, int gotono)
{
int i, k;
int found;
@@ -529,9 +526,7 @@ int stateno, ruleno, gotono;
static short **
-transpose(R, n)
-short **R;
-int n;
+transpose(short **R, int n)
{
short **new_R;
short **temp_R;
@@ -587,14 +582,14 @@ int n;
static void
-compute_FOLLOWS()
+compute_FOLLOWS(void)
{
digraph(includes);
}
static void
-compute_lookaheads()
+compute_lookaheads(void)
{
int i, n;
unsigned *fp1, *fp2, *fp3;
@@ -629,8 +624,7 @@ compute_lookaheads()
static void
-digraph(relation)
-short **relation;
+digraph(short **relation)
{
int i;
@@ -655,9 +649,7 @@ short **relation;
static void
-traverse(i, R)
-int i;
-short **R;
+traverse(int i, short **R)
{
unsigned *fp1;
unsigned *fp2;
diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c
index cd8d1a1e624e..e092bfb5e4d6 100644
--- a/usr.bin/yacc/lr0.c
+++ b/usr.bin/yacc/lr0.c
@@ -91,7 +91,7 @@ static short *kernel_items;
static void
-allocate_itemsets()
+allocate_itemsets(void)
{
short *itemp;
short *item_end;
@@ -134,7 +134,7 @@ allocate_itemsets()
static void
-allocate_storage()
+allocate_storage(void)
{
allocate_itemsets();
shiftset = NEW2(nsyms, short);
@@ -144,7 +144,7 @@ allocate_storage()
static void
-append_states()
+append_states(void)
{
int i;
int j;
@@ -174,7 +174,7 @@ append_states()
static void
-free_storage()
+free_storage(void)
{
FREE(shift_symbol);
FREE(redset);
@@ -188,7 +188,7 @@ free_storage()
static void
-generate_states()
+generate_states(void)
{
allocate_storage();
itemset = NEW2(nitems, short);
@@ -216,8 +216,7 @@ generate_states()
static int
-get_state(symbol)
-int symbol;
+get_state(int symbol)
{
int key;
short *isp1;
@@ -281,7 +280,7 @@ int symbol;
static void
-initialize_states()
+initialize_states(void)
{
int i;
short *start_derives;
@@ -309,7 +308,7 @@ initialize_states()
static void
-new_itemsets()
+new_itemsets(void)
{
int i;
int shiftcount;
@@ -346,8 +345,7 @@ new_itemsets()
static core *
-new_state(symbol)
-int symbol;
+new_state(int symbol)
{
int n;
core *p;
@@ -387,7 +385,7 @@ int symbol;
#if 0
/* show_cores is used for debugging */
-show_cores()
+show_cores(void)
{
core *p;
int i, j, k, n;
@@ -422,7 +420,7 @@ show_cores()
/* show_ritems is used for debugging */
-show_ritems()
+show_ritems(void)
{
int i;
@@ -432,7 +430,7 @@ show_ritems()
/* show_rrhs is used for debugging */
-show_rrhs()
+show_rrhs(void)
{
int i;
@@ -443,7 +441,7 @@ show_rrhs()
/* show_shifts is used for debugging */
-show_shifts()
+show_shifts(void)
{
shifts *p;
int i, j, k;
@@ -463,7 +461,7 @@ show_shifts()
static void
-save_shifts()
+save_shifts(void)
{
shifts *p;
short *sp1;
@@ -498,7 +496,7 @@ save_shifts()
static void
-save_reductions()
+save_reductions(void)
{
short *isp;
short *rp1;
@@ -548,7 +546,7 @@ save_reductions()
static void
-set_derives()
+set_derives(void)
{
int i, k;
int lhs;
@@ -588,7 +586,7 @@ free_derives()
#ifdef DEBUG
static void
-print_derives()
+print_derives(void)
{
int i;
short *sp;
@@ -611,7 +609,7 @@ print_derives()
static void
-set_nullable()
+set_nullable(void)
{
int i, j;
int empty;
@@ -661,7 +659,7 @@ set_nullable()
#if 0
-free_nullable()
+free_nullable(void)
{
FREE(nullable);
}
@@ -669,7 +667,7 @@ free_nullable()
void
-lr0()
+lr0(void)
{
set_derives();
set_nullable();
diff --git a/usr.bin/yacc/main.c b/usr.bin/yacc/main.c
index 474de0b19157..d01d6bf6610a 100644
--- a/usr.bin/yacc/main.c
+++ b/usr.bin/yacc/main.c
@@ -115,8 +115,7 @@ static void usage(void);
volatile sig_atomic_t sigdie;
__dead2 void
-done(k)
-int k;
+done(int k)
{
if (action_file) { fclose(action_file); unlink(action_file_name); }
if (text_file) { fclose(text_file); unlink(text_file_name); }
@@ -127,8 +126,7 @@ int k;
static void
-onintr(signo)
- int signo __unused;
+onintr(int signo __unused)
{
sigdie = 1;
done(1);
@@ -136,7 +134,7 @@ onintr(signo)
static void
-set_signals()
+set_signals(void)
{
#ifdef SIGINT
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
@@ -154,7 +152,7 @@ set_signals()
static void
-usage()
+usage(void)
{
fprintf(stderr, "%s\n%s\n",
"usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]",
@@ -164,9 +162,7 @@ usage()
static void
-getargs(argc, argv)
-int argc;
-char *argv[];
+getargs(int argc, char *argv[])
{
int ch;
@@ -221,8 +217,7 @@ char *argv[];
char *
-allocate(n)
-unsigned n;
+allocate(unsigned n)
{
char *p;
@@ -237,7 +232,7 @@ unsigned n;
static void
-create_file_names()
+create_file_names(void)
{
int i, len;
const char *tmpdir;
@@ -357,7 +352,7 @@ create_file_names()
static void
-open_files()
+open_files(void)
{
int fd;
diff --git a/usr.bin/yacc/mkpar.c b/usr.bin/yacc/mkpar.c
index 1dde4dda5b0b..282b6a1584fa 100644
--- a/usr.bin/yacc/mkpar.c
+++ b/usr.bin/yacc/mkpar.c
@@ -73,7 +73,7 @@ static void unused_rules(void);
void
-make_parser()
+make_parser(void)
{
int i;
@@ -90,8 +90,7 @@ make_parser()
static action *
-parse_actions(stateno)
-int stateno;
+parse_actions(int stateno)
{
action *actions;
@@ -102,8 +101,7 @@ int stateno;
static action *
-get_shifts(stateno)
-int stateno;
+get_shifts(int stateno)
{
action *actions, *temp;
shifts *sp;
@@ -137,9 +135,7 @@ int stateno;
}
static action *
-add_reductions(stateno, actions)
-int stateno;
-action *actions;
+add_reductions(int stateno, action *actions)
{
int i, j, m, n;
int ruleno, tokensetsize;
@@ -163,9 +159,7 @@ action *actions;
static action *
-add_reduce(actions, ruleno, symbol)
-action *actions;
-int ruleno, symbol;
+add_reduce(action *actions, int ruleno, int symbol)
{
action *temp, *prev, *next;
@@ -204,7 +198,7 @@ int ruleno, symbol;
static void
-find_final_state()
+find_final_state(void)
{
int goal, i;
short *tostate;
@@ -222,7 +216,7 @@ find_final_state()
static void
-unused_rules()
+unused_rules(void)
{
int i;
action *p;
@@ -256,7 +250,7 @@ unused_rules()
static void
-remove_conflicts()
+remove_conflicts(void)
{
int i;
int symbol;
@@ -333,7 +327,7 @@ remove_conflicts()
static void
-total_conflicts()
+total_conflicts(void)
{
/* Warn if s/r != expect or if any r/r */
if ((SRtotal != SRexpect) || RRtotal)
@@ -352,8 +346,7 @@ total_conflicts()
static int
-sole_reduction(stateno)
-int stateno;
+sole_reduction(int stateno)
{
int count, ruleno;
action *p;
@@ -381,7 +374,7 @@ int stateno;
static void
-defreds()
+defreds(void)
{
int i;
@@ -391,8 +384,7 @@ defreds()
}
static void
-free_action_row(p)
-action *p;
+free_action_row(action *p)
{
action *q;
@@ -405,7 +397,7 @@ action *p;
}
void
-free_parser()
+free_parser(void)
{
int i;
diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c
index b0b520a7e30d..b4839609967a 100644
--- a/usr.bin/yacc/output.c
+++ b/usr.bin/yacc/output.c
@@ -95,7 +95,7 @@ static const char line_format[] = "#line %d \"%s\"\n";
void
-output()
+output(void)
{
free_itemsets();
free_shifts();
@@ -119,7 +119,7 @@ output()
static void
-output_prefix()
+output_prefix(void)
{
if (symbol_prefix == NULL)
symbol_prefix = "yy";
@@ -184,7 +184,7 @@ output_prefix()
static void
-output_rule_data()
+output_rule_data(void)
{
int i;
int j;
@@ -232,7 +232,7 @@ output_rule_data()
static void
-output_yydefred()
+output_yydefred(void)
{
int i, j;
@@ -260,7 +260,7 @@ output_yydefred()
static void
-output_actions()
+output_actions(void)
{
nvectors = 2*nstates + nvars;
@@ -289,7 +289,7 @@ output_actions()
static void
-token_actions()
+token_actions(void)
{
int i, j;
int shiftcount, reducecount;
@@ -374,7 +374,7 @@ token_actions()
}
static void
-goto_actions()
+goto_actions(void)
{
int i, j, k;
@@ -407,8 +407,7 @@ goto_actions()
}
static int
-default_goto(symbol)
-int symbol;
+default_goto(int symbol)
{
int i;
int m;
@@ -444,9 +443,7 @@ int symbol;
static void
-save_column(symbol, default_state)
-int symbol;
-int default_state;
+save_column(int symbol, int default_state)
{
int i;
int m;
@@ -487,7 +484,7 @@ int default_state;
}
static void
-sort_actions()
+sort_actions(void)
{
int i;
int j;
@@ -523,7 +520,7 @@ sort_actions()
static void
-pack_table()
+pack_table(void)
{
int i;
int place;
@@ -586,8 +583,7 @@ pack_table()
/* order. */
static int
-matching_vector(vector)
-int vector;
+matching_vector(int vector)
{
int i;
int j;
@@ -627,8 +623,7 @@ int vector;
static int
-pack_vector(vector)
-int vector;
+pack_vector(int vector)
{
int i, j, k;
int t;
@@ -705,7 +700,7 @@ int vector;
static void
-output_base()
+output_base(void)
{
int i, j;
@@ -773,7 +768,7 @@ output_base()
static void
-output_table()
+output_table(void)
{
int i;
int j;
@@ -806,7 +801,7 @@ output_table()
static void
-output_check()
+output_check(void)
{
int i;
int j;
@@ -836,8 +831,7 @@ output_check()
static int
-is_C_identifier(name)
-char *name;
+is_C_identifier(char *name)
{
char *s;
int c;
@@ -869,7 +863,7 @@ char *name;
static void
-output_defines()
+output_defines(void)
{
int c, i;
char *s;
@@ -928,7 +922,7 @@ output_defines()
static void
-output_stored_text()
+output_stored_text(void)
{
int c;
FILE *in, *out;
@@ -956,7 +950,7 @@ output_stored_text()
static void
-output_debug()
+output_debug(void)
{
int i, j, k, max;
char **symnam, *s;
@@ -1173,7 +1167,7 @@ output_debug()
static void
-output_stype()
+output_stype(void)
{
if (!unionized && ntags == 0)
{
@@ -1184,7 +1178,7 @@ output_stype()
static void
-output_trailing_text()
+output_trailing_text(void)
{
int c, last;
FILE *in, *out;
@@ -1242,7 +1236,7 @@ output_trailing_text()
static void
-output_semantic_actions()
+output_semantic_actions(void)
{
int c, last;
FILE *out;
@@ -1280,7 +1274,7 @@ output_semantic_actions()
static void
-free_itemsets()
+free_itemsets(void)
{
core *cp, *next;
@@ -1294,7 +1288,7 @@ free_itemsets()
static void
-free_shifts()
+free_shifts(void)
{
shifts *sp, *next;
@@ -1309,7 +1303,7 @@ free_shifts()
static void
-free_reductions()
+free_reductions(void)
{
reductions *rp, *next;
diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c
index 7c1132d494d9..c97098dd22c2 100644
--- a/usr.bin/yacc/reader.c
+++ b/usr.bin/yacc/reader.c
@@ -120,8 +120,7 @@ static void skip_comment(void);
static void start_rule(bucket *, int);
static void
-cachec(c)
-int c;
+cachec(int c)
{
assert(cinc >= 0);
if (cinc >= cache_size)
@@ -136,7 +135,7 @@ int c;
static void
-get_line()
+get_line(void)
{
FILE *f = input_file;
int c;
@@ -183,7 +182,7 @@ get_line()
static char *
-dup_line()
+dup_line(void)
{
char *p, *s, *t;
@@ -201,7 +200,7 @@ dup_line()
static void
-skip_comment()
+skip_comment(void)
{
char *s;
@@ -232,7 +231,7 @@ skip_comment()
static int
-nextc()
+nextc(void)
{
char *s;
@@ -294,7 +293,7 @@ nextc()
static int
-keyword()
+keyword(void)
{
int c;
char *t_cptr = cptr;
@@ -360,7 +359,7 @@ keyword()
static void
-copy_ident()
+copy_ident(void)
{
int c;
FILE *f = output_file;
@@ -390,7 +389,7 @@ copy_ident()
static void
-copy_text()
+copy_text(void)
{
int c;
int quote;
@@ -522,7 +521,7 @@ loop:
static void
-copy_union()
+copy_union(void)
{
int c;
int quote;
@@ -663,8 +662,7 @@ loop:
static int
-hexval(c)
-int c;
+hexval(int c)
{
if (c >= '0' && c <= '9')
return (c - '0');
@@ -677,7 +675,7 @@ int c;
static bucket *
-get_literal()
+get_literal(void)
{
int c, quote;
int i;
@@ -816,8 +814,7 @@ get_literal()
static int
-is_reserved(name)
-char *name;
+is_reserved(char *name)
{
char *s;
@@ -838,7 +835,7 @@ char *name;
static bucket *
-get_name()
+get_name(void)
{
int c;
@@ -854,7 +851,7 @@ get_name()
static int
-get_number()
+get_number(void)
{
int c;
int n;
@@ -868,7 +865,7 @@ get_number()
static char *
-get_tag()
+get_tag(void)
{
int c;
int i;
@@ -919,8 +916,7 @@ get_tag()
static void
-declare_tokens(assoc)
-int assoc;
+declare_tokens(int assoc)
{
int c;
bucket *bp;
@@ -987,8 +983,7 @@ int assoc;
* grammar only a flag for yacc proper.
*/
static void
-declare_expect(assoc)
-int assoc;
+declare_expect(int assoc)
{
int c;
@@ -1027,7 +1022,7 @@ int assoc;
static void
-declare_types()
+declare_types(void)
{
int c;
bucket *bp;
@@ -1056,7 +1051,7 @@ declare_types()
static void
-declare_start()
+declare_start(void)
{
int c;
bucket *bp;
@@ -1075,7 +1070,7 @@ declare_start()
static void
-read_declarations()
+read_declarations(void)
{
int c, k;
@@ -1129,7 +1124,7 @@ read_declarations()
static void
-initialize_grammar()
+initialize_grammar(void)
{
nitems = 4;
maxitems = 300;
@@ -1161,7 +1156,7 @@ initialize_grammar()
static void
-expand_items()
+expand_items(void)
{
maxitems += 300;
pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
@@ -1170,7 +1165,7 @@ expand_items()
static void
-expand_rules()
+expand_rules(void)
{
maxrules += 100;
plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
@@ -1183,7 +1178,7 @@ expand_rules()
static void
-advance_to_start()
+advance_to_start(void)
{
int c;
bucket *bp;
@@ -1234,9 +1229,7 @@ advance_to_start()
static void
-start_rule(bp, s_lineno)
-bucket *bp;
-int s_lineno;
+start_rule(bucket *bp, int s_lineno)
{
if (bp->class == TERM)
terminal_lhs(s_lineno);
@@ -1250,7 +1243,7 @@ int s_lineno;
static void
-end_rule()
+end_rule(void)
{
int i;
@@ -1270,7 +1263,7 @@ end_rule()
static void
-insert_empty_rule()
+insert_empty_rule(void)
{
bucket *bp, **bpp;
@@ -1300,7 +1293,7 @@ insert_empty_rule()
static void
-add_symbol()
+add_symbol(void)
{
int c;
bucket *bp;
@@ -1332,7 +1325,7 @@ add_symbol()
static void
-copy_action()
+copy_action(void)
{
int c;
int i, n;
@@ -1556,7 +1549,7 @@ loop:
static int
-mark_symbol()
+mark_symbol(void)
{
int c;
bucket *bp = NULL;
@@ -1600,7 +1593,7 @@ mark_symbol()
static void
-read_grammar()
+read_grammar(void)
{
int c;
@@ -1634,7 +1627,7 @@ read_grammar()
static void
-free_tags()
+free_tags(void)
{
int i;
@@ -1650,7 +1643,7 @@ free_tags()
static void
-pack_names()
+pack_names(void)
{
bucket *bp;
char *p, *s, *t;
@@ -1676,7 +1669,7 @@ pack_names()
static void
-check_symbols()
+check_symbols(void)
{
bucket *bp;
@@ -1695,7 +1688,7 @@ check_symbols()
static void
-pack_symbols()
+pack_symbols(void)
{
bucket *bp;
bucket **v;
@@ -1820,7 +1813,7 @@ pack_symbols()
static void
-pack_grammar()
+pack_grammar(void)
{
int i, j;
int assoc, preced;
@@ -1880,7 +1873,7 @@ pack_grammar()
static void
-print_grammar()
+print_grammar(void)
{
int i, j, k;
int spacing;
@@ -1918,7 +1911,7 @@ print_grammar()
void
-reader()
+reader(void)
{
write_section(banner);
create_symbol_table();
diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c
index 434a7c231dbf..4ea78c72a2ef 100644
--- a/usr.bin/yacc/skeleton.c
+++ b/usr.bin/yacc/skeleton.c
@@ -409,8 +409,7 @@ const char *trailer[] =
void
-write_section(section)
-const char *section[];
+write_section(const char *section[])
{
int c;
int i;
diff --git a/usr.bin/yacc/symtab.c b/usr.bin/yacc/symtab.c
index cb7b0bd45cb0..a914527ac659 100644
--- a/usr.bin/yacc/symtab.c
+++ b/usr.bin/yacc/symtab.c
@@ -60,8 +60,7 @@ bucket *last_symbol;
static int
-hash(name)
-const char *name;
+hash(const char *name)
{
const char *s;
int c, k;
@@ -77,8 +76,7 @@ const char *name;
bucket *
-make_bucket(name)
-const char *name;
+make_bucket(const char *name)
{
bucket *bp;
@@ -104,8 +102,7 @@ const char *name;
bucket *
-lookup(name)
-char *name;
+lookup(char *name)
{
bucket *bp, **bpp;
@@ -128,7 +125,7 @@ char *name;
void
-create_symbol_table()
+create_symbol_table(void)
{
int i;
bucket *bp;
@@ -149,7 +146,7 @@ create_symbol_table()
void
-free_symbol_table()
+free_symbol_table(void)
{
FREE(symbol_table);
symbol_table = 0;
@@ -157,7 +154,7 @@ free_symbol_table()
void
-free_symbols()
+free_symbols(void)
{
bucket *p, *q;
diff --git a/usr.bin/yacc/verbose.c b/usr.bin/yacc/verbose.c
index 282eaa3499a9..a80e6e0553de 100644
--- a/usr.bin/yacc/verbose.c
+++ b/usr.bin/yacc/verbose.c
@@ -60,7 +60,7 @@ static void print_shifts(action *);
static void print_state(int);
void
-verbose()
+verbose(void)
{
int i;
@@ -85,7 +85,7 @@ verbose()
static void
-log_unused()
+log_unused(void)
{
int i;
short *p;
@@ -105,7 +105,7 @@ log_unused()
static void
-log_conflicts()
+log_conflicts(void)
{
int i;
@@ -134,8 +134,7 @@ log_conflicts()
static void
-print_state(state)
-int state;
+print_state(int state)
{
if (state)
fprintf(verbose_file, "\n\n");
@@ -149,8 +148,7 @@ int state;
static void
-print_conflicts(state)
-int state;
+print_conflicts(int state)
{
int symbol, act = 0, number = 0;
action *p;
@@ -198,8 +196,7 @@ int state;
static void
-print_core(state)
-int state;
+print_core(int state)
{
int i;
int k;
@@ -235,8 +232,7 @@ int state;
static void
-print_nulls(state)
-int state;
+print_nulls(int state)
{
action *p;
int i, j, k, nnulls;
@@ -280,8 +276,7 @@ int state;
static void
-print_actions(stateno)
-int stateno;
+print_actions(int stateno)
{
action *p;
shifts *sp;
@@ -308,8 +303,7 @@ int stateno;
static void
-print_shifts(p)
-action *p;
+print_shifts(action *p)
{
int count;
action *q;
@@ -334,9 +328,7 @@ action *p;
static void
-print_reductions(p, defreduct)
-action *p;
-int defreduct;
+print_reductions(action *p, int defreduct)
{
int k, anyreds;
action *q;
@@ -373,8 +365,7 @@ int defreduct;
static void
-print_gotos(stateno)
-int stateno;
+print_gotos(int stateno)
{
int i, k;
int as;
diff --git a/usr.bin/yacc/warshall.c b/usr.bin/yacc/warshall.c
index 46d934dd758d..e5a3ff0b8248 100644
--- a/usr.bin/yacc/warshall.c
+++ b/usr.bin/yacc/warshall.c
@@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
static void transitive_closure(unsigned *, int);
static void
-transitive_closure(R, n)
-unsigned *R;
-int n;
+transitive_closure(unsigned *R, int n)
{
int rowsize;
unsigned i;
@@ -101,9 +99,7 @@ int n;
}
void
-reflexive_transitive_closure(R, n)
-unsigned *R;
-int n;
+reflexive_transitive_closure(unsigned *R, int n)
{
int rowsize;
unsigned i;