diff options
Diffstat (limited to 'usr.bin')
33 files changed, 313 insertions, 220 deletions
diff --git a/usr.bin/ar/append.c b/usr.bin/ar/append.c index 9bbe473..ea2e04c 100644 --- a/usr.bin/ar/append.c +++ b/usr.bin/ar/append.c @@ -71,7 +71,7 @@ append(argv) /* Read from disk, write to an archive; pad on write. */ SETCF(0, 0, afd, archive, WPAD); - for (eval = 0; file = *argv++;) { + for (eval = 0; (file = *argv++); ) { if ((fd = open(file, O_RDONLY)) < 0) { warn("%s", file); eval = 1; diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c index 021e131..d804b97 100644 --- a/usr.bin/ar/archive.c +++ b/usr.bin/ar/archive.c @@ -320,7 +320,7 @@ skip_arobj(fd) { off_t len; - len = chdr.size + (chdr.size + chdr.lname & 1); + len = chdr.size + ( (chdr.size + chdr.lname) & 1); if (lseek(fd, len, SEEK_CUR) == (off_t)-1) error(archive); } diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c index 5fef8d6..bcd9711 100644 --- a/usr.bin/ar/misc.c +++ b/usr.bin/ar/misc.c @@ -97,7 +97,7 @@ files(argv) for (list = argv; *list; ++list) if (compare(*list)) { p = *list; - for (; list[0] = list[1]; ++list) + for (; (list[0] = list[1]); ++list) continue; return (p); } diff --git a/usr.bin/ar/replace.c b/usr.bin/ar/replace.c index a226235..b9a6cc6 100644 --- a/usr.bin/ar/replace.c +++ b/usr.bin/ar/replace.c @@ -141,7 +141,7 @@ useold: SETCF(afd, archive, curfd, tname, RPAD|WPAD); } /* Append any left-over arguments to the end of the after file. */ -append: while (file = *argv++) { +append: while ( (file = *argv++) ) { if (options & AR_V) (void)printf("a - %s\n", file); if ((sfd = open(file, O_RDONLY)) < 0) { 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 diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c index aba1e21..4ec4ed6 100644 --- a/usr.bin/gcore/aoutcore.c +++ b/usr.bin/gcore/aoutcore.c @@ -80,7 +80,8 @@ void userdump __P((int, struct proc *, u_long, int)); kvm_t *kd; /* XXX undocumented routine, should be in kvm.h? */ -ssize_t kvm_uread __P((kvm_t *, struct proc *, u_long, char *, size_t)); +ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t)); + static int data_offset; diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c index aba1e21..4ec4ed6 100644 --- a/usr.bin/gcore/gcore.c +++ b/usr.bin/gcore/gcore.c @@ -80,7 +80,8 @@ void userdump __P((int, struct proc *, u_long, int)); kvm_t *kd; /* XXX undocumented routine, should be in kvm.h? */ -ssize_t kvm_uread __P((kvm_t *, struct proc *, u_long, char *, size_t)); +ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t)); + static int data_offset; diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index d5046e9..a015eab 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -486,7 +486,7 @@ ArchStatMember (archive, member, hash) strncpy(copy, member, AR_MAX_NAME_LEN); copy[AR_MAX_NAME_LEN] = '\0'; } - if (he = Hash_FindEntry (&ar->members, copy)) + if ( (he = Hash_FindEntry (&ar->members, copy)) ) return ((struct ar_hdr *) Hash_GetValue (he)); return ((struct ar_hdr *) NULL); } diff --git a/usr.bin/mk_cmds/cmd_tbl.l b/usr.bin/mk_cmds/cmd_tbl.l index 15b31c6..0c615ce 100644 --- a/usr.bin/mk_cmds/cmd_tbl.l +++ b/usr.bin/mk_cmds/cmd_tbl.l @@ -11,41 +11,41 @@ extern char *last_token, *ds(); -static l_command_table() +static int l_command_table() { last_token = "command_table"; return COMMAND_TABLE; } -static l_request() +static int l_request() { last_token = "request"; return REQUEST; } -static l_unimplemented() +static int l_unimplemented() { last_token = "unimplemented"; return UNIMPLEMENTED; } -static l_end() +static int l_end() { last_token = "end"; return END; } -static l_quoted_string() +static int l_quoted_string() { register char *p; yylval.dynstr = ds(yytext+1); - if (p=rindex(yylval.dynstr, '"')) + if ( (p=rindex(yylval.dynstr, '"')) ) *p='\0'; last_token = ds(yylval.dynstr); return STRING; } -static l_string() +static int l_string() { yylval.dynstr = ds(yytext); last_token = ds(yylval.dynstr); diff --git a/usr.bin/mk_cmds/mk_cmds.c b/usr.bin/mk_cmds/mk_cmds.c index 8298859..1c3a3fb 100644 --- a/usr.bin/mk_cmds/mk_cmds.c +++ b/usr.bin/mk_cmds/mk_cmds.c @@ -26,6 +26,7 @@ extern FILE *output_file; extern FILE *yyin, *yyout; extern int yylineno; +int main(argc, argv) int argc; char **argv; @@ -85,10 +86,12 @@ main(argc, argv) return result; } +int yyerror(s) char *s; { fputs(s, stderr); fprintf(stderr, "\nLine %d; last token was '%s'\n", yylineno, last_token); + return 0; } diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c index 2dc00c3..e7e7e7d 100644 --- a/usr.bin/nm/nm.c +++ b/usr.bin/nm/nm.c @@ -74,12 +74,18 @@ int (*sfunc)() = fname; #define SYMBOL_TYPE(x) ((x) & (N_TYPE | N_STAB)) void *emalloc(); +void usage __P(( void )); +int process_file __P(( char * )); +int show_archive __P(( char *, FILE * )); +int show_objfile __P(( char *, FILE * )); +void print_symbol __P(( char *, struct nlist * )); /* * main() * parse command line, execute process_file() for each file * specified on the command line. */ +int main(argc, argv) int argc; char **argv; @@ -143,6 +149,7 @@ main(argc, argv) * show symbols in the file given as an argument. Accepts archive and * object files as input. */ +int process_file(fname) char *fname; { @@ -205,6 +212,7 @@ static char *scat(char *dest, char *src) * show_archive() * show symbols in the given archive file */ +int show_archive(fname, fp) char *fname; FILE *fp; @@ -324,6 +332,7 @@ skip: if (fseek(fp, last_ar_off + even(atol(ar_head.ar_size)), * file pointer for fp is expected to be at the beginning of an a.out * header. */ +int show_objfile(objname, fp) char *objname; FILE *fp; @@ -457,6 +466,7 @@ show_objfile(objname, fp) * print_symbol() * show one symbol */ +void print_symbol(objname, sym) char *objname; register struct nlist *sym; @@ -589,6 +599,7 @@ typeletter(type) return('?'); } +int fname(a0, b0) void *a0, *b0; { @@ -597,6 +608,7 @@ fname(a0, b0) return(strcmp(a->n_un.n_name, b->n_un.n_name)); } +int rname(a0, b0) void *a0, *b0; { @@ -605,6 +617,7 @@ rname(a0, b0) return(strcmp(b->n_un.n_name, a->n_un.n_name)); } +int value(a0, b0) void *a0, *b0; { @@ -635,13 +648,14 @@ emalloc(size) char *p; /* NOSTRICT */ - if (p = malloc(size)) + if ( (p = malloc(size)) ) return(p); (void)fprintf(stderr, "nm: %s\n", strerror(errno)); exit(1); } -usage() +void +usage(void) { (void)fprintf(stderr, "usage: nm [-agnopruw] [file ...]\n"); exit(1); diff --git a/usr.bin/ranlib/build.c b/usr.bin/ranlib/build.c index 0951f2e..3b70630 100644 --- a/usr.bin/ranlib/build.c +++ b/usr.bin/ranlib/build.c @@ -48,10 +48,17 @@ static char sccsid[] = "@(#)build.c 8.1 (Berkeley) 6/6/93"; #include <fcntl.h> #include <ranlib.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> #include "archive.h" +extern int tmp __P(( void )); +extern void error __P(( char * )); +extern void badfmt __P(( void )); +extern void settime __P(( int )); + extern CHDR chdr; /* converted header */ extern char *archive; /* archive name */ extern char *tname; /* temporary file "name" */ @@ -72,7 +79,8 @@ long tsymlen; /* total string length */ static void rexec __P((int, int)); static void symobj __P((void)); -build() +int +build(void) { CF cf; int afd, tfd; diff --git a/usr.bin/ranlib/misc.c b/usr.bin/ranlib/misc.c index 5d1fe8f..600e49e 100644 --- a/usr.bin/ranlib/misc.c +++ b/usr.bin/ranlib/misc.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; #include <sys/signal.h> #include <errno.h> #include <unistd.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -50,7 +51,10 @@ static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; extern char *archive; /* archive name */ char *tname = "temporary file"; /* temporary file "name" */ -tmp() +void error __P(( char * )); + +int +tmp(void) { sigset_t set, oset; int fd; @@ -90,12 +94,14 @@ rname(path) return((ind = rindex(path, '/')) ? ind + 1 : path); } -badfmt() +void +badfmt(void) { errno = EFTYPE; error(archive); } +void error(name) char *name; { diff --git a/usr.bin/ranlib/ranlib.c b/usr.bin/ranlib/ranlib.c index 9d1d8a1..c109139 100644 --- a/usr.bin/ranlib/ranlib.c +++ b/usr.bin/ranlib/ranlib.c @@ -50,10 +50,15 @@ static char sccsid[] = "@(#)ranlib.c 8.1 (Berkeley) 6/6/93"; #include <stdlib.h> #include <archive.h> +extern int build __P(( void )); +extern int touch __P(( void )); +void usage __P((void)); + CHDR chdr; u_int options; /* UNUSED -- keep open_archive happy */ char *archive; +int main(argc, argv) int argc; char **argv; @@ -77,13 +82,15 @@ main(argc, argv) if (!*argv) usage(); - for (eval = 0; archive = *argv++;) + for (eval = 0; (archive = *argv++); ) eval |= tflag ? touch() : build(); exit(eval); } -usage() +void +usage(void) { (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); exit(1); } + diff --git a/usr.bin/ranlib/touch.c b/usr.bin/ranlib/touch.c index 0dd9123..68a86a4 100644 --- a/usr.bin/ranlib/touch.c +++ b/usr.bin/ranlib/touch.c @@ -52,7 +52,12 @@ static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93"; extern CHDR chdr; /* converted header */ extern char *archive; /* archive name */ -touch() +extern void error __P(( char * )); +void settime __P(( int )); +int touch __P(( void )); + +int +touch(void) { int afd; @@ -69,6 +74,7 @@ touch() return(0); } +void settime(afd) int afd; { diff --git a/usr.bin/rpcgen/rpc_clntout.c b/usr.bin/rpcgen/rpc_clntout.c index 9137ce1..e4a9db7 100644 --- a/usr.bin/rpcgen/rpc_clntout.c +++ b/usr.bin/rpcgen/rpc_clntout.c @@ -43,10 +43,10 @@ static char sccsid[] = "@(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI"; #include "rpc_parse.h" #include "rpc_util.h" -extern int pdeclaration __P(( char *, declaration *, int, char * )); +extern void pdeclaration __P(( char *, declaration *, int, char * )); void printarglist __P(( proc_list *, char *, char *, char *)); -static int write_program __P(( definition * )); -static int printbody __P(( proc_list * )); +static void write_program __P(( definition * )); +static void printbody __P(( proc_list * )); static char RESULT[] = "clnt_res"; @@ -72,7 +72,7 @@ write_stubs() } } -static +static void write_program(def) definition *def; { @@ -218,13 +218,12 @@ ampr(type) } } -static +static void printbody(proc) proc_list *proc; { decl_list *l; bool_t args2 = (proc->arg_num > 1); - int i; /* * For new style with multiple arguments, need a structure in which diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c index e79ac9d..7445fd7 100644 --- a/usr.bin/rpcgen/rpc_cout.c +++ b/usr.bin/rpcgen/rpc_cout.c @@ -39,17 +39,20 @@ static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; */ #include <stdio.h> #include <string.h> +#include <ctype.h> #include "rpc_parse.h" #include "rpc_util.h" -static int print_header __P(( definition * )); -static int print_trailer __P(( void )); -static int print_stat __P(( int , declaration * )); -static int emit_enum __P(( definition * )); -static int emit_program __P(( definition * )); -static int emit_union __P(( definition * )); -static int emit_struct __P(( definition * )); -static int emit_typedef __P(( definition * )); +static void print_header __P(( definition * )); +static void print_trailer __P(( void )); +static void print_stat __P(( int , declaration * )); +static void emit_enum __P(( definition * )); +static void emit_program __P(( definition * )); +static void emit_union __P(( definition * )); +static void emit_struct __P(( definition * )); +static void emit_typedef __P(( definition * )); +static void emit_inline __P(( int, declaration *, int )); +static void emit_single_in_line __P(( int, declaration *, int, relation )); /* * Emit the C-routine for the given definition @@ -89,11 +92,13 @@ emit(def) case DEF_TYPEDEF: emit_typedef(def); break; + /* DEF_CONST and DEF_PROGRAM have already been handled */ + default: } print_trailer(); } -static +static int findtype(def, type) definition *def; char *type; @@ -106,7 +111,7 @@ findtype(def, type) } } -static +static int undefined(type) char *type; { @@ -117,7 +122,7 @@ undefined(type) } -static +static void print_generic_header(procname, pointerp) char* procname; int pointerp; @@ -141,15 +146,10 @@ print_generic_header(procname, pointerp) } } -static +static void print_header(def) definition *def; { - - decl_list *dl; - bas_type *ptr; - int i; - print_generic_header(def->def_name, def->def_kind != DEF_TYPEDEF || !isvectordef(def->def.ty.old_type, @@ -162,14 +162,14 @@ print_header(def) f_print(fout, "\tregister long *buf;\n\n"); } -static +static void print_prog_header(plist) proc_list *plist; { print_generic_header(plist->args.argname, 1); } -static +static void print_trailer() { f_print(fout, "\treturn (TRUE);\n"); @@ -177,7 +177,7 @@ print_trailer() } -static +static void print_ifopen(indent, name) int indent; char *name; @@ -186,14 +186,14 @@ print_ifopen(indent, name) f_print(fout, "if (!xdr_%s(xdrs", name); } -static +static void print_ifarg(arg) char *arg; { f_print(fout, ", %s", arg); } -static +static void print_ifsizeof(indent, prefix, type) int indent; char *prefix; @@ -216,7 +216,7 @@ print_ifsizeof(indent, prefix, type) } } -static +static void print_ifclose(indent) int indent; { @@ -225,7 +225,7 @@ print_ifclose(indent) f_print(fout, "\treturn (FALSE);\n"); } -static +static void print_ifstat(indent, prefix, type, rel, amax, objname, name) int indent; char *prefix; @@ -302,7 +302,7 @@ print_ifstat(indent, prefix, type, rel, amax, objname, name) } /* ARGSUSED */ -static +static void emit_enum(def) definition *def; { @@ -311,7 +311,7 @@ emit_enum(def) print_ifclose(1); } -static +static void emit_program(def) definition *def; { @@ -332,7 +332,7 @@ emit_program(def) } -static +static void emit_union(def) definition *def; { @@ -385,6 +385,9 @@ strlen(dflt->name) + 1); dflt->array_max, object, dflt->name); free(object); f_print(fout, "\t\tbreak;\n"); + } else { + f_print(fout, "\tdefault:\n"); + f_print(fout, "\t\tbreak;\n"); } } else { f_print(fout, "\tdefault:\n"); @@ -553,12 +556,12 @@ int flag; } } -static +static void emit_struct(def) definition *def; { decl_list *dl; - int i, j, size, flag; + int j, size, flag; bas_type *ptr; int can_inline; @@ -623,7 +626,7 @@ emit_struct(def) } -static +static void emit_typedef(def) definition *def; { @@ -635,7 +638,7 @@ emit_typedef(def) print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name); } -static +static void print_stat(indent, dec) int indent; declaration *dec; @@ -657,6 +660,7 @@ print_stat(indent, dec) char *upcase (); +static void emit_inline(indent, decl, flag) int indent; declaration *decl; @@ -681,9 +685,11 @@ int flag; f_print(fout, "}\n"); tabify(fout, indent); f_print(fout, "}\n"); + default: } } +static void emit_single_in_line(indent, decl, flag, rel) int indent; declaration *decl; diff --git a/usr.bin/rpcgen/rpc_hout.c b/usr.bin/rpcgen/rpc_hout.c index ae73454..8dce77de 100644 --- a/usr.bin/rpcgen/rpc_hout.c +++ b/usr.bin/rpcgen/rpc_hout.c @@ -43,16 +43,18 @@ static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; #include "rpc_util.h" void storexdrfuncdecl __P(( char *, int )); -static int pconstdef __P(( definition * )); -static int pstructdef __P(( definition * )); -static int puniondef __P(( definition * )); -static int pprogramdef __P(( definition * )); -static int pstructdef __P(( definition * )); -static int penumdef __P(( definition * )); -static int ptypedef __P(( definition * )); -static int pdefine __P(( char *, char * )); +static void pconstdef __P(( definition * )); +static void pstructdef __P(( definition * )); +static void puniondef __P(( definition * )); +static void pprogramdef __P(( definition * )); +static void pstructdef __P(( definition * )); +static void penumdef __P(( definition * )); +static void ptypedef __P(( definition * )); +static void pdefine __P(( char *, char * )); static int undefined2 __P(( char *, char * )); -static int parglist __P(( proc_list *, char * )); +static void parglist __P(( proc_list *, char * )); +static void pprocdef __P(( proc_list *, version_list *, char *, int, int )); +void pdeclaration __P(( char *, declaration *, int, char * )); static char RESULT[] = "clnt_res"; @@ -109,7 +111,8 @@ print_funcdef(def) f_print(fout, "\n"); pprogramdef(def); break; - } + default: + } } /* store away enough information to allow the XDR functions to be spat @@ -157,7 +160,7 @@ int i; } -static +static void pconstdef(def) definition *def; { @@ -167,7 +170,7 @@ pconstdef(def) /* print out the definitions for the arguments of functions in the header file */ -static +static void pargdef(def) definition *def; { @@ -201,7 +204,7 @@ pargdef(def) } -static +static void pstructdef(def) definition *def; { @@ -216,7 +219,7 @@ pstructdef(def) f_print(fout, "typedef struct %s %s;\n", name, name); } -static +static void puniondef(def) definition *def; { @@ -245,7 +248,7 @@ puniondef(def) f_print(fout, "typedef struct %s %s;\n", name, name); } -static +static void pdefine(name, num) char *name; char *num; @@ -253,7 +256,7 @@ pdefine(name, num) f_print(fout, "#define\t%s %s\n", name, num); } -static +static void puldefine(name, num) char *name; char *num; @@ -261,7 +264,7 @@ puldefine(name, num) f_print(fout, "#define\t%s ((unsigned long)(%s))\n", name, num); } -static +static int define_printed(stop, start) proc_list *stop; version_list *start; @@ -282,7 +285,7 @@ define_printed(stop, start) /* NOTREACHED */ } -static +static void pfreeprocdef(char * name, char *vers, int mode) { f_print(fout, "extern int "); @@ -295,7 +298,7 @@ pfreeprocdef(char * name, char *vers, int mode) } -static +static void pprogramdef(def) definition *def; { @@ -371,6 +374,7 @@ pprogramdef(def) } } +static void pprocdef(proc, vp, addargtype, server_p, mode) proc_list *proc; version_list *vp; @@ -399,15 +403,12 @@ pprocdef(proc, vp, addargtype, server_p, mode) parglist(proc, addargtype); else f_print(fout, "();\n"); - - - } /* print out argument list of procedure */ -static +static void parglist(proc, addargtype) proc_list *proc; char* addargtype; @@ -438,7 +439,7 @@ parglist(proc, addargtype) } -static +static void penumdef(def) definition *def; { @@ -470,7 +471,7 @@ penumdef(def) f_print(fout, "typedef enum %s %s;\n", name, name); } -static +static void ptypedef(def) definition *def; { @@ -517,6 +518,7 @@ ptypedef(def) } } +void pdeclaration(name, dec, tab, separator) char *name; declaration *dec; @@ -575,7 +577,7 @@ pdeclaration(name, dec, tab, separator) f_print(fout, separator); } -static +static int undefined2(type, stop) char *type; char *stop; diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index 6902530..59431c3 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; #include <stdio.h> #include <string.h> #include <unistd.h> +#include <ctype.h> #include <sys/types.h> #include <sys/param.h> #include <sys/file.h> @@ -53,23 +54,26 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; extern void write_sample_svc __P(( definition * )); extern int write_sample_clnt __P(( definition * )); extern void write_sample_clnt_main __P(( void )); -static int c_output __P(( char *, char *, int, char * )); -static int h_output __P(( char *, char *, int, char * )); -static int l_output __P(( char *, char *, int, char * )); -static int t_output __P(( char *, char *, int, char * )); -static int clnt_output __P(( char *, char *, int, char * )); +extern void add_sample_msg __P(( void )); +static void c_output __P(( char *, char *, int, char * )); +static void h_output __P(( char *, char *, int, char * )); +static void l_output __P(( char *, char *, int, char * )); +static void t_output __P(( char *, char *, int, char * )); +static void clnt_output __P(( char *, char *, int, char * )); + +void c_initialize __P(( void )); #ifndef __FreeBSD__ char * rindex(); #endif -static int usage __P(( void )); -static int options_usage __P (( void )); +static void usage __P(( void )); +static void options_usage __P (( void )); static int do_registers __P(( int, char ** )); static int parseargs __P(( int, char **, struct commandline * )); -static int svc_output __P(( char *, char *, int, char * )); +static void svc_output __P(( char *, char *, int, char * )); static void mkfile_output __P(( struct commandline * )); -static int s_output __P(( int, char **, char *, char *, int, char *, int, int )); +static void s_output __P(( int, char **, char *, char *, int, char *, int, int )); #define EXTEND 1 /* alias for TRUE */ #define DONT_EXTEND 0 /* alias for FALSE */ @@ -156,6 +160,7 @@ xdrfunc *xdrfunc_tail = NULL; /* xdr function list */ pid_t childpid; +int main(argc, argv) int argc; char *argv[]; @@ -274,7 +279,7 @@ extendfile(file, ext) /* * Open output file with given extension */ -static +static void open_output(infile, outfile) char *infile; char *outfile; @@ -298,9 +303,10 @@ open_output(infile, outfile) } record_open(outfile); + return; } -static +static void add_warning() { f_print(fout, "/*\n"); @@ -342,7 +348,7 @@ static void find_cpp() /* * Open input file with given define for C-preprocessor */ -static +static void open_input(infile, define) char *infile; char *define; @@ -432,7 +438,7 @@ char *ext; } -static +static void c_output(infile, define, extend, outfile) char *infile; char *define; @@ -456,7 +462,7 @@ c_output(infile, define, extend, outfile) } else f_print(fout, "#include <rpc/rpc.h>\n"); tell = ftell(fout); - while (def = get_definition()) { + while ( (def = get_definition()) ) { emit(def); } if (extend && tell == ftell(fout)) { @@ -465,6 +471,7 @@ c_output(infile, define, extend, outfile) } +void c_initialize() { @@ -512,7 +519,7 @@ char *generate_guard(pathname) */ -static +static void h_output(infile, define, extend, outfile) char *infile; char *define; @@ -558,7 +565,7 @@ h_output(infile, define, extend, outfile) tell = ftell(fout); /* print data definitions */ - while (def = get_definition()) { + while ( (def = get_definition()) ) { print_datadef(def); } @@ -627,7 +634,7 @@ h_output(infile, define, extend, outfile) /* * Compile into an RPC service */ -static +static void s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) int argc; char *argv[]; @@ -710,7 +717,7 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) if (timerflag) f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime); - while (def = get_definition()) { + while ( (def = get_definition()) ) { foundprogram |= (def->def_kind == DEF_PROGRAM); } if (extend && !foundprogram) { @@ -731,7 +738,7 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) /* * generate client side stubs */ -static +static void l_output(infile, define, extend, outfile) char *infile; char *define; @@ -754,7 +761,7 @@ l_output(infile, define, extend, outfile) free(include); } else f_print(fout, "#include <rpc/rpc.h>\n"); - while (def = get_definition()) { + while ( (def = get_definition()) ) { foundprogram |= (def->def_kind == DEF_PROGRAM); } if (extend && !foundprogram) { @@ -767,7 +774,7 @@ l_output(infile, define, extend, outfile) /* * generate the dispatch table */ -static +static void t_output(infile, define, extend, outfile) char *infile; char *define; @@ -782,7 +789,7 @@ t_output(infile, define, extend, outfile) outfilename = extend ? extendfile(infile, outfile) : outfile; open_output(infile, outfilename); add_warning(); - while (def = get_definition()) { + while ( (def = get_definition()) ) { foundprogram |= (def->def_kind == DEF_PROGRAM); } if (extend && !foundprogram) { @@ -793,7 +800,7 @@ t_output(infile, define, extend, outfile) } /* sample routine for the server template */ -static +static void svc_output(infile, define, extend, outfile) char *infile; char *define; @@ -821,7 +828,7 @@ svc_output(infile, define, extend, outfile) f_print(fout, "#include <rpc/rpc.h>\n"); tell = ftell(fout); - while (def = get_definition()) { + while ( (def = get_definition()) ) { write_sample_svc(def); } if (extend && tell == ftell(fout)) { @@ -830,7 +837,7 @@ svc_output(infile, define, extend, outfile) } /* sample main routine for client */ -static +static void clnt_output(infile, define, extend, outfile) char *infile; char *define; @@ -859,7 +866,7 @@ clnt_output(infile, define, extend, outfile) } else f_print(fout, "#include <rpc/rpc.h>\n"); tell = ftell(fout); - while (def = get_definition()) { + while ( (def = get_definition()) ) { has_program += write_sample_clnt(def); } @@ -981,8 +988,8 @@ $(OBJECTS_SVC) $(CLIENT) $(SERVER)\n\n"); * Perform registrations for service output * Return 0 if failed; 1 otherwise. */ -static -int do_registers(argc, argv) +static int +do_registers(argc, argv) int argc; char *argv[]; { @@ -1078,7 +1085,7 @@ char *outfile; /* * Parse command line arguments */ -static +static int parseargs(argc, argv, cmd) int argc; char *argv[]; @@ -1129,10 +1136,10 @@ parseargs(argc, argv, cmd) case 'l': case 'm': case 't': - if (flag[c]) { + if (flag[(int)c]) { return (0); } - flag[c] = 1; + flag[(int)c] = 1; break; case 'S': /* @@ -1151,10 +1158,10 @@ parseargs(argc, argv, cmd) else return (0); - if (flag[ch]) { + if (flag[(int)ch]) { return (0); } - flag[ch] = 1; + flag[(int)ch] = 1; break; case 'C': /* ANSI C syntax */ Cflag = 1; @@ -1211,7 +1218,7 @@ parseargs(argc, argv, cmd) argv[i][j + 1] != 0) { return (0); } - flag[c] = 1; + flag[(int)c] = 1; if (++i == argc) { return (0); } @@ -1306,7 +1313,7 @@ parseargs(argc, argv, cmd) return (1); } -static +static void usage() { f_print(stderr, "usage: %s infile\n", cmdname); @@ -1324,7 +1331,7 @@ usage() exit(1); } -static +static void options_usage() { f_print(stderr, "options:\n"); diff --git a/usr.bin/rpcgen/rpc_parse.c b/usr.bin/rpcgen/rpc_parse.c index fb8eec1..5431520 100644 --- a/usr.bin/rpcgen/rpc_parse.c +++ b/usr.bin/rpcgen/rpc_parse.c @@ -47,17 +47,17 @@ static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI"; #define ARGNAME "arg" extern char *make_argname __P(( char *, char * )); -static int isdefined __P(( definition * )); -static int def_struct __P(( definition * )); -static int def_program __P(( definition * )); -static int def_enum __P(( definition * )); -static int def_const __P(( definition * )); -static int def_union __P(( definition * )); -static int def_typedef __P(( definition * )); -static int get_declaration __P(( declaration *, defkind )); -static int get_prog_declaration __P(( declaration *, defkind, int )); -static int get_type __P(( char **, char **, defkind )); -static int unsigned_dec __P(( char ** )); +static void isdefined __P(( definition * )); +static void def_struct __P(( definition * )); +static void def_program __P(( definition * )); +static void def_enum __P(( definition * )); +static void def_const __P(( definition * )); +static void def_union __P(( definition * )); +static void def_typedef __P(( definition * )); +static void get_declaration __P(( declaration *, defkind )); +static void get_prog_declaration __P(( declaration *, defkind, int )); +static void get_type __P(( char **, char **, defkind )); +static void unsigned_dec __P(( char ** )); #ifndef __FreeBSD__ extern char *strdup(); @@ -103,14 +103,14 @@ get_definition() return (defp); } -static +static void isdefined(defp) definition *defp; { STOREVAL(&defined, defp); } -static +static void def_struct(defp) definition *defp; { @@ -138,7 +138,7 @@ def_struct(defp) *tailp = NULL; } -static +static void def_program(defp) definition *defp; { @@ -245,7 +245,7 @@ def_program(defp) } -static +static void def_enum(defp) definition *defp; { @@ -275,7 +275,7 @@ def_enum(defp) *tailp = NULL; } -static +static void def_const(defp) definition *defp; { @@ -289,13 +289,13 @@ def_const(defp) defp->def.co = tok.str; } -static +static void def_union(defp) definition *defp; { token tok; declaration dec; - case_list *cases, *tcase; + case_list *cases; case_list **tailp; int flag; @@ -388,7 +388,8 @@ static char* reserved_types[] = * check that the given name is not one that would eventually result in * xdr routines that would conflict with internal XDR routines. */ -static check_type_name(name, new_type) +static void +check_type_name(name, new_type) int new_type; char* name; { @@ -417,7 +418,7 @@ char* name; -static +static void def_typedef(defp) definition *defp; { @@ -433,7 +434,7 @@ def_typedef(defp) defp->def.ty.array_max = dec.array_max; } -static +static void get_declaration(dec, dkind) declaration *dec; defkind dkind; @@ -486,7 +487,7 @@ get_declaration(dec, dkind) } -static +static void get_prog_declaration(dec, dkind, num) declaration *dec; defkind dkind; @@ -559,7 +560,7 @@ get_prog_declaration(dec, dkind, num) -static +static void get_type(prefixp, typep, dkind) char **prefixp; char **typep; @@ -617,7 +618,7 @@ get_type(prefixp, typep, dkind) } } -static +static void unsigned_dec(typep) char **typep; { diff --git a/usr.bin/rpcgen/rpc_sample.c b/usr.bin/rpcgen/rpc_sample.c index 435bb44..1de374c 100644 --- a/usr.bin/rpcgen/rpc_sample.c +++ b/usr.bin/rpcgen/rpc_sample.c @@ -43,9 +43,9 @@ static char RQSTP[] = "rqstp"; extern void printarglist __P(( proc_list *, char *, char *, char *)); -static int write_sample_client __P(( char *, version_list * )); -static int write_sample_server __P(( definition * )); -static int return_type __P(( proc_list * )); +static void write_sample_client __P(( char *, version_list * )); +static void write_sample_server __P(( definition * )); +static void return_type __P(( proc_list * )); void write_sample_svc(def) @@ -76,7 +76,7 @@ write_sample_clnt(def) } -static +static void write_sample_client(program_name, vp) char *program_name; version_list *vp; @@ -192,7 +192,7 @@ write_sample_client(program_name, vp) f_print(fout, "}\n"); } -static +static void write_sample_server(def) definition *def; { @@ -261,13 +261,14 @@ write_sample_server(def) -static +static void return_type(plist) proc_list *plist; { ptype(plist->res_prefix, plist->res_type, 1); } +void add_sample_msg() { f_print(fout, "/*\n"); diff --git a/usr.bin/rpcgen/rpc_scan.c b/usr.bin/rpcgen/rpc_scan.c index e65b799..d1d03aa 100644 --- a/usr.bin/rpcgen/rpc_scan.c +++ b/usr.bin/rpcgen/rpc_scan.c @@ -52,15 +52,15 @@ static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI"; static int pushed = 0; /* is a token pushed */ static token lasttok; /* last token, if pushed */ -static int unget_token __P(( token * )); -static int findstrconst __P(( char **, char **)); -static int findchrconst __P(( char **, char **)); -static int findconst __P(( char **, char **)); -static int findkind __P(( char **, token * )); +static void unget_token __P(( token * )); +static void findstrconst __P(( char **, char **)); +static void findchrconst __P(( char **, char **)); +static void findconst __P(( char **, char **)); +static void findkind __P(( char **, token * )); static int cppline __P(( char * )); static int directive __P(( char * )); -static int printdirective __P(( char * )); -static int docppline __P(( char *, int *, char ** )); +static void printdirective __P(( char * )); +static void docppline __P(( char *, int *, char ** )); /* * scan expecting 1 given token @@ -315,7 +315,7 @@ get_token(tokp) } } -static +static void unget_token(tokp) token *tokp; { @@ -323,7 +323,7 @@ unget_token(tokp) pushed = 1; } -static +static void findstrconst(str, val) char **str; char **val; @@ -333,7 +333,7 @@ findstrconst(str, val) p = *str; do { - *p++; + p++; } while (*p && *p != '"'); if (*p == 0) { error("unterminated string constant"); @@ -346,7 +346,7 @@ findstrconst(str, val) *str = p; } -static +static void findchrconst(str, val) char **str; char **val; @@ -356,7 +356,7 @@ findchrconst(str, val) p = *str; do { - *p++; + p++; } while (*p && *p != '\''); if (*p == 0) { error("unterminated string constant"); @@ -372,7 +372,7 @@ findchrconst(str, val) *str = p; } -static +static void findconst(str, val) char **str; char **val; @@ -425,7 +425,7 @@ static token symbols[] = { {TOK_EOF, "??????"}, }; -static +static void findkind(mark, tokp) char **mark; token *tokp; @@ -454,28 +454,28 @@ findkind(mark, tokp) *mark = str + len; } -static +static int cppline(line) char *line; { return (line == curline && *line == '#'); } -static +static int directive(line) char *line; { return (line == curline && *line == '%'); } -static +static void printdirective(line) char *line; { f_print(fout, "%s", line + 1); } -static +static void docppline(line, lineno, fname) char *line; int *lineno; diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index a7b7d87..cb26f22 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -52,21 +52,23 @@ static char RETVAL[] = "retval"; char _errbuf[256]; /* For all messages */ void internal_proctype __P(( proc_list * )); -static int write_real_program __P(( definition * )); -static int write_program __P(( definition *, char * )); -static int printerr __P(( char *, char * )); -static int printif __P(( char *, char *, char *, char * )); -static int write_inetmost __P(( char * )); -static int print_return __P(( char * )); -static int print_pmapunset __P(( char * )); -static int print_err_message __P(( char * )); -static int write_timeout_func __P(( void )); -static int write_pm_most __P(( char *, int )); -static int write_rpc_svc_fg __P(( char *, char * )); -static int open_log_file __P(( char *, char * )); - - -static +static void write_real_program __P(( definition * )); +static void write_program __P(( definition *, char * )); +static void printerr __P(( char *, char * )); +static void printif __P(( char *, char *, char *, char * )); +static void write_inetmost __P(( char * )); +static void print_return __P(( char * )); +static void print_pmapunset __P(( char * )); +static void print_err_message __P(( char * )); +static void write_timeout_func __P(( void )); +static void write_pm_most __P(( char *, int )); +static void write_rpc_svc_fg __P(( char *, char * )); +static void open_log_file __P(( char *, char * )); +static void write_msg_out __P(( void )); +int nullproc __P(( proc_list * )); + + +static void p_xdrfunc(rname, typename) char* rname; char* typename; @@ -320,7 +322,7 @@ write_programs(storage) * Unpacks single user argument of printmsg_1 to call-by-value format * expected by printmsg_1. */ -static +static void write_real_program(def) definition *def; { @@ -399,7 +401,7 @@ write_real_program(def) } } -static +static void write_program(def, storage) definition *def; char *storage; @@ -618,7 +620,7 @@ write_program(def, storage) } } -static +static void printerr(err, transp) char *err; char *transp; @@ -626,7 +628,7 @@ printerr(err, transp) f_print(fout, "\t\tsvcerr_%s(%s);\n", err, transp); } -static +static void printif(proc, transp, prefix, arg) char *proc; char *transp; @@ -637,6 +639,7 @@ printif(proc, transp, prefix, arg) proc, transp, arg, prefix, arg); } +int nullproc(proc) proc_list *proc; { @@ -648,7 +651,7 @@ nullproc(proc) return (0); } -static +static void write_inetmost(infile) char *infile; { @@ -677,7 +680,7 @@ write_inetmost(infile) f_print(fout, "\t}\n"); } -static +static void print_return(space) char *space; { @@ -695,7 +698,7 @@ print_return(space) } } -static +static void print_pmapunset(space) char *space; { @@ -715,7 +718,7 @@ print_pmapunset(space) } } -static +static void print_err_message(space) char *space; { @@ -744,7 +747,8 @@ write_svc_aux(nomain) * Write the _msgout function */ -write_msg_out() +static void +write_msg_out(void) { f_print(fout, "\n"); /* @@ -776,8 +780,8 @@ write_msg_out() /* * Write the timeout function */ -static -write_timeout_func() +static void +write_timeout_func(void) { if (!timerflag) return; @@ -841,7 +845,7 @@ write_timeout_func() /* * Write the most of port monitor support */ -static +static void write_pm_most(infile, netflag) char *infile; int netflag; @@ -940,7 +944,7 @@ ioctl(0, I_PUSH, \"timod\")) {\n"); /* * Support for backgrounding the server if self started. */ -static +static void write_rpc_svc_fg(infile, sp) char *infile; char *sp; @@ -992,7 +996,7 @@ write_rpc_svc_fg(infile, sp) open_log_file(infile, sp); } -static +static void open_log_file(infile, sp) char *infile; char *sp; diff --git a/usr.bin/rpcgen/rpc_tblout.c b/usr.bin/rpcgen/rpc_tblout.c index e851ded..f8b56798 100644 --- a/usr.bin/rpcgen/rpc_tblout.c +++ b/usr.bin/rpcgen/rpc_tblout.c @@ -58,8 +58,9 @@ static char null_entry[] = "\n\t(char *(*)())0,\n\ static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n"; -static int write_table __P(( definition * )); -static int printit __P(( char *, char * )); +extern int nullproc __P(( proc_list * )); +static void write_table __P(( definition * )); +static void printit __P(( char *, char * )); void write_tables() @@ -76,7 +77,7 @@ write_tables() } } -static +static void write_table(def) definition *def; { @@ -143,7 +144,7 @@ write_table(def) } } -static +static void printit(prefix, type) char *prefix; char *type; diff --git a/usr.bin/rpcgen/rpc_util.c b/usr.bin/rpcgen/rpc_util.c index 5d3fa06..1ade911 100644 --- a/usr.bin/rpcgen/rpc_util.c +++ b/usr.bin/rpcgen/rpc_util.c @@ -38,7 +38,9 @@ static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI"; * Copyright (C) 1989, Sun Microsystems, Inc. */ #include <stdio.h> +#include <string.h> #include <ctype.h> +#include <unistd.h> #include "rpc_scan.h" #include "rpc_parse.h" #include "rpc_util.h" @@ -60,11 +62,12 @@ FILE *fin; /* file pointer of current input */ list *defined; /* list of defined things */ -static int printwhere __P(( void )); +static void printwhere __P(( void )); /* * Reinitialize the world */ +void reinitialize() { memset(curline, 0, MAXLINESIZE); @@ -76,6 +79,7 @@ reinitialize() /* * string equality */ +int streq(a, b) char *a; char *b; @@ -119,7 +123,7 @@ storeval(lstp, val) *l = lst; } -static +static int findit(def, type) definition *def; char *type; @@ -192,7 +196,7 @@ ptype(prefix, type, follow) } } -static +static int typedefed(def, type) definition *def; char *type; @@ -204,6 +208,7 @@ typedefed(def, type) } } +int isvectordef(type, rel) char *type; relation rel; @@ -227,6 +232,8 @@ isvectordef(type, rel) rel = def->def.ty.rel; } } + + return (0); } char * @@ -237,7 +244,7 @@ locase(str) static char buf[100]; char *p = buf; - while (c = *str++) { + while ( (c = *str++) ) { *p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c; } *p = 0; @@ -277,6 +284,7 @@ error(msg) * Something went wrong, unlink any files that we may have created and then * die. */ +void crash() { int i; @@ -399,7 +407,7 @@ toktostr(kind) return (sp->str); } -static +static void printbuf() { char c; @@ -408,7 +416,7 @@ printbuf() # define TABSIZE 4 - for (i = 0; c = curline[i]; i++) { + for (i = 0; (c = curline[i]); i++) { if (c == '\t') { cnt = 8 - (i % TABSIZE); c = ' '; @@ -421,7 +429,7 @@ printbuf() } } -static +static void printwhere() { int i; @@ -462,6 +470,7 @@ make_argname(pname, vname) bas_type *typ_list_h; bas_type *typ_list_t; +void add_type(len, type) int len; char *type; diff --git a/usr.bin/rpcgen/rpc_util.h b/usr.bin/rpcgen/rpc_util.h index 259860f..f465bfc 100644 --- a/usr.bin/rpcgen/rpc_util.h +++ b/usr.bin/rpcgen/rpc_util.h @@ -149,6 +149,10 @@ extern pid_t childpid; /* * rpc_util routines */ +void reinitialize(); +void crash(); +void add_type(int len, char *type); + void storeval(); #define STOREVAL(list,item) \ diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c index fa023b7..1151166 100644 --- a/usr.bin/xlint/lint1/decl.c +++ b/usr.bin/xlint/lint1/decl.c @@ -479,6 +479,7 @@ tdeferr(td, t) } break; /* LINTED (enumeration values not handled in switch) */ + default: } /* Anything other is not accepted. */ diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index 53f0083..ece6ef9 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -43,6 +43,7 @@ static char rcsid[] = "$NetBSD: scan.l,v 1.8 1995/10/23 13:38:51 jpo Exp $"; #include <ctype.h> #include <errno.h> #include <err.h> +#include <math.h> #include "lint1.h" #include "y.tab.h" @@ -554,6 +555,7 @@ icon(base) } break; /* LINTED (enumeration values not handled in switch) */ + default: } if (typ != QUAD && typ != UQUAD) { diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 36dda83..5770f08 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -39,6 +39,7 @@ static char rcsid[] = "$NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $"; #include <string.h> #include <float.h> #include <limits.h> +#include <math.h> #include "lint1.h" #include "y.tab.h" @@ -1132,6 +1133,7 @@ typeok(op, arg, ln, rn) nulleff(ln); break; /* LINTED (enumeration values not handled in switch) */ + default: } if (mp->m_badeop && @@ -3575,6 +3577,7 @@ chkmisc(tn, vctx, tctx, eqwarn, fcall, rvdisc, szof) case STRING: return; /* LINTED (enumeration values not handled in switch) */ + default: } cvctx = mp->m_vctx; @@ -3913,6 +3916,7 @@ precconf(tn) } break; /* LINTED (enumeration values not handled in switch) */ + default: } if (warn) { diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c index daffe1e..6498a5c 100644 --- a/usr.bin/xlint/lint2/read.c +++ b/usr.bin/xlint/lint2/read.c @@ -613,6 +613,7 @@ inptype(cp, epp) } break; /* LINTED (enumeration value(s) not handled in switch) */ + default: } *epp = cp; @@ -782,6 +783,7 @@ gettlen(cp, epp) } break; /* LINTED (enumeration value(s) not handled in switch) */ + default: } *epp = cp; diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 852fd01..515456f 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -517,6 +517,7 @@ main(argc, argv) terminate(0); /* NOTREACHED */ + return 0; } /* |