diff options
author | jkh <jkh@FreeBSD.org> | 1996-07-12 19:08:36 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-07-12 19:08:36 +0000 |
commit | 730964efd28b80be48ed35a215a362dde2b6b7a7 (patch) | |
tree | b07c215aa55db3fb81db462f4bc70f61cd56c57f /usr.bin/compile_et | |
parent | c4d4a99d31762beef936f34571330923e9300da9 (diff) | |
download | FreeBSD-src-730964efd28b80be48ed35a215a362dde2b6b7a7.zip FreeBSD-src-730964efd28b80be48ed35a215a362dde2b6b7a7.tar.gz |
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Diffstat (limited to 'usr.bin/compile_et')
-rw-r--r-- | usr.bin/compile_et/compile_et.c | 13 | ||||
-rw-r--r-- | usr.bin/compile_et/error_table.y | 8 | ||||
-rw-r--r-- | usr.bin/compile_et/et_lex.lex.l | 4 |
3 files changed, 14 insertions, 11 deletions
diff --git a/usr.bin/compile_et/compile_et.c b/usr.bin/compile_et/compile_et.c index 8e3f492..fcedb8f 100644 --- a/usr.bin/compile_et/compile_et.c +++ b/usr.bin/compile_et/compile_et.c @@ -8,6 +8,8 @@ */ #include <stdio.h> +#include <stdlib.h> +#include <errno.h> #include <sys/file.h> #include <string.h> #include <sys/param.h> @@ -23,7 +25,7 @@ static const char copyright[] = "Copyright 1987,1988 by MIT Student Information Processing Board"; static const char rcsid_compile_et_c[] = - "$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/athena.lib/et/RCS/compile_et.c,v 1.3 91/02/28 15:15:23 epeisach Exp $"; + "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.2 1995/01/14 22:29:31 wollman Exp $"; #endif extern char *gensym(); @@ -33,10 +35,6 @@ char buffer[BUFSIZ]; char *table_name = (char *)NULL; FILE *hfile, *cfile; -/* C library */ -extern char *malloc(); -extern int errno; - /* lex stuff */ extern FILE *yyin; extern int yylineno; @@ -253,7 +251,7 @@ int main (argc, argv) int argc; char **argv; { for (cpp = struct_def; *cpp; cpp++) fputs (*cpp, cfile); fprintf(cfile, - "static const struct error_table et = { text, %ldL, %d };\n\n", + "static const struct error_table et = { text, %dL, %d };\n\n", table_number, current); fputs("static struct et_list link = { 0, 0 };\n\n", cfile); @@ -269,7 +267,7 @@ int main (argc, argv) int argc; char **argv; { fprintf (hfile, "extern void initialize_%s_error_table ();\n", table_name); - fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n", + fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%dL)\n", table_name, table_number); /* compatibility... */ fprintf (hfile, "\n/* for compatibility with older versions... */\n"); @@ -286,5 +284,6 @@ int yyerror(s) char *s; { fputs(s, stderr); fprintf(stderr, "\nLine number %d; last token was '%s'\n", yylineno, current_token); + return 0; } diff --git a/usr.bin/compile_et/error_table.y b/usr.bin/compile_et/error_table.y index cb3c0da..c29db13 100644 --- a/usr.bin/compile_et/error_table.y +++ b/usr.bin/compile_et/error_table.y @@ -1,7 +1,7 @@ %{ #include <stdio.h> +#include <stdlib.h> char *str_concat(), *ds(), *quote(); -void *malloc(), *realloc(); char *current_token = (char *)NULL; extern char *table_name; %} @@ -74,7 +74,7 @@ description : QUOTED_STRING #ifndef lint static char const rcsid_error_table_y[] = - "$Header: /home/ncvs/src/usr.bin/compile_et/error_table.y,v 1.2 1995/01/14 22:29:33 wollman Exp $"; + "$Header: /home/ncvs/src/usr.bin/compile_et/error_table.y,v 1.3 1995/03/15 19:05:28 wpaul Exp $"; #endif void *malloc(), *realloc(); @@ -124,6 +124,7 @@ long table_number; int current = 0; char **error_codes = (char **)NULL; +void add_ec(name, description) char const *name, *description; { @@ -138,6 +139,7 @@ add_ec(name, description) error_codes[current] = (char *)NULL; } +void add_ec_val(name, val, description) char const *name, *val, *description; { @@ -162,6 +164,7 @@ add_ec_val(name, val, description) error_codes[current] = (char *)NULL; } +void put_ecs() { int i; @@ -206,6 +209,7 @@ int char_to_num(c) exit (1); } +void set_table_num(string) char *string; { diff --git a/usr.bin/compile_et/et_lex.lex.l b/usr.bin/compile_et/et_lex.lex.l index 0c848de..48d1b89 100644 --- a/usr.bin/compile_et/et_lex.lex.l +++ b/usr.bin/compile_et/et_lex.lex.l @@ -11,7 +11,7 @@ end return END; [\t\n ] ; \"{PC}*\" { register char *p; yylval.dynstr = ds(yytext+1); - if (p=rindex(yylval.dynstr, '"')) *p='\0'; + if ( (p=rindex(yylval.dynstr, '"')) ) *p='\0'; return QUOTED_STRING; } @@ -22,5 +22,5 @@ end return END; . { return (*yytext); } %% #ifndef lint -static char rcsid_et_lex_lex_l[] = "$Header: et_lex.lex.l,v 1.3 87/10/31 06:28:05 raeburn Exp $"; +static char rcsid_et_lex_lex_l[] = "$Header: /home/ncvs/src/usr.bin/compile_et/et_lex.lex.l,v 1.2 1995/01/14 22:29:33 wollman Exp $"; #endif |