Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2017 19:08:07 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320455 - head/contrib/ipfilter/lib
Message-ID:  <201706281908.v5SJ87co062712@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Wed Jun 28 19:08:07 2017
New Revision: 320455
URL: https://svnweb.freebsd.org/changeset/base/320455

Log:
  Ansify entry and exit points.
  
  MFC after:	1 month

Modified:
  head/contrib/ipfilter/lib/hostname.c
  head/contrib/ipfilter/lib/portname.c
  head/contrib/ipfilter/lib/printstate.c

Modified: head/contrib/ipfilter/lib/hostname.c
==============================================================================
--- head/contrib/ipfilter/lib/hostname.c	Wed Jun 28 19:05:04 2017	(r320454)
+++ head/contrib/ipfilter/lib/hostname.c	Wed Jun 28 19:08:07 2017	(r320455)
@@ -10,9 +10,8 @@
 
 #include "ipf.h"
 
-char *hostname(family, ip)
-	int family;
-	void *ip;
+char *
+hostname(int family, void *ip)
 {
 	static char hostbuf[MAXHOSTNAMELEN+1];
 	struct hostent *hp;
@@ -24,7 +23,7 @@ char *hostname(family, ip)
 	if (family == AF_INET) {
 		ipa.s_addr = *(u_32_t *)ip;
 		if (ipa.s_addr == htonl(0xfedcba98))
-			return "test.host.dots";
+			return ("test.host.dots");
 	}
 
 	if ((opts & OPT_NORESOLVE) == 0) {
@@ -34,7 +33,7 @@ char *hostname(family, ip)
 			    *hp->h_name != '\0') {
 				strncpy(hostbuf, hp->h_name, sizeof(hostbuf));
 				hostbuf[sizeof(hostbuf) - 1] = '\0';
-				return hostbuf;
+				return (hostbuf);
 			}
 
 			np = getnetbyaddr(ipa.s_addr, AF_INET);
@@ -42,19 +41,19 @@ char *hostname(family, ip)
 			    *np->n_name != '\0') {
 				strncpy(hostbuf, np->n_name, sizeof(hostbuf));
 				hostbuf[sizeof(hostbuf) - 1] = '\0';
-				return hostbuf;
+				return (hostbuf);
 			}
 		}
 	}
 
 	if (family == AF_INET) {
-		return inet_ntoa(ipa);
+		return (inet_ntoa(ipa));
 	}
 #ifdef  USE_INET6
 	(void) inet_ntop(AF_INET6, ip, hostbuf, sizeof(hostbuf) - 1);
 	hostbuf[MAXHOSTNAMELEN] = '\0';
-	return hostbuf;
+	return (hostbuf);
 #else
-	return "IPv6";
+	return ("IPv6");
 #endif
 }

Modified: head/contrib/ipfilter/lib/portname.c
==============================================================================
--- head/contrib/ipfilter/lib/portname.c	Wed Jun 28 19:05:04 2017	(r320454)
+++ head/contrib/ipfilter/lib/portname.c	Wed Jun 28 19:08:07 2017	(r320455)
@@ -10,8 +10,8 @@
 #include "ipf.h"
 
 
-char *portname(pr, port)
-	int pr, port;
+char *
+portname(int pr, int port)
 {
 	static char buf[32];
 	struct protoent *p = NULL;
@@ -28,16 +28,16 @@ char *portname(pr, port)
 				     NULL : sv1;
 			}
 			if (sv)
-				return buf;
+				return (buf);
 		} else if ((pr != -2) && (p = getprotobynumber(pr))) {
 			if ((sv = getservbyport(htons(port), p->p_name))) {
 				strncpy(buf, sv->s_name, sizeof(buf)-1);
 				buf[sizeof(buf)-1] = '\0';
-				return buf;
+				return (buf);
 			}
 		}
 	}
 
 	(void) sprintf(buf, "%d", port);
-	return buf;
+	return (buf);
 }

Modified: head/contrib/ipfilter/lib/printstate.c
==============================================================================
--- head/contrib/ipfilter/lib/printstate.c	Wed Jun 28 19:05:04 2017	(r320454)
+++ head/contrib/ipfilter/lib/printstate.c	Wed Jun 28 19:08:07 2017	(r320455)
@@ -11,10 +11,7 @@
 
 
 ipstate_t *
-printstate(sp, opts, now)
-	ipstate_t *sp;
-	int opts;
-	u_long now;
+printstate(ipstate_t *sp, int opts, u_long now)
 {
 	struct protoent *pr;
 	synclist_t ipsync;
@@ -210,7 +207,7 @@ printstate(sp, opts, now)
 		if (kmemcpy((char *)&ipsync, (u_long)sp->is_sync,
 			    sizeof(ipsync))) {
 			PRINTF("status could not be retrieved\n");
-			return NULL;
+			return (NULL);
 		}
 
 		PRINTF("idx %d num %d v %d pr %d rev %d\n",
@@ -220,5 +217,5 @@ printstate(sp, opts, now)
 		PRINTF("not synchronized\n");
 	}
 
-	return sp->is_next;
+	return (sp->is_next);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706281908.v5SJ87co062712>