Skip to content
Browse files

fix OBS complaints

declare void functions to be void and add final returns to functions that will never reach them
  • Loading branch information...
1 parent ba95eca commit 04304e5f9e5a1545203a5536f1c54c19ae6e4e94 Andrew Jorgensen committed Sep 1, 2010
View
7 frontend/jay/closure.c
@@ -48,6 +48,7 @@ static unsigned *first_derives;
static unsigned *EFF;
+void
set_EFF()
{
register unsigned *row;
@@ -84,6 +85,7 @@ set_EFF()
}
+void
set_first_derives()
{
register unsigned *rrow;
@@ -139,6 +141,7 @@ set_first_derives()
}
+void
closure(nucleus, n)
short *nucleus;
int n;
@@ -209,6 +212,7 @@ int n;
+void
finalize_closure()
{
FREE(itemset);
@@ -219,6 +223,7 @@ finalize_closure()
#ifdef DEBUG
+void
print_closure(n)
int n;
{
@@ -230,6 +235,7 @@ int n;
}
+void
print_EFF()
{
register int i, j;
@@ -261,6 +267,7 @@ print_EFF()
}
+void
print_first_derives()
{
register int i;
View
29 frontend/jay/error.c
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)error.c 5.3 (Berkeley) 6/1/90";
#include "defs.h"
+void
fatal(msg)
char *msg;
{
@@ -51,13 +52,15 @@ char *msg;
}
+void
no_space()
{
fprintf(stderr, "%s: f - out of space\n", myname);
done(2);
}
+void
open_error(filename)
char *filename;
{
@@ -66,6 +69,7 @@ char *filename;
}
+void
unexpected_EOF()
{
fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n",
@@ -101,6 +105,7 @@ char *st_cptr;
}
+void
syntax_error(st_lineno, st_line, st_cptr)
int st_lineno;
char *st_line;
@@ -113,6 +118,7 @@ char *st_cptr;
}
+void
unterminated_comment(c_lineno, c_line, c_cptr)
int c_lineno;
char *c_line;
@@ -125,6 +131,7 @@ char *c_cptr;
}
+void
unterminated_string(s_lineno, s_line, s_cptr)
int s_lineno;
char *s_line;
@@ -137,6 +144,7 @@ char *s_cptr;
}
+void
unterminated_text(t_lineno, t_line, t_cptr)
int t_lineno;
char *t_line;
@@ -149,6 +157,7 @@ char *t_cptr;
}
+void
illegal_tag(t_lineno, t_line, t_cptr)
int t_lineno;
char *t_line;
@@ -161,6 +170,7 @@ char *t_cptr;
}
+void
illegal_character(c_cptr)
char *c_cptr;
{
@@ -171,6 +181,7 @@ char *c_cptr;
}
+void
used_reserved(s)
char *s;
{
@@ -180,6 +191,7 @@ char *s;
}
+void
tokenized_start(s)
char *s;
{
@@ -189,6 +201,7 @@ declared to be a token\n", myname, lineno, input_file_name, s);
}
+void
retyped_warning(s)
char *s;
{
@@ -197,6 +210,7 @@ redeclared\n", myname, lineno, input_file_name, s);
}
+void
reprec_warning(s)
char *s;
{
@@ -205,6 +219,7 @@ redeclared\n", myname, lineno, input_file_name, s);
}
+void
revalued_warning(s)
char *s;
{
@@ -213,6 +228,7 @@ redeclared\n", myname, lineno, input_file_name, s);
}
+void
terminal_start(s)
char *s;
{
@@ -222,13 +238,15 @@ token\n", myname, lineno, input_file_name, s);
}
+void
restarted_warning()
{
fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
redeclared\n", myname, lineno, input_file_name);
}
+void
no_grammar()
{
fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
@@ -237,6 +255,7 @@ specified\n", myname, lineno, input_file_name);
}
+void
terminal_lhs(s_lineno)
int s_lineno;
{
@@ -246,13 +265,15 @@ of a production\n", myname, s_lineno, input_file_name);
}
+void
prec_redeclared()
{
fprintf(stderr, "%s: w - line %d of \"%s\", conflicting %%prec \
specifiers\n", myname, lineno, input_file_name);
}
+void
unterminated_action(a_lineno, a_line, a_cptr)
int a_lineno;
char *a_line;
@@ -265,6 +286,7 @@ char *a_cptr;
}
+void
dollar_warning(a_lineno, i)
int a_lineno;
int i;
@@ -274,6 +296,7 @@ end of the current rule\n", myname, a_lineno, input_file_name, i);
}
+void
dollar_error(a_lineno, a_line, a_cptr)
int a_lineno;
char *a_line;
@@ -286,6 +309,7 @@ char *a_cptr;
}
+void
untyped_lhs()
{
fprintf(stderr, "%s: w - line %d of \"%s\", $$ is untyped\n",
@@ -294,6 +318,7 @@ untyped_lhs()
}
+void
untyped_rhs(i, s)
int i;
char *s;
@@ -304,6 +329,7 @@ char *s;
}
+void
unknown_rhs(i)
int i;
{
@@ -313,13 +339,15 @@ int i;
}
+void
default_action_warning()
{
fprintf(stderr, "%s: w - line %d of \"%s\", the default action assigns an \
undefined value to $$\n", myname, lineno, input_file_name);
}
+void
undefined_goal(s)
char *s;
{
@@ -328,6 +356,7 @@ char *s;
}
+void
undefined_symbol_warning(s)
char *s;
{
View
17 frontend/jay/lalr.c
@@ -74,6 +74,7 @@ static short *VERTICES;
static int top;
+void
lalr()
{
tokensetsize = WORDSIZE(ntokens);
@@ -93,6 +94,7 @@ lalr()
+void
set_state_table()
{
register core *sp;
@@ -104,6 +106,7 @@ set_state_table()
+void
set_accessing_symbol()
{
register core *sp;
@@ -115,6 +118,7 @@ set_accessing_symbol()
+void
set_shift_table()
{
register shifts *sp;
@@ -126,6 +130,7 @@ set_shift_table()
+void
set_reduction_table()
{
register reductions *rp;
@@ -137,6 +142,7 @@ set_reduction_table()
+void
set_maxrhs()
{
register short *itemp;
@@ -165,6 +171,7 @@ set_maxrhs()
+void
initialize_LA()
{
register int i, j, k;
@@ -202,6 +209,7 @@ initialize_LA()
}
+void
set_goto_map()
{
register shifts *sp;
@@ -296,10 +304,13 @@ int symbol;
else
high = middle - 1;
}
+ /*NOTREACHED*/
+ return (-1);
}
+void
initialize_F()
{
register int i;
@@ -377,6 +388,7 @@ initialize_F()
+void
build_relations()
{
register int i;
@@ -469,6 +481,7 @@ build_relations()
}
+void
add_lookback_edge(stateno, ruleno, gotono)
int stateno, ruleno, gotono;
{
@@ -554,12 +567,14 @@ int n;
+void
compute_FOLLOWS()
{
digraph(includes);
}
+void
compute_lookaheads()
{
register int i, n;
@@ -594,6 +609,7 @@ compute_lookaheads()
}
+void
digraph(relation)
short **relation;
{
@@ -621,6 +637,7 @@ short **relation;
+void
traverse(i)
register int i;
{
View
19 frontend/jay/lr0.c
@@ -69,6 +69,7 @@ static short **kernel_end;
static short *kernel_items;
+void
allocate_itemsets()
{
register short *itemp;
@@ -111,6 +112,7 @@ allocate_itemsets()
}
+void
allocate_storage()
{
allocate_itemsets();
@@ -120,6 +122,7 @@ allocate_storage()
}
+void
append_states()
{
register int i;
@@ -149,6 +152,7 @@ append_states()
}
+void
free_storage()
{
FREE(shift_symbol);
@@ -162,6 +166,7 @@ free_storage()
+void
generate_states()
{
allocate_storage();
@@ -254,6 +259,7 @@ int symbol;
+void
initialize_states()
{
register int i;
@@ -281,6 +287,7 @@ initialize_states()
}
+void
new_itemsets()
{
register int i;
@@ -358,6 +365,7 @@ int symbol;
/* show_cores is used for debugging */
+void
show_cores()
{
core *p;
@@ -393,6 +401,7 @@ show_cores()
/* show_ritems is used for debugging */
+void
show_ritems()
{
int i;
@@ -403,6 +412,7 @@ show_ritems()
/* show_rrhs is used for debugging */
+void
show_rrhs()
{
int i;
@@ -414,6 +424,7 @@ show_rrhs()
/* show_shifts is used for debugging */
+void
show_shifts()
{
shifts *p;
@@ -432,6 +443,7 @@ show_shifts()
}
+void
save_shifts()
{
register shifts *p;
@@ -466,6 +478,7 @@ save_shifts()
+void
save_reductions()
{
register short *isp;
@@ -515,6 +528,7 @@ save_reductions()
}
+void
set_derives()
{
register int i, k;
@@ -545,13 +559,15 @@ set_derives()
#endif
}
+void
free_derives()
{
FREE(derives[start_symbol]);
FREE(derives);
}
#ifdef DEBUG
+void
print_derives()
{
register int i;
@@ -574,6 +590,7 @@ print_derives()
#endif
+void
set_nullable()
{
register int i, j;
@@ -623,12 +640,14 @@ set_nullable()
}
+void
free_nullable()
{
FREE(nullable);
}
+void
lr0()
{
set_derives();
View
6 frontend/jay/main.c
@@ -98,6 +98,7 @@ extern char* mktemp();
extern char *getenv();
+void
done(k)
int k;
{
@@ -116,6 +117,7 @@ onintr(signo)
}
+void
set_signals()
{
#ifdef SIGINT
@@ -133,6 +135,7 @@ set_signals()
}
+void
usage()
{
fprintf(stderr, "usage: %s [-tvcp] [-b file_prefix] filename\n", myname);
@@ -253,6 +256,7 @@ unsigned n;
}
+void
create_file_names()
{
int i, len;
@@ -316,6 +320,7 @@ create_file_names()
}
+void
open_files()
{
create_file_names();
@@ -364,4 +369,5 @@ char *argv[];
output();
done(0);
/*NOTREACHED*/
+ return (-1);
}
View
8 frontend/jay/mkpar.c
@@ -59,6 +59,7 @@ extern action *add_reductions();
extern action *add_reduce();
+void
make_parser()
{
register int i;
@@ -189,6 +190,7 @@ register int ruleno, symbol;
}
+void
find_final_state()
{
register int goal, i;
@@ -206,6 +208,7 @@ find_final_state()
}
+void
unused_rules()
{
register int i;
@@ -238,6 +241,7 @@ unused_rules()
}
+void
remove_conflicts()
{
register int i;
@@ -313,6 +317,7 @@ remove_conflicts()
}
+void
total_conflicts()
{
fprintf(stderr, "%s: ", myname);
@@ -362,6 +367,7 @@ int stateno;
}
+void
defreds()
{
register int i;
@@ -371,6 +377,7 @@ defreds()
defred[i] = sole_reduction(i);
}
+void
free_action_row(p)
register action *p;
{
@@ -384,6 +391,7 @@ register action *p;
}
}
+void
free_parser()
{
register int i;
View
19 frontend/jay/output.c
@@ -62,6 +62,7 @@ void save_column (int symbol, int default_state);
void output_trailing_text (void);
void output_semantic_actions (void);
+void
output () {
int lno = 0;
char buf [128];
@@ -102,6 +103,7 @@ output () {
free_parser();
}
+void
output_rule_data()
{
register int i;
@@ -154,6 +156,7 @@ output_rule_data()
}
+void
output_yydefred()
{
register int i, j;
@@ -183,6 +186,7 @@ output_yydefred()
}
+void
output_actions()
{
nvectors = 2*nstates + nvars;
@@ -211,6 +215,7 @@ output_actions()
}
+void
token_actions()
{
register int i, j;
@@ -295,6 +300,7 @@ token_actions()
FREE(actionrow);
}
+void
goto_actions()
{
register int i, j, k;
@@ -406,6 +412,7 @@ int default_state;
width[symno] = sp1[-1] - sp[0] + 1;
}
+void
sort_actions()
{
register int i;
@@ -441,6 +448,7 @@ sort_actions()
}
+void
pack_table()
{
register int i;
@@ -618,10 +626,13 @@ int vector;
return (j);
}
}
+ /*NOTREACHED*/
+ return (-1);
}
+void
output_base()
{
register int i, j;
@@ -690,6 +701,7 @@ output_base()
+void
output_table()
{
register int i;
@@ -719,6 +731,7 @@ output_table()
+void
output_check()
{
register int i;
@@ -782,6 +795,7 @@ char *name;
}
+void
output_defines(prefix)
char *prefix;
{
@@ -821,6 +835,7 @@ char *prefix;
}
+void
output_stored_text(file, name)
FILE *file;
char *name;
@@ -848,6 +863,7 @@ char *name;
}
+void
output_debug()
{
register int i, j, k, max;
@@ -1138,6 +1154,7 @@ output_semantic_actions()
}
+void
free_itemsets()
{
register core *cp, *next;
@@ -1151,6 +1168,7 @@ free_itemsets()
}
+void
free_shifts()
{
register shifts *sp, *next;
@@ -1165,6 +1183,7 @@ free_shifts()
+void
free_reductions()
{
register reductions *rp, *next;
View
19 frontend/jay/reader.c
@@ -74,7 +74,7 @@ char *name_pool;
char *line_format = "\t\t\t\t\t// line %d \"%s\"\n";
char *default_line_format = "\t\t\t\t\t// line %d\n";
-
+void
cachec(c)
int c;
{
@@ -243,6 +243,8 @@ nextc()
return (*s);
}
}
+ /*NOTREACHED*/
+ return (-1);
}
@@ -302,6 +304,7 @@ keyword()
}
syntax_error(lineno, line, t_cptr);
/*NOTREACHED*/
+ return (-1);
}
void
@@ -776,6 +779,7 @@ declare_types()
}
+void
declare_start()
{
register int c;
@@ -835,6 +839,7 @@ read_declarations()
}
+void
initialize_grammar()
{
nitems = 4;
@@ -866,6 +871,7 @@ initialize_grammar()
}
+void
expand_items()
{
maxitems += 300;
@@ -874,6 +880,7 @@ expand_items()
}
+void
expand_rules()
{
maxrules += 100;
@@ -886,6 +893,7 @@ expand_rules()
}
+void
advance_to_start()
{
register int c;
@@ -936,6 +944,7 @@ advance_to_start()
}
+void
start_rule(bp, s_lineno)
register bucket *bp;
int s_lineno;
@@ -951,6 +960,7 @@ int s_lineno;
}
+void
end_rule()
{
register int i;
@@ -970,6 +980,7 @@ end_rule()
}
+void
insert_empty_rule()
{
register bucket *bp, **bpp;
@@ -1302,6 +1313,7 @@ mark_symbol()
}
+void
read_grammar()
{
register int c;
@@ -1350,6 +1362,7 @@ free_tags()
}
+void
pack_names()
{
register bucket *bp;
@@ -1375,6 +1388,7 @@ pack_names()
}
+void
check_symbols()
{
register bucket *bp;
@@ -1393,6 +1407,7 @@ check_symbols()
}
+void
pack_symbols()
{
register bucket *bp;
@@ -1517,6 +1532,7 @@ pack_symbols()
}
+void
pack_grammar()
{
register int i, j;
@@ -1612,6 +1628,7 @@ print_grammar()
}
+void
reader()
{
create_symbol_table();
View
3 frontend/jay/symtab.c
@@ -119,6 +119,7 @@ char *name;
}
+void
create_symbol_table()
{
register int i;
@@ -139,13 +140,15 @@ create_symbol_table()
}
+void
free_symbol_table()
{
FREE(symbol_table);
symbol_table = 0;
}
+void
free_symbols()
{
register bucket *p, *q;
View
10 frontend/jay/verbose.c
@@ -67,6 +67,7 @@ verbose()
}
+void
log_unused()
{
register int i;
@@ -86,6 +87,7 @@ log_unused()
}
+void
log_conflicts()
{
register int i;
@@ -114,6 +116,7 @@ log_conflicts()
}
+void
print_state(state)
int state;
{
@@ -128,6 +131,7 @@ int state;
}
+void
print_conflicts(state)
int state;
{
@@ -176,6 +180,7 @@ int state;
}
+void
print_core(state)
int state;
{
@@ -212,6 +217,7 @@ int state;
}
+void
print_nulls(state)
int state;
{
@@ -256,6 +262,7 @@ int state;
}
+void
print_actions(stateno)
int stateno;
{
@@ -283,6 +290,7 @@ int stateno;
}
+void
print_shifts(p)
register action *p;
{
@@ -308,6 +316,7 @@ register action *p;
}
+void
print_reductions(p, defred)
register action *p;
register int defred;
@@ -346,6 +355,7 @@ register int defred;
}
+void
print_gotos(stateno)
int stateno;
{
View
2 frontend/jay/warshall.c
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)warshall.c 5.4 (Berkeley) 5/24/93";
#include "defs.h"
+void
transitive_closure(R, n)
unsigned *R;
int n;
@@ -92,6 +93,7 @@ int n;
}
}
+void
reflexive_transitive_closure(R, n)
unsigned *R;
int n;

0 comments on commit 04304e5

Please sign in to comment.
Something went wrong with that request. Please try again.