From owner-svn-src-head@freebsd.org Wed Jun 28 19:08:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80CC2DA80B8; Wed, 28 Jun 2017 19:08:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0CE83B3B; Wed, 28 Jun 2017 19:08:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5SJ87wZ062715; Wed, 28 Jun 2017 19:08:07 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5SJ87co062712; Wed, 28 Jun 2017 19:08:07 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201706281908.v5SJ87co062712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 28 Jun 2017 19:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320455 - head/contrib/ipfilter/lib X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/lib X-SVN-Commit-Revision: 320455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 19:08:08 -0000 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); }