From ee0767da08f34de2495f8fb1dc19efc927bd5d6d Mon Sep 17 00:00:00 2001 From: pk Date: Sat, 24 Jun 1995 14:59:41 +0000 Subject: [PATCH] Always distinguish client and server worker routines (used to be the case only when compiling in ANSI (`-C') mode). --- usr.bin/rpcgen/rpc_main.c | 8 +++++--- usr.bin/rpcgen/rpc_svcout.c | 19 +++++-------------- usr.bin/rpcgen/rpc_tblout.c | 4 ++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index b42d6866f51d..a85b143fda36 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_main.c,v 1.6 1995/06/11 21:49:56 pk Exp $ */ +/* $NetBSD: rpc_main.c,v 1.7 1995/06/24 14:59:41 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -31,7 +31,7 @@ #ifndef lint static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; -static char cvsid[] = "$Id: rpc_main.c,v 1.6 1995/06/11 21:49:56 pk Exp $"; +static char cvsid[] = "$Id: rpc_main.c,v 1.7 1995/06/24 14:59:41 pk Exp $"; #endif /* @@ -615,7 +615,9 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) f_print(fout, "#include \n"); f_print(fout, "#include \n"); - f_print(fout, "#include \n"); + if (tirpcflag) + f_print(fout, "#include \n"); + if (inetdflag || !tirpcflag ) { f_print(fout, "#include \n"); f_print(fout, "#include \n"); diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index d771e2869226..32ef9dbc47af 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_svcout.c,v 1.6 1995/06/11 21:50:05 pk Exp $ */ +/* $NetBSD: rpc_svcout.c,v 1.7 1995/06/24 14:59:59 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -330,10 +330,7 @@ write_real_program(def) f_print(fout, "{\n"); f_print(fout, "\treturn("); - if( Cflag ) - pvname_svc(proc->proc_name, vp->vers_num); - else - pvname(proc->proc_name, vp->vers_num); + pvname_svc(proc->proc_name, vp->vers_num); f_print(fout, "("); if (proc->arg_num < 2) { /* single argument */ if (!streq( proc->args.decls->decl.type, "void")) @@ -450,7 +447,7 @@ write_program(def, storage) if (newstyle) { /* new style: calls internal routine */ f_print(fout,"_"); } - if( Cflag && !newstyle ) + if (!newstyle ) pvname_svc(proc->proc_name, vp->vers_num); else pvname(proc->proc_name, vp->vers_num); @@ -463,10 +460,7 @@ write_program(def, storage) f_print(fout, "\t}\n"); f_print(fout, "\t(void) memset((char *)&%s, 0, sizeof (%s));\n", ARG, ARG); - if (Cflag) - printif("getargs", TRANSP, "(caddr_t) &", ARG); - else - printif("getargs", TRANSP, "&", ARG); + printif("getargs", TRANSP, "(caddr_t) &", ARG); printerr("decode", TRANSP); print_return("\t\t"); f_print(fout, "\t}\n"); @@ -483,10 +477,7 @@ write_program(def, storage) printerr("systemerr", TRANSP); f_print(fout, "\t}\n"); - if (Cflag) - printif("freeargs", TRANSP, "(caddr_t) &", ARG); - else - printif("freeargs", TRANSP, "&", ARG); + printif("freeargs", TRANSP, "(caddr_t) &", ARG); (void) sprintf(_errbuf, "unable to free arguments"); print_err_message("\t\t"); f_print(fout, "\t\texit(1);\n"); diff --git a/usr.bin/rpcgen/rpc_tblout.c b/usr.bin/rpcgen/rpc_tblout.c index b69072371dd3..8fcbbc0f5263 100644 --- a/usr.bin/rpcgen/rpc_tblout.c +++ b/usr.bin/rpcgen/rpc_tblout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_tblout.c,v 1.2 1995/06/11 21:50:07 pk Exp $ */ +/* $NetBSD: rpc_tblout.c,v 1.3 1995/06/24 15:00:15 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -116,7 +116,7 @@ write_table(def) f_print(fout, "\n\t(char *(*)())RPCGEN_ACTION("); /* routine to invoke */ - if( Cflag && !newstyle ) + if ( !newstyle) pvname_svc(proc->proc_name, vp->vers_num); else { if( newstyle )