diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-06-19 16:34:54 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-06-19 16:34:54 +0000 |
commit | d8a20954432bfead92ebfd69e16dc0fc365af6ed (patch) | |
tree | 4cb374af17c9703b7d645bf435d969d078559085 /usr.bin | |
parent | 21a7e092a6248e384b9d2fa5dc683527fafc6a2f (diff) |
ansify; ok miod
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/yacc/closure.c | 26 | ||||
-rw-r--r-- | usr.bin/yacc/error.c | 112 | ||||
-rw-r--r-- | usr.bin/yacc/lalr.c | 45 | ||||
-rw-r--r-- | usr.bin/yacc/lr0.c | 48 | ||||
-rw-r--r-- | usr.bin/yacc/main.c | 33 | ||||
-rw-r--r-- | usr.bin/yacc/mkpar.c | 37 | ||||
-rw-r--r-- | usr.bin/yacc/output.c | 64 | ||||
-rw-r--r-- | usr.bin/yacc/reader.c | 86 | ||||
-rw-r--r-- | usr.bin/yacc/skeleton.c | 7 | ||||
-rw-r--r-- | usr.bin/yacc/symtab.c | 19 | ||||
-rw-r--r-- | usr.bin/yacc/verbose.c | 35 | ||||
-rw-r--r-- | usr.bin/yacc/warshall.c | 14 |
12 files changed, 210 insertions, 316 deletions
diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c index 36a941c7064..18c783f410c 100644 --- a/usr.bin/yacc/closure.c +++ b/usr.bin/yacc/closure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: closure.c,v 1.6 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: closure.c,v 1.7 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: closure.c,v 1.4 1996/03/19 03:21:29 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)closure.c 5.3 (Berkeley) 5/24/93"; #else -static char rcsid[] = "$OpenBSD: closure.c,v 1.6 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: closure.c,v 1.7 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -52,7 +52,7 @@ static unsigned *EFF; void -set_EFF() +set_EFF(void) { unsigned *row; int symbol; @@ -89,7 +89,7 @@ set_EFF() void -set_first_derives() +set_first_derives(void) { unsigned *rrow; unsigned *vrow; @@ -145,9 +145,7 @@ set_first_derives() void -closure(nucleus, n) -short *nucleus; -int n; +closure(short *nucleus, int n) { int ruleno; unsigned word; @@ -216,7 +214,7 @@ int n; void -finalize_closure() +finalize_closure(void) { FREE(itemset); FREE(ruleset); @@ -226,8 +224,8 @@ finalize_closure() #ifdef DEBUG -print_closure(n) -int n; +void +print_closure(int n) { short *isp; @@ -236,8 +234,8 @@ int n; printf(" %d\n", *isp); } - -print_EFF() +void +print_EFF(void) { int i, j; unsigned *rowp; @@ -267,8 +265,8 @@ print_EFF() } } - -print_first_derives() +void +print_first_derives(void) { int i; int j; diff --git a/usr.bin/yacc/error.c b/usr.bin/yacc/error.c index 409fa11e86f..1892fc583a0 100644 --- a/usr.bin/yacc/error.c +++ b/usr.bin/yacc/error.c @@ -1,4 +1,4 @@ -/* $OpenBSD: error.c,v 1.8 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: error.c,v 1.9 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: error.c,v 1.4 1996/03/19 03:21:32 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)error.c 5.3 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$OpenBSD: error.c,v 1.8 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: error.c,v 1.9 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -47,8 +47,7 @@ static char rcsid[] = "$OpenBSD: error.c,v 1.8 2003/06/03 02:56:24 millert Exp $ void -fatal(msg) -char *msg; +fatal(char *msg) { fprintf(stderr, "%s: %s\n", input_file_name, msg); done(2); @@ -56,7 +55,7 @@ char *msg; void -no_space() +no_space(void) { fprintf(stderr, "%s: yacc is out of space\n", input_file_name); done(2); @@ -64,8 +63,7 @@ no_space() void -open_error(filename) -char *filename; +open_error(char *filename) { fprintf(stderr, "%s: cannot open source file\n", input_file_name); done(2); @@ -73,7 +71,7 @@ char *filename; void -unexpected_EOF() +unexpected_EOF(void) { fprintf(stderr, "%s:%d: unexpected end-of-file\n", input_file_name, lineno); @@ -82,9 +80,7 @@ unexpected_EOF() void -print_pos(st_line, st_cptr) -char *st_line; -char *st_cptr; +print_pos(char *st_line, char *st_cptr) { char *s; @@ -109,10 +105,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) { fprintf(stderr, "%s:%d: syntax error\n", input_file_name, st_lineno); @@ -121,10 +114,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) { fprintf(stderr, "%s:%d: unmatched /*\n", input_file_name, c_lineno); @@ -133,10 +123,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) { fprintf(stderr, "%s:%d:, unterminated string\n", input_file_name, s_lineno); @@ -145,10 +132,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) { fprintf(stderr, "%s:%d: unmatched %%{\n", input_file_name, t_lineno); @@ -157,10 +141,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) { fprintf(stderr, "%s:%d: unterminated %%union declaration\n", input_file_name, u_lineno); @@ -169,8 +150,7 @@ char *u_cptr; } void -over_unionized(u_cptr) -char *u_cptr; +over_unionized(char *u_cptr) { fprintf(stderr, "%s:%d: too many %%union declarations\n", input_file_name, lineno); @@ -179,10 +159,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) { fprintf(stderr, "%s:%d: illegal tag\n", input_file_name, t_lineno); @@ -192,8 +169,7 @@ char *t_cptr; void -illegal_character(c_cptr) -char *c_cptr; +illegal_character(char *c_cptr) { fprintf(stderr, "%s:%d: illegal character\n", input_file_name, lineno); @@ -203,8 +179,7 @@ char *c_cptr; void -used_reserved(s) -char *s; +used_reserved(char *s) { fprintf(stderr, "%s:%d: illegal use of reserved symbol %s\n", input_file_name, lineno, s); @@ -212,8 +187,7 @@ char *s; } void -tokenized_start(s) -char *s; +tokenized_start(char *s) { fprintf(stderr, "%s:%d: the start symbol %s cannot be declared to be a token\n", input_file_name, lineno, s); @@ -221,32 +195,28 @@ char *s; } void -retyped_warning(s) -char *s; +retyped_warning(char *s) { fprintf(stderr, "%s:%d: the type of %s has been redeclared\n", input_file_name, lineno, s); } void -reprec_warning(s) -char *s; +reprec_warning(char *s) { fprintf(stderr, "%s:%d: the precedence of %s has been redeclared\n", input_file_name, lineno, s); } void -revalued_warning(s) -char *s; +revalued_warning(char *s) { fprintf(stderr, "%s:%d: the value of %s has been redeclared\n", input_file_name, lineno, s); } void -terminal_start(s) -char *s; +terminal_start(char *s) { fprintf(stderr, "%s:%d: the start symbol %s is a token\n", input_file_name, lineno, s); @@ -254,14 +224,14 @@ char *s; } void -restarted_warning() +restarted_warning(void) { fprintf(stderr, "%s:%d: the start symbol has been redeclared\n", input_file_name, lineno); } void -no_grammar() +no_grammar(void) { fprintf(stderr, "%s:%d: no grammar has been specified\n", input_file_name, lineno); @@ -269,8 +239,7 @@ no_grammar() } void -terminal_lhs(s_lineno) -int s_lineno; +terminal_lhs(int s_lineno) { fprintf(stderr, "%s:%d: a token appears on the lhs of a production\n", input_file_name, s_lineno); @@ -278,17 +247,14 @@ int s_lineno; } void -prec_redeclared() +prec_redeclared(void) { fprintf(stderr, "%s:%d: conflicting %%prec specifiers\n", input_file_name, lineno); } 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) { fprintf(stderr, "%s:%d: unterminated action\n", input_file_name, a_lineno); @@ -297,19 +263,14 @@ char *a_cptr; } void -dollar_warning(a_lineno, i) -int a_lineno; -int i; +dollar_warning(int a_lineno, int i) { fprintf(stderr, "%s:%d: $%d references beyond the end of the current rule\n", input_file_name, a_lineno, 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) { fprintf(stderr, "%s:%d: illegal $-name\n", input_file_name, a_lineno); @@ -319,7 +280,7 @@ char *a_cptr; void -untyped_lhs() +untyped_lhs(void) { fprintf(stderr, "%s:%d: $$ is untyped\n", input_file_name, lineno); @@ -327,9 +288,7 @@ untyped_lhs() } void -untyped_rhs(i, s) -int i; -char *s; +untyped_rhs(int i, char *s) { fprintf(stderr, "%s:%d: $%d (%s) is untyped\n", input_file_name, lineno, i, s); @@ -337,8 +296,7 @@ char *s; } void -unknown_rhs(i) -int i; +unknown_rhs(int i) { fprintf(stderr, "%s:%d: $%d is untyped\n", input_file_name, lineno, i); @@ -346,23 +304,21 @@ int i; } void -default_action_warning() +default_action_warning(void) { fprintf(stderr, "%s:%d: the default action assigns an undefined value to $$\n", input_file_name, lineno); } void -undefined_goal(s) -char *s; +undefined_goal(char *s) { fprintf(stderr, "%s: the start symbol %s is undefined\n", input_file_name, s); done(1); } void -undefined_symbol_warning(s) -char *s; +undefined_symbol_warning(char *s) { fprintf(stderr, "%s: the symbol %s is undefined\n", input_file_name, s); } diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c index 28e19c06e69..3cdf3ae1079 100644 --- a/usr.bin/yacc/lalr.c +++ b/usr.bin/yacc/lalr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lalr.c,v 1.7 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: lalr.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: lalr.c,v 1.4 1996/03/19 03:21:33 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)lalr.c 5.3 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$OpenBSD: lalr.c,v 1.7 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: lalr.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -92,7 +92,7 @@ static short *VERTICES; static int top; void -lalr() +lalr(void) { tokensetsize = WORDSIZE(ntokens); @@ -111,7 +111,7 @@ lalr() void -set_state_table() +set_state_table(void) { core *sp; @@ -122,7 +122,7 @@ set_state_table() void -set_accessing_symbol() +set_accessing_symbol(void) { core *sp; @@ -133,7 +133,7 @@ set_accessing_symbol() void -set_shift_table() +set_shift_table(void) { shifts *sp; @@ -144,7 +144,7 @@ set_shift_table() void -set_reduction_table() +set_reduction_table(void) { reductions *rp; @@ -155,7 +155,7 @@ set_reduction_table() void -set_maxrhs() +set_maxrhs(void) { short *itemp; short *item_end; @@ -183,7 +183,7 @@ set_maxrhs() void -initialize_LA() +initialize_LA(void) { int i, j, k; reductions *rp; @@ -220,7 +220,7 @@ initialize_LA() } void -set_goto_map() +set_goto_map(void) { shifts *sp; int i; @@ -290,9 +290,7 @@ set_goto_map() /* Map_goto maps a state/symbol pair into its numeric representation. */ int -map_goto(state, symbol) -int state; -int symbol; +map_goto(int state, int symbol) { int high; int low; @@ -318,7 +316,7 @@ int symbol; void -initialize_F() +initialize_F(void) { int i; int j; @@ -395,7 +393,7 @@ initialize_F() void -build_relations() +build_relations(void) { int i; int j; @@ -487,8 +485,7 @@ build_relations() } 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; @@ -515,9 +512,7 @@ int stateno, ruleno, gotono; short ** -transpose(R, n) -short **R; -int n; +transpose(short **R, int n) { short **new_R; short **temp_R; @@ -572,13 +567,13 @@ int n; void -compute_FOLLOWS() +compute_FOLLOWS(void) { digraph(includes); } void -compute_lookaheads() +compute_lookaheads(void) { int i, n; unsigned *fp1, *fp2, *fp3; @@ -612,8 +607,7 @@ compute_lookaheads() } void -digraph(relation) -short **relation; +digraph(short **relation) { int i; @@ -639,8 +633,7 @@ short **relation; void -traverse(i) -int i; +traverse(int i) { unsigned *fp1; unsigned *fp2; diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c index cbefc5a247b..666e28b8351 100644 --- a/usr.bin/yacc/lr0.c +++ b/usr.bin/yacc/lr0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lr0.c,v 1.7 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: lr0.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)lr0.c 5.3 (Berkeley) 1/20/91"; #else -static char rcsid[] = "$OpenBSD: lr0.c,v 1.7 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: lr0.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -91,7 +91,7 @@ static short **kernel_end; static short *kernel_items; void -allocate_itemsets() +allocate_itemsets(void) { short *itemp; short *item_end; @@ -133,7 +133,7 @@ allocate_itemsets() } void -allocate_storage() +allocate_storage(void) { allocate_itemsets(); shiftset = NEW2(nsyms, short); @@ -142,7 +142,7 @@ allocate_storage() } void -append_states() +append_states(void) { int i; int j; @@ -171,7 +171,7 @@ append_states() } void -free_storage() +free_storage(void) { FREE(shift_symbol); FREE(redset); @@ -184,7 +184,7 @@ free_storage() void -generate_states() +generate_states(void) { allocate_storage(); itemset = NEW2(nitems, short); @@ -212,8 +212,7 @@ generate_states() int -get_state(symbol) -int symbol; +get_state(int symbol) { int key; short *isp1; @@ -276,7 +275,7 @@ int symbol; void -initialize_states() +initialize_states(void) { int i; short *start_derives; @@ -303,7 +302,7 @@ initialize_states() } void -new_itemsets() +new_itemsets(void) { int i; int shiftcount; @@ -340,8 +339,7 @@ new_itemsets() core * -new_state(symbol) -int symbol; +new_state(int symbol) { int n; core *p; @@ -381,7 +379,7 @@ int symbol; /* show_cores is used for debugging */ void -show_cores() +show_cores(void) { core *p; int i, j, k, n; @@ -417,7 +415,7 @@ show_cores() /* show_ritems is used for debugging */ void -show_ritems() +show_ritems(void) { int i; @@ -429,7 +427,7 @@ show_ritems() /* show_rrhs is used for debugging */ void -show_rrhs() +show_rrhs(void) { int i; @@ -441,7 +439,7 @@ show_rrhs() /* show_shifts is used for debugging */ void -show_shifts() +show_shifts(void) { shifts *p; int i, j, k; @@ -459,7 +457,7 @@ show_shifts() } void -save_shifts() +save_shifts(void) { shifts *p; short *sp1; @@ -493,7 +491,7 @@ save_shifts() void -save_reductions() +save_reductions(void) { short *isp; short *rp1; @@ -542,7 +540,7 @@ save_reductions() } void -set_derives() +set_derives(void) { int i, k; int lhs; @@ -573,7 +571,7 @@ set_derives() } void -free_derives() +free_derives(void) { FREE(derives[start_symbol]); FREE(derives); @@ -581,7 +579,7 @@ free_derives() #ifdef DEBUG void -print_derives() +print_derives(void) { int i; short *sp; @@ -603,7 +601,7 @@ print_derives() #endif void -set_nullable() +set_nullable(void) { int i, j; int empty; @@ -652,13 +650,13 @@ set_nullable() } void -free_nullable() +free_nullable(void) { 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 fc4dd2060f6..858493be6e9 100644 --- a/usr.bin/yacc/main.c +++ b/usr.bin/yacc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.17 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: main.c,v 1.18 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: main.c,v 1.5 1996/03/19 03:21:38 jtc Exp $ */ /* @@ -43,7 +43,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 5/24/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.17 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.18 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -121,8 +121,7 @@ void open_files(void); volatile sig_atomic_t sigdie; void -done(k) -int k; +done(int k) { if (action_file) unlink(action_file_name); @@ -137,8 +136,7 @@ int k; void -onintr(signo) - int signo; +onintr(int signo) { sigdie = 1; done(1); @@ -146,7 +144,7 @@ onintr(signo) void -set_signals() +set_signals(void) { #ifdef SIGINT if (signal(SIGINT, SIG_IGN) != SIG_IGN) @@ -164,7 +162,7 @@ set_signals() void -usage() +usage(void) { fprintf(stderr, "usage: %s [-dlrtv] [-b file_prefix] [-o outputfile] [-p symbol_prefix] filename\n", __progname); exit(1); @@ -172,9 +170,7 @@ usage() void -getargs(argc, argv) -int argc; -char *argv[]; +getargs(int argc, char *argv[]) { int i; char *s; @@ -287,8 +283,7 @@ no_more_options:; char * -allocate(n) -unsigned n; +allocate(unsigned int n) { char *p; @@ -305,7 +300,7 @@ unsigned n; (asprintf(&(s), "%.*s/yacc.%xXXXXXXXXXX", (int)(l), (d), (c))) void -create_file_names() +create_file_names(void) { size_t len; char *tmpdir; @@ -384,9 +379,7 @@ create_file_names() FILE * -fsopen(name, mode) - char *name; - char *mode; +fsopen(char *name, char *mode) { FILE *fp = NULL; int fd, mod = O_RDONLY; @@ -402,7 +395,7 @@ fsopen(name, mode) } void -open_files() +open_files(void) { int fd; @@ -456,9 +449,7 @@ open_files() int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { set_signals(); getargs(argc, argv); diff --git a/usr.bin/yacc/mkpar.c b/usr.bin/yacc/mkpar.c index 56a903bfbc1..9bfaab62cfa 100644 --- a/usr.bin/yacc/mkpar.c +++ b/usr.bin/yacc/mkpar.c @@ -1,5 +1,4 @@ -/* $OpenBSD: mkpar.c,v 1.10 2003/06/03 02:56:24 millert Exp $ */ - +/* $OpenBSD: mkpar.c,v 1.11 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: mkpar.c,v 1.4 1996/03/19 03:21:39 jtc Exp $ */ /* @@ -74,7 +73,7 @@ void defreds(void); void -make_parser() +make_parser(void) { int i; @@ -91,8 +90,7 @@ make_parser() action * -parse_actions(stateno) -int stateno; +parse_actions(int stateno) { action *actions; @@ -103,8 +101,7 @@ int stateno; action * -get_shifts(stateno) -int stateno; +get_shifts(int stateno) { action *actions, *temp; shifts *sp; @@ -138,9 +135,7 @@ int stateno; } action * -add_reductions(stateno, actions) -int stateno; -action *actions; +add_reductions(int stateno, action *actions) { int i, j, m, n; int ruleno, tokensetsize; @@ -164,9 +159,7 @@ action *actions; action * -add_reduce(actions, ruleno, symbol) -action *actions; -int ruleno, symbol; +add_reduce(action *actions, int ruleno, int symbol) { action *temp, *prev, *next; @@ -205,7 +198,7 @@ int ruleno, symbol; void -find_final_state() +find_final_state(void) { int goal, i; short *to_state; @@ -223,7 +216,7 @@ find_final_state() void -unused_rules() +unused_rules(void) { int i; action *p; @@ -258,7 +251,7 @@ unused_rules() void -remove_conflicts() +remove_conflicts(void) { int i; int symbol; @@ -334,7 +327,7 @@ remove_conflicts() void -total_conflicts() +total_conflicts(void) { /* Warn if s/r != expect or if any r/r */ if ((SRtotal != SRexpect) || RRtotal) @@ -357,8 +350,7 @@ total_conflicts() int -sole_reduction(stateno) -int stateno; +sole_reduction(int stateno) { int count, ruleno; action *p; @@ -386,7 +378,7 @@ int stateno; void -defreds() +defreds(void) { int i; @@ -396,8 +388,7 @@ defreds() } void -free_action_row(p) -action *p; +free_action_row(action *p) { action *q; @@ -410,7 +401,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 15ae6976756..6f143af511f 100644 --- a/usr.bin/yacc/output.c +++ b/usr.bin/yacc/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.10 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: output.c,v 1.11 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: output.c,v 1.4 1996/03/19 03:21:41 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)output.c 5.7 (Berkeley) 5/24/93"; #else -static char rcsid[] = "$OpenBSD: output.c,v 1.10 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: output.c,v 1.11 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -86,7 +86,7 @@ void free_shifts(void); void free_reductions(void); void -output() +output(void) { free_itemsets(); free_shifts(); @@ -110,7 +110,7 @@ output() void -output_prefix() +output_prefix(void) { if (symbol_prefix == NULL) symbol_prefix = "yy"; @@ -175,7 +175,7 @@ output_prefix() void -output_rule_data() +output_rule_data(void) { int i; int j; @@ -234,7 +234,7 @@ output_rule_data() void -output_yydefred() +output_yydefred(void) { int i, j; @@ -268,7 +268,7 @@ output_yydefred() void -output_actions() +output_actions(void) { nvectors = 2*nstates + nvars; @@ -297,7 +297,7 @@ output_actions() void -token_actions() +token_actions(void) { int i, j; int shiftcount, reducecount; @@ -382,7 +382,7 @@ token_actions() } void -goto_actions() +goto_actions(void) { int i, j, k; @@ -421,8 +421,7 @@ goto_actions() } int -default_goto(symbol) -int symbol; +default_goto(int symbol) { int i; int m; @@ -458,9 +457,7 @@ int symbol; void -save_column(symbol, default_state) -int symbol; -int default_state; +save_column(int symbol, int default_state) { int i; int m; @@ -501,7 +498,7 @@ int default_state; } void -sort_actions() +sort_actions(void) { int i; int j; @@ -537,7 +534,7 @@ sort_actions() void -pack_table() +pack_table(void) { int i; int place; @@ -600,8 +597,7 @@ pack_table() /* order. */ int -matching_vector(vector) -int vector; +matching_vector(int vector) { int i; int j; @@ -641,8 +637,7 @@ int vector; int -pack_vector(vector) -int vector; +pack_vector(int vector) { int i, j, k, l; int t; @@ -719,7 +714,7 @@ int vector; void -output_base() +output_base(void) { int i, j; @@ -802,9 +797,8 @@ output_base() } - void -output_table() +output_table(void) { int i; int j; @@ -840,9 +834,8 @@ output_table() } - void -output_check() +output_check(void) { int i; int j; @@ -877,8 +870,7 @@ output_check() int -is_C_identifier(name) -char *name; +is_C_identifier(char *name) { char *s; int c; @@ -910,7 +902,7 @@ char *name; void -output_defines() +output_defines(void) { int c, i; char *s; @@ -963,7 +955,7 @@ output_defines() void -output_stored_text() +output_stored_text(void) { int c; FILE *in, *out; @@ -991,7 +983,7 @@ output_stored_text() void -output_debug() +output_debug(void) { int i, j, k, max; char **symnam, *s; @@ -1219,7 +1211,7 @@ output_debug() void -output_stype() +output_stype(void) { if (!unionized && ntags == 0) { @@ -1230,7 +1222,7 @@ output_stype() void -output_trailing_text() +output_trailing_text(void) { int c, last; FILE *in, *out; @@ -1288,7 +1280,7 @@ output_trailing_text() void -output_semantic_actions() +output_semantic_actions(void) { int c, last; FILE *out; @@ -1326,7 +1318,7 @@ output_semantic_actions() void -free_itemsets() +free_itemsets(void) { core *cp, *next; @@ -1340,7 +1332,7 @@ free_itemsets() void -free_shifts() +free_shifts(void) { shifts *sp, *next; @@ -1355,7 +1347,7 @@ free_shifts() void -free_reductions() +free_reductions(void) { reductions *rp, *next; diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c index 6cbd9978dc5..9042f23385d 100644 --- a/usr.bin/yacc/reader.c +++ b/usr.bin/yacc/reader.c @@ -1,5 +1,4 @@ -/* $OpenBSD: reader.c,v 1.14 2003/06/03 02:56:24 millert Exp $ */ - +/* $OpenBSD: reader.c,v 1.15 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: reader.c,v 1.5 1996/03/19 03:21:43 jtc Exp $ */ /* @@ -116,8 +115,7 @@ void print_grammar(void); char line_format[] = "#line %d \"%s\"\n"; void -cachec(c) -int c; +cachec(int c) { assert(cinc >= 0); if (cinc >= cache_size) @@ -132,7 +130,7 @@ int c; void -get_line() +get_line(void) { FILE *f = input_file; int c; @@ -179,7 +177,7 @@ get_line() char * -dup_line() +dup_line(void) { char *p, *s, *t; @@ -197,7 +195,7 @@ dup_line() void -skip_comment() +skip_comment(void) { char *s; @@ -228,7 +226,7 @@ skip_comment() int -nextc() +nextc(void) { char *s; @@ -290,7 +288,7 @@ nextc() int -keyword() +keyword(void) { int c; char *t_cptr = cptr; @@ -356,7 +354,7 @@ keyword() void -copy_ident() +copy_ident(void) { int c; FILE *f = output_file; @@ -386,7 +384,7 @@ copy_ident() void -copy_text() +copy_text(void) { int c; int quote; @@ -518,7 +516,7 @@ loop: void -copy_union() +copy_union(void) { int c; int quote; @@ -659,8 +657,7 @@ loop: int -hexval(c) -int c; +hexval(int c) { if (c >= '0' && c <= '9') return (c - '0'); @@ -673,7 +670,7 @@ int c; bucket * -get_literal() +get_literal(void) { int c, quote; int i; @@ -812,8 +809,7 @@ get_literal() int -is_reserved(name) -char *name; +is_reserved(char *name) { char *s; @@ -834,7 +830,7 @@ char *name; bucket * -get_name() +get_name(void) { int c; @@ -850,7 +846,7 @@ get_name() int -get_number() +get_number(void) { int c; int n; @@ -864,7 +860,7 @@ get_number() char * -get_tag() +get_tag(void) { int c; int i; @@ -915,8 +911,7 @@ get_tag() void -declare_tokens(assoc) -int assoc; +declare_tokens(int assoc) { int c; bucket *bp; @@ -983,8 +978,7 @@ int assoc; * grammar only a flag for yacc proper. */ void -declare_expect(assoc) -int assoc; +declare_expect(int assoc) { int c; @@ -1023,7 +1017,7 @@ int assoc; void -declare_types() +declare_types(void) { int c; bucket *bp; @@ -1052,7 +1046,7 @@ declare_types() void -declare_start() +declare_start(void) { int c; bucket *bp; @@ -1071,7 +1065,7 @@ declare_start() void -read_declarations() +read_declarations(void) { int c, k; @@ -1125,7 +1119,7 @@ read_declarations() void -initialize_grammar() +initialize_grammar(void) { nitems = 4; maxitems = 300; @@ -1157,7 +1151,7 @@ initialize_grammar() void -expand_items() +expand_items(void) { maxitems += 300; pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *)); @@ -1166,7 +1160,7 @@ expand_items() void -expand_rules() +expand_rules(void) { maxrules += 100; plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *)); @@ -1179,7 +1173,7 @@ expand_rules() void -advance_to_start() +advance_to_start(void) { int c; bucket *bp; @@ -1230,9 +1224,7 @@ advance_to_start() 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); @@ -1246,7 +1238,7 @@ int s_lineno; void -end_rule() +end_rule(void) { int i; @@ -1266,7 +1258,7 @@ end_rule() void -insert_empty_rule() +insert_empty_rule(void) { bucket *bp, **bpp; @@ -1296,7 +1288,7 @@ insert_empty_rule() void -add_symbol() +add_symbol(void) { int c; bucket *bp; @@ -1328,7 +1320,7 @@ add_symbol() void -copy_action() +copy_action(void) { int c; int i, n; @@ -1554,7 +1546,7 @@ loop: int -mark_symbol() +mark_symbol(void) { int c; bucket *bp; @@ -1598,7 +1590,7 @@ mark_symbol() void -read_grammar() +read_grammar(void) { int c; @@ -1632,7 +1624,7 @@ read_grammar() void -free_tags() +free_tags(void) { int i; @@ -1648,7 +1640,7 @@ free_tags() void -pack_names() +pack_names(void) { bucket *bp; char *p, *s, *t; @@ -1674,7 +1666,7 @@ pack_names() void -check_symbols() +check_symbols(void) { bucket *bp; @@ -1693,7 +1685,7 @@ check_symbols() void -pack_symbols() +pack_symbols(void) { bucket *bp; bucket **v; @@ -1818,7 +1810,7 @@ pack_symbols() void -pack_grammar() +pack_grammar(void) { int i, j; int assoc, prec; @@ -1878,7 +1870,7 @@ pack_grammar() void -print_grammar() +print_grammar(void) { int i, j, k; int spacing; @@ -1915,7 +1907,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 83b181d3be1..c71765f2468 100644 --- a/usr.bin/yacc/skeleton.c +++ b/usr.bin/yacc/skeleton.c @@ -1,4 +1,4 @@ -/* $OpenBSD: skeleton.c,v 1.20 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: skeleton.c,v 1.21 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: skeleton.c,v 1.10 1996/03/25 00:36:18 mrg Exp $ */ /* @@ -63,7 +63,7 @@ char *banner[] = "#if __GNUC__ == 2", " __attribute__ ((unused))", "#endif /* __GNUC__ == 2 */", - " = \"$OpenBSD: skeleton.c,v 1.20 2003/06/03 02:56:24 millert Exp $\";", + " = \"$OpenBSD: skeleton.c,v 1.21 2003/06/19 16:34:53 pvalchev Exp $\";", "#endif", "#include <stdlib.h>", "#define YYBYACC 1", @@ -406,8 +406,7 @@ char *trailer[] = void -write_section(section) -char *section[]; +write_section(char *section[]) { int c; int i; diff --git a/usr.bin/yacc/symtab.c b/usr.bin/yacc/symtab.c index 8d2f56f391e..2eece0d509e 100644 --- a/usr.bin/yacc/symtab.c +++ b/usr.bin/yacc/symtab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: symtab.c,v 1.8 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: symtab.c,v 1.9 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: symtab.c,v 1.4 1996/03/19 03:21:48 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)symtab.c 5.3 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$OpenBSD: symtab.c,v 1.8 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: symtab.c,v 1.9 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -57,8 +57,7 @@ int hash(char *); int -hash(name) -char *name; +hash(char *name) { char *s; int c, k; @@ -74,8 +73,7 @@ char *name; bucket * -make_bucket(name) -char *name; +make_bucket(char *name) { bucket *bp; @@ -98,8 +96,7 @@ char *name; bucket * -lookup(name) -char *name; +lookup(char *name) { bucket *bp, **bpp; @@ -122,7 +119,7 @@ char *name; void -create_symbol_table() +create_symbol_table(void) { int i; bucket *bp; @@ -143,7 +140,7 @@ create_symbol_table() void -free_symbol_table() +free_symbol_table(void) { FREE(symbol_table); symbol_table = 0; @@ -151,7 +148,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 53b024f97c0..eea46064322 100644 --- a/usr.bin/yacc/verbose.c +++ b/usr.bin/yacc/verbose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verbose.c,v 1.7 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: verbose.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: verbose.c,v 1.4 1996/03/19 03:21:50 jtc Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)verbose.c 5.3 (Berkeley) 1/20/91"; #else -static char rcsid[] = "$OpenBSD: verbose.c,v 1.7 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: verbose.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ @@ -57,7 +57,7 @@ void print_reductions(action *, int); void print_gotos(int); void -verbose() +verbose(void) { int i; @@ -82,7 +82,7 @@ verbose() void -log_unused() +log_unused(void) { int i; short *p; @@ -102,7 +102,7 @@ log_unused() void -log_conflicts() +log_conflicts(void) { int i; @@ -131,8 +131,7 @@ log_conflicts() void -print_state(state) -int state; +print_state(int state) { if (state) fprintf(verbose_file, "\n\n"); @@ -146,8 +145,7 @@ int state; void -print_conflicts(state) -int state; +print_conflicts(int state) { int symbol, act, number; action *p; @@ -195,8 +193,7 @@ int state; void -print_core(state) -int state; +print_core(int state) { int i; int k; @@ -232,8 +229,7 @@ int state; void -print_nulls(state) -int state; +print_nulls(int state) { action *p; int i, j, k, nnulls; @@ -277,8 +273,7 @@ int state; void -print_actions(stateno) -int stateno; +print_actions(int stateno) { action *p; shifts *sp; @@ -305,8 +300,7 @@ int stateno; void -print_shifts(p) -action *p; +print_shifts(action *p) { int count; action *q; @@ -331,9 +325,7 @@ action *p; void -print_reductions(p, defred) -action *p; -int defred; +print_reductions(action *p, int defred) { int k, anyreds; action *q; @@ -370,8 +362,7 @@ int defred; 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 7e937da18db..73fc72e1e4a 100644 --- a/usr.bin/yacc/warshall.c +++ b/usr.bin/yacc/warshall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: warshall.c,v 1.7 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: warshall.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $ */ /* $NetBSD: warshall.c,v 1.4 1996/03/19 03:21:51 jtc Exp $ */ /* @@ -37,18 +37,16 @@ #if 0 static char sccsid[] = "@(#)warshall.c 5.4 (Berkeley) 5/24/93"; #else -static char rcsid[] = "$OpenBSD: warshall.c,v 1.7 2003/06/03 02:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: warshall.c,v 1.8 2003/06/19 16:34:53 pvalchev Exp $"; #endif #endif /* not lint */ #include "defs.h" -void transitive_closure(unsigned *, int); +void transitive_closure(unsigned int *, int); void -transitive_closure(R, n) -unsigned *R; -int n; +transitive_closure(unsigned int *R, int n) { int rowsize; unsigned i; @@ -99,9 +97,7 @@ int n; } void -reflexive_transitive_closure(R, n) -unsigned *R; -int n; +reflexive_transitive_closure(unsigned int *R, int n) { int rowsize; unsigned i; |