style patch to rtadvd(8)

Chris Pressey cpressey at catseye.mine.nu
Tue Mar 16 13:28:09 PST 2004


Probably should've rolled these up, sorry.

Patch:		advcap.c.diff
Type:		style(9)
Description:	1. Remove ``register'' keywords.
		2. Convert K&R decls to ANSI style.
		3. Fix typo in comment.
Testing:	no functional changes; compiles, runs.

-Chris

Index: usr.sbin/rtadvd/advcap.c
===================================================================
RCS file: /home/dcvs/src/usr.sbin/rtadvd/advcap.c,v
retrieving revision 1.3
diff -u -r1.3 advcap.c
--- usr.sbin/rtadvd/advcap.c	3 Nov 2003 19:31:42 -0000	1.3
+++ usr.sbin/rtadvd/advcap.c	16 Mar 2004 13:22:27 -0000
@@ -109,8 +109,7 @@
  * we just notice escaped newlines.
  */
 int
-tgetent(bp, name)
-	char *bp, *name;
+tgetent(char *bp, char *name)
 {
 	char *cp;
 
@@ -119,11 +118,10 @@
 }
 
 int
-getent(bp, name, cp)
-	char *bp, *name, *cp;
+getent(char *bp, char *name, char *cp)
 {
-	register int c;
-	register int i = 0, cnt = 0;
+	int c;
+	int i = 0, cnt = 0;
 	char ibuf[BUFSIZ];
 	int tf;
 
@@ -189,9 +187,9 @@
  * Note that this works because of the left to right scan.
  */
 int
-tnchktc()
+tnchktc(void)
 {
-	register char *p, *q;
+	char *p, *q;
 	char tcname[16];	/* name of similar terminal */
 	char tcbuf[BUFSIZ];
 	char *holdtbuf = tbuf;
@@ -238,10 +236,9 @@
  * name (before the first field) stops us.
  */
 int
-tnamatch(np)
-	char *np;
+tnamatch(char *np)
 {
-	register char *Np, *Bp;
+	char *Np, *Bp;
 
 	Bp = tbuf;
 	if (*Bp == '#')
@@ -265,8 +262,7 @@
  * into the termcap file in octal.
  */
 static char *
-tskip(bp)
-	register char *bp;
+tskip(char *bp)
 {
 	int dquote;
 
@@ -310,12 +306,11 @@
  * Note that we handle octal numbers beginning with 0.
  */
 long long
-tgetnum(id)
-	char *id;
+tgetnum(char *id)
 {
-	register long long i;
-	register int base;
-	register char *bp = tbuf;
+	long long i;
+	int base;
+	char *bp = tbuf;
 
 	for (;;) {
 		bp = tskip(bp);
@@ -346,10 +341,9 @@
  * not given.
  */
 int
-tgetflag(id)
-	char *id;
+tgetflag(char *id)
 {
-	register char *bp = tbuf;
+	char *bp = tbuf;
 
 	for (;;) {
 		bp = tskip(bp);
@@ -374,10 +368,9 @@
  * No checking on area overflow.
  */
 char *
-tgetstr(id, area)
-	char *id, **area;
+tgetstr(char *id, char **area)
 {
-	register char *bp = tbuf;
+	char *bp = tbuf;
 
 	for (;;) {
 		bp = tskip(bp);
@@ -396,17 +389,15 @@
 }
 
 /*
- * Tdecode does the grung work to decode the
+ * Tdecode does the grunt work to decode the
  * string capability escapes.
  */
 static char *
-tdecode(str, area)
-	register char *str;
-	char **area;
+tdecode(char *str, char **area)
 {
-	register char *cp;
-	register int c;
-	register char *dp;
+	char *cp;
+	int c;
+	char *dp;
 	int i;
 	char term;
 




More information about the Submit mailing list