svn commit: r246988 - head/usr.bin/netstat

Philippe Charnier charnier at FreeBSD.org
Tue Feb 19 13:17:17 UTC 2013


Author: charnier
Date: Tue Feb 19 13:17:16 2013
New Revision: 246988
URL: http://svnweb.freebsd.org/changeset/base/246988

Log:
  WARNS=6 compliance

Modified:
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/inet6.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netisr.c
  head/usr.bin/netstat/sctp.c
  head/usr.bin/netstat/unix.c

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/inet.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -89,7 +89,7 @@ static int udp_done, tcp_done, sdp_done;
 #endif /* INET6 */
 
 static int
-pcblist_sysctl(int proto, const char *name, char **bufp, int istcp)
+pcblist_sysctl(int proto, const char *name, char **bufp, int istcp __unused)
 {
 	const char *mibvar;
 	char *buf;

Modified: head/usr.bin/netstat/inet6.c
==============================================================================
--- head/usr.bin/netstat/inet6.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/inet6.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -335,7 +335,7 @@ static	const char *ip6nh[] = {
 	"#255",
 };
 
-static char *srcrule_str[] = {
+static const char *srcrule_str[] = {
 	"first candidate",
 	"same address",
 	"appropriate scope",

Modified: head/usr.bin/netstat/main.c
==============================================================================
--- head/usr.bin/netstat/main.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/main.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -640,9 +640,7 @@ main(int argc, char *argv[])
  * is not in the namelist, ignore this one.
  */
 static void
-printproto(tp, name)
-	struct protox *tp;
-	const char *name;
+printproto(struct protox *tp, const char *name)
 {
 	void (*pr)(u_long, const char *, int, int);
 	u_long off;

Modified: head/usr.bin/netstat/netisr.c
==============================================================================
--- head/usr.bin/netstat/netisr.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/netisr.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -76,12 +76,12 @@ static u_int				*nws_array;
 static u_int				 maxprot;
 
 static void
-netisr_dispatch_policy_to_string(u_int dispatch_policy, char *buf,
+netisr_dispatch_policy_to_string(u_int policy, char *buf,
     size_t buflen)
 {
 	const char *str;
 
-	switch (dispatch_policy) {
+	switch (policy) {
 	case NETISR_DISPATCH_DEFAULT:
 		str = "default";
 		break;
@@ -102,7 +102,7 @@ netisr_dispatch_policy_to_string(u_int d
 }
 
 static void
-netisr_load_kvm_uint(kvm_t *kd, char *name, u_int *p)
+netisr_load_kvm_uint(kvm_t *kd, const char *name, u_int *p)
 {
 	struct nlist nl[] = {
 		{ .n_name = name },

Modified: head/usr.bin/netstat/sctp.c
==============================================================================
--- head/usr.bin/netstat/sctp.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/sctp.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -77,7 +77,7 @@ static void sctp_statesprint(uint32_t st
 #define	NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT	0x8
 #define	NETSTAT_SCTP_STATES_SHUTDOWN_PENDING	0x9
 
-char *sctpstates[] = {
+const char *sctpstates[] = {
 	"CLOSED",
 	"BOUND",
 	"LISTEN",
@@ -393,7 +393,7 @@ sctp_process_inpcb(struct xsctp_inpcb *x
 {
 	int indent = 0, xladdr_total = 0, is_listening = 0;
 	static int first = 1;
-	char *tname, *pname;
+	const char *tname, *pname;
 	struct xsctp_tcb *xstcb;
 	struct xsctp_laddr *xladdr;
 	size_t offset_laddr;
@@ -527,7 +527,7 @@ retry:
  */
 void
 sctp_protopr(u_long off __unused,
-    const char *name, int af1, int proto)
+    const char *name __unused, int af1 __unused, int proto)
 {
 	char *buf;
 	const char *mibvar = "net.inet.sctp.assoclist";

Modified: head/usr.bin/netstat/unix.c
==============================================================================
--- head/usr.bin/netstat/unix.c	Tue Feb 19 12:57:07 2013	(r246987)
+++ head/usr.bin/netstat/unix.c	Tue Feb 19 13:17:16 2013	(r246988)
@@ -199,6 +199,7 @@ unixpr(u_long count_off, u_long gencnt_o
 	struct	xunpcb *xunp;
 	u_long	head_off;
 
+	buf = NULL;
 	for (type = SOCK_STREAM; type <= SOCK_SEQPACKET; type++) {
 		if (live)
 			ret = pcblist_sysctl(type, &buf);


More information about the svn-src-head mailing list