Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ipsec-tools/src/setkey fix -Wold-style-definition



details:   https://anonhg.NetBSD.org/src/rev/ad9299ce7323
branches:  trunk
changeset: 319377:ad9299ce7323
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon May 28 19:52:18 2018 +0000

description:
fix -Wold-style-definition

diffstat:

 crypto/dist/ipsec-tools/src/setkey/parse.y  |  60 +++++++---------------------
 crypto/dist/ipsec-tools/src/setkey/setkey.c |  46 +++++++--------------
 crypto/dist/ipsec-tools/src/setkey/token.l  |  11 +---
 3 files changed, 36 insertions(+), 81 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r 1b30ab42351f -r ad9299ce7323 crypto/dist/ipsec-tools/src/setkey/parse.y
--- a/crypto/dist/ipsec-tools/src/setkey/parse.y        Mon May 28 19:39:21 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/setkey/parse.y        Mon May 28 19:52:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.y,v 1.19 2017/07/05 01:22:40 ozaki-r Exp $       */
+/*     $NetBSD: parse.y,v 1.20 2018/05/28 19:52:18 maxv Exp $  */
 
 /*     $KAME: parse.y,v 1.81 2003/07/01 04:01:48 itojun Exp $  */
 
@@ -939,11 +939,8 @@
 %%
 
 int
-setkeymsg0(msg, type, satype, l)
-       struct sadb_msg *msg;
-       unsigned int type;
-       unsigned int satype;
-       size_t l;
+setkeymsg0(struct sadb_msg *msg, unsigned int type, unsigned int satype,
+    size_t l)
 {
 
        msg->sadb_msg_version = PF_KEY_V2;
@@ -959,14 +956,8 @@
 
 /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */
 static int
-setkeymsg_spdaddr(type, upper, policy, srcs, splen, dsts, dplen)
-       unsigned int type;
-       unsigned int upper;
-       vchar_t *policy;
-       struct addrinfo *srcs;
-       int splen;
-       struct addrinfo *dsts;
-       int dplen;
+setkeymsg_spdaddr(unsigned int type, unsigned int upper, vchar_t *policy,
+    struct addrinfo *srcs, int splen, struct addrinfo *dsts, int dplen)
 {
        struct sadb_msg *msg;
        char buf[BUFSIZ];
@@ -1108,10 +1099,7 @@
 }
 
 static int
-setkeymsg_spdaddr_tag(type, tag, policy)
-       unsigned int type;
-       char *tag;
-       vchar_t *policy;
+setkeymsg_spdaddr_tag(unsigned int type, char *tag, vchar_t *policy)
 {
        struct sadb_msg *msg;
        char buf[BUFSIZ];
@@ -1149,12 +1137,8 @@
 
 /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */
 static int
-setkeymsg_addr(type, satype, srcs, dsts, no_spi)
-       unsigned int type;
-       unsigned int satype;
-       struct addrinfo *srcs;
-       struct addrinfo *dsts;
-       int no_spi;
+setkeymsg_addr(unsigned int type, unsigned int satype, struct addrinfo *srcs,
+    struct addrinfo *dsts, int no_spi)
 {
        struct sadb_msg *msg;
        char buf[BUFSIZ];
@@ -1295,11 +1279,8 @@
 
 /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */
 static int
-setkeymsg_add(type, satype, srcs, dsts)
-       unsigned int type;
-       unsigned int satype;
-       struct addrinfo *srcs;
-       struct addrinfo *dsts;
+setkeymsg_add(unsigned int type, unsigned int satype, struct addrinfo *srcs,
+    struct addrinfo *dsts)
 {
        struct sadb_msg *msg;
        char buf[BUFSIZ];
@@ -1577,9 +1558,7 @@
 }
 
 static struct addrinfo *
-parse_addr(host, port)
-       char *host;
-       char *port;
+parse_addr(char *host, char *port)
 {
        struct addrinfo hints, *res = NULL;
        int error;
@@ -1598,9 +1577,7 @@
 }
 
 static int
-fix_portstr(ulproto, spec, sport, dport)
-       int ulproto;
-       vchar_t *spec, *sport, *dport;
+fix_portstr(int ulproto, vchar_t *spec, vchar_t *sport, vchar_t *dport)
 {
        char sp[16], dp[16];
        int a, b, c, d;
@@ -1657,13 +1634,8 @@
 }
 
 static int
-setvarbuf(buf, off, ebuf, elen, vbuf, vlen)
-       char *buf;
-       int *off;
-       struct sadb_ext *ebuf;
-       int elen;
-       const void *vbuf;
-       int vlen;
+setvarbuf(char *buf, int *off, struct sadb_ext *ebuf, int elen,
+    const void *vbuf, int vlen)
 {
        memset(buf + *off, 0, PFKEY_UNUNIT64(ebuf->sadb_ext_len));
        memcpy(buf + *off, (caddr_t)ebuf, elen);
@@ -1674,7 +1646,7 @@
 }
 
 void
-parse_init()
+parse_init(void)
 {
        p_spi = 0;
 
@@ -1705,7 +1677,7 @@
 }
 
 void
-free_buffer()
+free_buffer(void)
 {
        /* we got tons of memory leaks in the parser anyways, leave them */
 
diff -r 1b30ab42351f -r ad9299ce7323 crypto/dist/ipsec-tools/src/setkey/setkey.c
--- a/crypto/dist/ipsec-tools/src/setkey/setkey.c       Mon May 28 19:39:21 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/setkey/setkey.c       Mon May 28 19:52:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setkey.c,v 1.16 2013/06/14 16:29:14 christos Exp $     */
+/*     $NetBSD: setkey.c,v 1.17 2018/05/28 19:52:18 maxv Exp $ */
 
 /*     $KAME: setkey.c,v 1.36 2003/09/24 23:52:51 itojun Exp $ */
 
@@ -140,9 +140,7 @@
 }
 
 int
-main(argc, argv)
-       int argc;
-       char **argv;
+main(int argc, char **argv)
 {
        FILE *fp = stdin;
        int c;
@@ -286,7 +284,7 @@
 }
 
 int
-get_supported()
+get_supported(void)
 {
 
        if (pfkey_send_register(so, SADB_SATYPE_UNSPEC) < 0)
@@ -299,7 +297,7 @@
 }
 
 void
-stdin_loop()
+stdin_loop(void)
 {
        char line[1024], *semicolon, *comment;
        size_t linelen = 0;
@@ -361,8 +359,7 @@
 }
 
 void
-sendkeyshort(type)
-        u_int type;
+sendkeyshort(u_int type)
 {
        struct sadb_msg msg;
 
@@ -381,7 +378,7 @@
 }
 
 void
-promisc()
+promisc(void)
 {
        struct sadb_msg msg;
        u_char rbuf[1024 * 32]; /* XXX: Enough ? Should I do MSG_PEEK ? */
@@ -452,11 +449,8 @@
  * On any error, set *num_spi to 0 and return NULL.
  */
 u_int32_t *
-sendkeymsg_spigrep(satype, srcs, dsts, num_spi)
-       unsigned int satype;
-       struct addrinfo *srcs;
-       struct addrinfo *dsts;
-       int *num_spi;
+sendkeymsg_spigrep(unsigned int satype, struct addrinfo *srcs,
+    struct addrinfo *dsts, int *num_spi)
 {
        struct sadb_msg msg, *m;
        char *buf;
@@ -608,9 +602,7 @@
 }
 
 int
-sendkeymsg(buf, len)
-       char *buf;
-       size_t len;
+sendkeymsg(char *buf, size_t len)
 {
        u_char rbuf[1024 * 32]; /* XXX: Enough ? Should I do MSG_PEEK ? */
        ssize_t l;
@@ -686,9 +678,7 @@
 }
 
 int
-postproc(msg, len)
-       struct sadb_msg *msg;
-       int len;
+postproc(struct sadb_msg *msg, int len)
 {
 #ifdef HAVE_PFKEY_POLICY_PRIORITY
        static int priority_support_check = 0;
@@ -787,8 +777,7 @@
 
 #ifdef HAVE_PFKEY_POLICY_PRIORITY
 int
-verifypriority(m)
-       struct sadb_msg *m;
+verifypriority(struct sadb_msg *m)
 {
        caddr_t mhp[SADB_EXT_MAX + 1];
        struct sadb_x_policy *xpl;
@@ -819,8 +808,7 @@
 #endif
 
 int
-fileproc(filename)
-       const char *filename;
+fileproc(const char *filename)
 {
        int fd;
        ssize_t len, l;
@@ -895,8 +883,7 @@
        (((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x))
 
 const char *
-numstr(x)
-       int x;
+numstr(int x)
 {
        static char buf[20];
        snprintf(buf, sizeof(buf), "#%d", x);
@@ -904,15 +891,14 @@
 }
 
 void
-shortdump_hdr()
+shortdump_hdr(void)
 {
        printf("%-4s %-3s %-1s %-8s %-7s %s -> %s\n",
                "time", "p", "s", "spi", "ltime", "src", "dst");
 }
 
 void
-shortdump(msg)
-       struct sadb_msg *msg;
+shortdump(struct sadb_msg *msg)
 {
        caddr_t mhp[SADB_EXT_MAX + 1];
        char buf[NI_MAXHOST], pbuf[NI_MAXSERV];
@@ -998,7 +984,7 @@
  * Print the timestamp
  */
 static void
-printdate()
+printdate(void)
 {
        struct timeval tp;
        int s;
diff -r 1b30ab42351f -r ad9299ce7323 crypto/dist/ipsec-tools/src/setkey/token.l
--- a/crypto/dist/ipsec-tools/src/setkey/token.l        Mon May 28 19:39:21 2018 +0000
+++ b/crypto/dist/ipsec-tools/src/setkey/token.l        Mon May 28 19:52:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: token.l,v 1.20 2017/07/05 01:22:40 ozaki-r Exp $       */
+/*     $NetBSD: token.l,v 1.21 2018/05/28 19:52:18 maxv Exp $  */
 
 /*     $KAME: token.l,v 1.44 2003/10/21 07:20:58 itojun Exp $  */
 
@@ -326,23 +326,20 @@
 %%
 
 void



Home | Main Index | Thread Index | Old Index