Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/rpcgen WARNS=5



details:   https://anonhg.NetBSD.org/src/rev/d2504f9edd80
branches:  trunk
changeset: 789237:d2504f9edd80
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 11 08:03:10 2013 +0000

description:
WARNS=5

diffstat:

 usr.bin/rpcgen/Makefile      |    4 +-
 usr.bin/rpcgen/rpc_clntout.c |   31 ++---
 usr.bin/rpcgen/rpc_cout.c    |  124 +++++++++---------------
 usr.bin/rpcgen/rpc_hout.c    |   95 +++++++------------
 usr.bin/rpcgen/rpc_main.c    |  208 +++++++++++++++++++-----------------------
 usr.bin/rpcgen/rpc_parse.c   |   58 ++++-------
 usr.bin/rpcgen/rpc_parse.h   |   42 ++++----
 usr.bin/rpcgen/rpc_sample.c  |   26 ++---
 usr.bin/rpcgen/rpc_scan.c    |  123 ++++++++++--------------
 usr.bin/rpcgen/rpc_scan.h    |    4 +-
 usr.bin/rpcgen/rpc_svcout.c  |  116 ++++++++---------------
 usr.bin/rpcgen/rpc_tblout.c  |   15 +-
 usr.bin/rpcgen/rpc_util.c    |  125 +++++++++----------------
 usr.bin/rpcgen/rpc_util.h    |   52 +++++-----
 14 files changed, 412 insertions(+), 611 deletions(-)

diffs (truncated from 2651 to 300 lines):

diff -r d705c38bd4c6 -r d2504f9edd80 usr.bin/rpcgen/Makefile
--- a/usr.bin/rpcgen/Makefile   Sun Aug 11 06:48:46 2013 +0000
+++ b/usr.bin/rpcgen/Makefile   Sun Aug 11 08:03:10 2013 +0000
@@ -1,6 +1,4 @@
-#      $NetBSD: Makefile,v 1.12 2009/04/14 22:15:25 lukem Exp $
-
-WARNS?=        2       # XXX -Wcast-qual issues
+#      $NetBSD: Makefile,v 1.13 2013/08/11 08:03:10 dholland Exp $
 
 PROG=  rpcgen
 SRCS=  rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c rpc_parse.c rpc_scan.c \
diff -r d705c38bd4c6 -r d2504f9edd80 usr.bin/rpcgen/rpc_clntout.c
--- a/usr.bin/rpcgen/rpc_clntout.c      Sun Aug 11 06:48:46 2013 +0000
+++ b/usr.bin/rpcgen/rpc_clntout.c      Sun Aug 11 08:03:10 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc_clntout.c,v 1.13 2004/06/20 22:20:16 jmc Exp $     */
+/*     $NetBSD: rpc_clntout.c,v 1.14 2013/08/11 08:03:10 dholland 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
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI";
 #else
-__RCSID("$NetBSD: rpc_clntout.c,v 1.13 2004/06/20 22:20:16 jmc Exp $");
+__RCSID("$NetBSD: rpc_clntout.c,v 1.14 2013/08/11 08:03:10 dholland Exp $");
 #endif
 #endif
 
@@ -54,8 +54,8 @@
 #include "rpc_util.h"
 
 static void write_program __P((definition *));
-static char *ampr __P((char *));
-static char *aster __P((char *));
+static const char *ampr __P((const char *));
+static const char *aster __P((const char *));
 static void printbody __P((proc_list *));
 
 #define DEFAULT_TIMEOUT 25     /* in seconds */
@@ -63,7 +63,7 @@
 
 
 void
-write_stubs()
+write_stubs(void)
 {
        list   *l;
        definition *def;
@@ -81,8 +81,7 @@
 }
 
 static void
-write_program(def)
-       definition *def;
+write_program(definition *def)
 {
        version_list *vp;
        proc_list *proc;
@@ -112,9 +111,8 @@
 /* sample addargname = "clnt"; sample addargtype = "CLIENT * " */
 
 void 
-printarglist(proc, result, addargname, addargtype)
-       proc_list *proc;
-       char   *result, *addargname, *addargtype;
+printarglist(proc_list *proc, const char *result,
+            const char *addargname, const char *addargtype)
 {
 
        decl_list *l;
@@ -202,9 +200,8 @@
 }
 
 
-static char *
-ampr(type)
-       char   *type;
+static const char *
+ampr(const char *type)
 {
        if (isvectordef(type, REL_ALIAS)) {
                return ("");
@@ -213,9 +210,8 @@
        }
 }
 
-static char *
-aster(type)
-       char   *type;
+static const char *
+aster(const char *type)
 {
        if (isvectordef(type, REL_ALIAS)) {
                return ("");
@@ -225,8 +221,7 @@
 }
 
 static void
-printbody(proc)
-       proc_list *proc;
+printbody(proc_list *proc)
 {
        decl_list *l;
        bool_t  args2 = (proc->arg_num > 1);
diff -r d705c38bd4c6 -r d2504f9edd80 usr.bin/rpcgen/rpc_cout.c
--- a/usr.bin/rpcgen/rpc_cout.c Sun Aug 11 06:48:46 2013 +0000
+++ b/usr.bin/rpcgen/rpc_cout.c Sun Aug 11 08:03:10 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc_cout.c,v 1.30 2011/08/31 16:24:58 plunky Exp $     */
+/*     $NetBSD: rpc_cout.c,v 1.31 2013/08/11 08:03:10 dholland 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
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI";
 #else
-__RCSID("$NetBSD: rpc_cout.c,v 1.30 2011/08/31 16:24:58 plunky Exp $");
+__RCSID("$NetBSD: rpc_cout.c,v 1.31 2013/08/11 08:03:10 dholland Exp $");
 #endif
 #endif
 
@@ -54,17 +54,18 @@
 #include "rpc_parse.h"
 #include "rpc_util.h"
 
-static int findtype __P((definition *, char *));
-static int undefined __P((char *));
-static void print_generic_header __P((char *, int));
+static int findtype __P((definition *, const char *));
+static int undefined __P((const char *));
+static void print_generic_header __P((const char *, int));
 static void print_header __P((definition *));
 static void print_prog_header __P((proc_list *));
 static void print_trailer __P((void));
-static void print_ifopen __P((int, char *));
-static void print_ifarg __P((char *));
-static void print_ifsizeof __P((char *, char *));
+static void print_ifopen __P((int, const char *));
+static void print_ifarg __P((const char *));
+static void print_ifsizeof __P((const char *, const char *));
 static void print_ifclose __P((int));
-static void print_ifstat __P((int, char *, char *, relation, char *, char *, char *));
+static void print_ifstat __P((int, const char *, const char *, relation,
+                             const char *, const char *, const char *));
 static void emit_enum __P((definition *));
 static void emit_program __P((definition *));
 static void emit_union __P((definition *));
@@ -76,8 +77,7 @@
  * Emit the C-routine for the given definition
  */
 void
-emit(def)
-       definition *def;
+emit(definition *def)
 {
        if (def->def_kind == DEF_CONST) {
                return;
@@ -120,9 +120,7 @@
 }
 
 static int
-findtype(def, type)
-       definition *def;
-       char   *type;
+findtype(definition *def, const char *type)
 {
 
        if (def->def_kind == DEF_PROGRAM || def->def_kind == DEF_CONST) {
@@ -133,8 +131,7 @@
 }
 
 static int
-undefined(type)
-       char   *type;
+undefined(const char *type)
 {
        definition *def;
 
@@ -145,9 +142,7 @@
 }
 
 static void
-print_generic_header(procname, pointerp)
-       char   *procname;
-       int     pointerp;
+print_generic_header(const char *procname, int pointerp)
 {
        f_print(fout, "\n");
        f_print(fout, "bool_t\n");
@@ -169,8 +164,7 @@
 }
 
 static void
-print_header(def)
-       definition *def;
+print_header(definition *def)
 {
        print_generic_header(def->def_name,
            def->def_kind != DEF_TYPEDEF ||
@@ -178,14 +172,13 @@
 }
 
 static void
-print_prog_header(plist)
-       proc_list *plist;
+print_prog_header(proc_list *plist)
 {
        print_generic_header(plist->args.argname, 1);
 }
 
 static void
-print_trailer()
+print_trailer(void)
 {
        f_print(fout, "\treturn (TRUE);\n");
        f_print(fout, "}\n");
@@ -193,9 +186,7 @@
 
 
 static void
-print_ifopen(indent, name)
-       int     indent;
-       char   *name;
+print_ifopen(int indent, const char *name)
 {
        char _t_kludge[32];
        /*
@@ -212,16 +203,13 @@
 }
 
 static void
-print_ifarg(arg)
-       char   *arg;
+print_ifarg(const char *arg)
 {
        f_print(fout, ", %s", arg);
 }
 
 static void
-print_ifsizeof(prefix, type)
-       char   *prefix;
-       char   *type;
+print_ifsizeof(const char *prefix, const char *type)
 {
        if (streq(type, "bool")) {
                f_print(fout, ", (u_int)sizeof(bool_t), (xdrproc_t)xdr_bool");
@@ -235,8 +223,7 @@
 }
 
 static void
-print_ifclose(indent)
-       int     indent;
+print_ifclose(int indent)
 {
        f_print(fout, "))\n");
        tabify(fout, indent);
@@ -244,16 +231,10 @@
 }
 
 static void
-print_ifstat(indent, prefix, type, rel, amax, objname, name)
-       int     indent;
-       char   *prefix;
-       char   *type;
-       relation rel;
-       char   *amax;
-       char   *objname;
-       char   *name;
+print_ifstat(int indent, const char *prefix, const char *type, relation rel,
+            const char *amax, const char *objname, const char *name)
 {
-       char   *alt = NULL;
+       const char *alt = NULL;
 
        switch (rel) {
        case REL_POINTER:
@@ -321,8 +302,7 @@
 }
 /* ARGSUSED */
 static void
-emit_enum(def)
-       definition *def;
+emit_enum(definition *def)
 {
        tabify(fout, 1);
        f_print(fout, "{\n");
@@ -338,8 +318,7 @@
 }
 
 static void
-emit_program(def)
-       definition *def;
+emit_program(definition *def)
 {
        decl_list *dl;
        version_list *vlist;
@@ -360,8 +339,7 @@
 



Home | Main Index | Thread Index | Old Index