Module Name:    src
Committed By:   sevan
Date:           Sat Sep  3 02:24:04 UTC 2016

Modified Files:
        src/usr.bin/innetgr: innetgr.c
        src/usr.bin/mklocale: lex.l yacc.y
        src/usr.bin/netgroup: netgroup.c
        src/usr.bin/passwd: extern.h passwd.c
        src/usr.bin/tftp: tftp.c
        src/usr.bin/vgrind: extern.h

Log Message:
Remove K&R __P macros.
Remove main() function prototype if present.
Mark usage() as __dead if not already.
Binaries generated with & without these patches were compared with diff -r.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/innetgr/innetgr.c
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/mklocale/lex.l
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/mklocale/yacc.y
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/netgroup/netgroup.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/passwd/extern.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/passwd/passwd.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/tftp/tftp.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/vgrind/extern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/innetgr/innetgr.c
diff -u src/usr.bin/innetgr/innetgr.c:1.8 src/usr.bin/innetgr/innetgr.c:1.9
--- src/usr.bin/innetgr/innetgr.c:1.8	Tue Mar 20 20:34:57 2012
+++ src/usr.bin/innetgr/innetgr.c	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: innetgr.c,v 1.8 2012/03/20 20:34:57 matt Exp $	*/
+/*	$NetBSD: innetgr.c,v 1.9 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,15 +30,14 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: innetgr.c,v 1.8 2012/03/20 20:34:57 matt Exp $");
+__RCSID("$NetBSD: innetgr.c,v 1.9 2016/09/03 02:24:04 sevan Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <netgroup.h>
 
-static void usage __P((void)) __dead;
-int main __P((int, char *[]));
+static void usage(void) __dead;
 
 static void
 usage(void)

Index: src/usr.bin/mklocale/lex.l
diff -u src/usr.bin/mklocale/lex.l:1.18 src/usr.bin/mklocale/lex.l:1.19
--- src/usr.bin/mklocale/lex.l:1.18	Sun Jun 13 04:14:57 2010
+++ src/usr.bin/mklocale/lex.l	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.l,v 1.18 2010/06/13 04:14:57 tnozaki Exp $	*/
+/*	$NetBSD: lex.l,v 1.19 2016/09/03 02:24:04 sevan Exp $	*/
 
 %{
 /*-
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)lex.l	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lex.l,v 1.18 2010/06/13 04:14:57 tnozaki Exp $");
+__RCSID("$NetBSD: lex.l,v 1.19 2016/09/03 02:24:04 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -57,7 +57,7 @@ __RCSID("$NetBSD: lex.l,v 1.18 2010/06/1
 #include "ldef.h"
 #include "yacc.h"
 
-int yylex __P((void));
+int yylex(void);
 %}
 
 ODIGIT	[0-7]

Index: src/usr.bin/mklocale/yacc.y
diff -u src/usr.bin/mklocale/yacc.y:1.31 src/usr.bin/mklocale/yacc.y:1.32
--- src/usr.bin/mklocale/yacc.y:1.31	Sun Jun 13 04:14:57 2010
+++ src/usr.bin/mklocale/yacc.y	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: yacc.y,v 1.31 2010/06/13 04:14:57 tnozaki Exp $	*/
+/*	$NetBSD: yacc.y,v 1.32 2016/09/03 02:24:04 sevan Exp $	*/
 
 %{
 /*-
@@ -43,7 +43,7 @@
 static char sccsid[] = "@(#)yacc.y	8.1 (Berkeley) 6/6/93";
 static char rcsid[] = "$FreeBSD$";
 #else
-__RCSID("$NetBSD: yacc.y,v 1.31 2010/06/13 04:14:57 tnozaki Exp $");
+__RCSID("$NetBSD: yacc.y,v 1.32 2016/09/03 02:24:04 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,22 +81,21 @@ __nbrune_t	charsetmask = (__nbrune_t)0x0
 #endif
 __nbrune_t	charsetmask = (__nbrune_t)0xffffffff;
 
-void set_map __P((rune_map *, rune_list *, u_int32_t));
-void set_digitmap __P((rune_map *, rune_list *));
-void add_map __P((rune_map *, rune_list *, u_int32_t));
-
-int		main __P((int, char *[]));
-void		usage __P((void));
-int		yyerror __P((const char *s));
-void		*xmalloc __P((unsigned int sz));
-u_int32_t	*xlalloc __P((unsigned int sz));
-u_int32_t	*xrelalloc __P((u_int32_t *old, unsigned int sz));
-void		dump_tables __P((void));
-int		yyparse __P((void));
-extern int	yylex __P((void));
+void set_map(rune_map *, rune_list *, u_int32_t);
+void set_digitmap(rune_map *, rune_list *);
+void add_map(rune_map *, rune_list *, u_int32_t);
+
+void		usage(void) __dead;
+int		yyerror(const char *s);
+void		*xmalloc(unsigned int sz);
+u_int32_t	*xlalloc(unsigned int sz);
+u_int32_t	*xrelalloc(u_int32_t *old, unsigned int sz);
+void		dump_tables(void);
+int		yyparse(void);
+extern int	yylex(void);
 
 /* mklocaledb.c */
-extern void mklocaledb __P((const char *, FILE *, FILE *));
+extern void mklocaledb(const char *, FILE *, FILE *);
 
 %}
 
@@ -261,9 +260,7 @@ int debug = 0;
 FILE *ofile;
 
 int
-main(ac, av)
-	int ac;
-	char *av[];
+main(int ac, char *av[])
 {
     int x;
     const char *locale_type;

Index: src/usr.bin/netgroup/netgroup.c
diff -u src/usr.bin/netgroup/netgroup.c:1.7 src/usr.bin/netgroup/netgroup.c:1.8
--- src/usr.bin/netgroup/netgroup.c:1.7	Tue Mar 20 20:34:58 2012
+++ src/usr.bin/netgroup/netgroup.c	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netgroup.c,v 1.7 2012/03/20 20:34:58 matt Exp $	*/
+/*	$NetBSD: netgroup.c,v 1.8 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,15 +30,14 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: netgroup.c,v 1.7 2012/03/20 20:34:58 matt Exp $");
+__RCSID("$NetBSD: netgroup.c,v 1.8 2016/09/03 02:24:04 sevan Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <netgroup.h>
 
-static void usage __P((void)) __dead;
-int main __P((int, char *[]));
+static void usage(void) __dead;
 
 static void
 usage(void)

Index: src/usr.bin/passwd/extern.h
diff -u src/usr.bin/passwd/extern.h:1.14 src/usr.bin/passwd/extern.h:1.15
--- src/usr.bin/passwd/extern.h:1.14	Fri Sep 16 15:39:27 2011
+++ src/usr.bin/passwd/extern.h	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.14 2011/09/16 15:39:27 joerg Exp $	*/
+/*	$NetBSD: extern.h,v 1.15 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -62,24 +62,24 @@ enum {
 };
 
 #ifdef KERBEROS5
-int	krb5_init __P((const char *));
-int	krb5_arg __P((char, const char *));
-int	krb5_arg_end __P((void));
-void	krb5_end __P((void));
-int	krb5_chpw __P((const char *));
+int	krb5_init(const char *);
+int	krb5_arg(char, const char *);
+int	krb5_arg_end(void);
+void	krb5_end(void);
+int	krb5_chpw(const char *);
 #endif
 #ifdef YP
-int	yp_init __P((const char *));
-int	yp_arg __P((char, const char *));
-int	yp_arg_end __P((void));
-void	yp_end __P((void));
-int	yp_chpw __P((const char *));
+int	yp_init(const char *);
+int	yp_arg(char, const char *);
+int	yp_arg_end(void);
+void	yp_end(void);
+int	yp_chpw(const char *);
 #endif
 /* local */
-int	local_init __P((const char *));
-int	local_arg __P((char, const char *));
-int	local_arg_end __P((void));
-void	local_end __P((void));
-int	local_chpw __P((const char *));
+int	local_init(const char *);
+int	local_arg(char, const char *);
+int	local_arg_end(void);
+void	local_end(void);
+int	local_chpw(const char *);
 
 #endif /* USE_PAM */

Index: src/usr.bin/passwd/passwd.c
diff -u src/usr.bin/passwd/passwd.c:1.30 src/usr.bin/passwd/passwd.c:1.31
--- src/usr.bin/passwd/passwd.c:1.30	Fri Apr 17 20:25:08 2009
+++ src/usr.bin/passwd/passwd.c	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: passwd.c,v 1.30 2009/04/17 20:25:08 dyoung Exp $	*/
+/*	$NetBSD: passwd.c,v 1.31 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "from: @(#)passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: passwd.c,v 1.30 2009/04/17 20:25:08 dyoung Exp $");
+__RCSID("$NetBSD: passwd.c,v 1.31 2016/09/03 02:24:04 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -200,12 +200,12 @@ static struct pw_module_s {
 	const char *argv0;
 	const char *args;
 	const char *usage;
-	int (*pw_init) __P((const char *));
-	int (*pw_arg) __P((char, const char *));
-	int (*pw_arg_end) __P((void));
-	void (*pw_end) __P((void));
+	int (*pw_init)(const char *);
+	int (*pw_arg)(char, const char *);
+	int (*pw_arg_end)(void);
+	void (*pw_end)(void);
 
-	int (*pw_chpw) __P((const char*));
+	int (*pw_chpw)(const char*);
 	int invalid;
 #define	INIT_INVALID 1
 #define ARG_INVALID 2

Index: src/usr.bin/tftp/tftp.c
diff -u src/usr.bin/tftp/tftp.c:1.34 src/usr.bin/tftp/tftp.c:1.35
--- src/usr.bin/tftp/tftp.c:1.34	Mon Jul 16 09:20:26 2012
+++ src/usr.bin/tftp/tftp.c	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tftp.c,v 1.34 2012/07/16 09:20:26 he Exp $	*/
+/*	$NetBSD: tftp.c,v 1.35 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tftp.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: tftp.c,v 1.34 2012/07/16 09:20:26 he Exp $");
+__RCSID("$NetBSD: tftp.c,v 1.35 2016/09/03 02:24:04 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,14 +73,14 @@ char    ackbuf[PKTSIZE];
 int	timeout;
 jmp_buf	timeoutbuf;
 
-static void nak __P((int, struct sockaddr *));
-static int makerequest __P((int, const char *, struct tftphdr *, const char *, off_t));
-static void printstats __P((const char *, unsigned long));
-static void startclock __P((void));
-static void stopclock __P((void));
-__dead static void timer __P((int));
-static void tpacket __P((const char *, struct tftphdr *, int));
-static int cmpport __P((struct sockaddr *, struct sockaddr *));
+static void nak(int, struct sockaddr *);
+static int makerequest(int, const char *, struct tftphdr *, const char *, off_t);
+static void printstats(const char *, unsigned long);
+static void startclock(void);
+static void stopclock(void);
+__dead static void timer(int);
+static void tpacket(const char *, struct tftphdr *, int);
+static int cmpport(struct sockaddr *, struct sockaddr *);
 
 static void get_options(struct tftphdr *, int);
 static int tftp_igmp_join(void);

Index: src/usr.bin/vgrind/extern.h
diff -u src/usr.bin/vgrind/extern.h:1.6 src/usr.bin/vgrind/extern.h:1.7
--- src/usr.bin/vgrind/extern.h:1.6	Tue Jul 15 13:17:15 2014
+++ src/usr.bin/vgrind/extern.h	Sat Sep  3 02:24:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.6 2014/07/15 13:17:15 christos Exp $	*/
+/*	$NetBSD: extern.h,v 1.7 2016/09/03 02:24:04 sevan Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -55,8 +55,8 @@ extern const char *language;           /
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-extern int      STRNCMP __P((char *, char *, int));
-extern char    *convexp __P((char *));
-extern char    *expmatch __P((char *, char *, char *));
+extern int      STRNCMP(char *, char *, int);
+extern char    *convexp(char *);
+extern char    *expmatch(char *, char *, char *);
 __END_DECLS
 

Reply via email to