From owner-svn-src-head@FreeBSD.ORG Mon Jul 30 10:55:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AD3D106566B; Mon, 30 Jul 2012 10:55:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA398FC0A; Mon, 30 Jul 2012 10:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6UAtO2B078866; Mon, 30 Jul 2012 10:55:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6UAtOda078862; Mon, 30 Jul 2012 10:55:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207301055.q6UAtOda078862@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 30 Jul 2012 10:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238900 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 30 Jul 2012 10:55:24 -0000 Author: luigi Date: Mon Jul 30 10:55:23 2012 New Revision: 238900 URL: http://svn.freebsd.org/changeset/base/238900 Log: Fix some compile errors at high WARNS, including one for an uninitialized variable. unused parameters and variables are annotated with (void)foo; /* UNUSED */ instead of __unused, because this code needs to build also on linux and windows. Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Mon Jul 30 10:14:37 2012 (r238899) +++ head/sbin/ipfw/dummynet.c Mon Jul 30 10:55:23 2012 (r238900) @@ -759,7 +759,8 @@ load_extra_delays(const char *filename, void ipfw_config_pipe(int ac, char **av) { - int i, j; + int i; + u_int j; char *end; struct dn_id *buf, *base; struct dn_sch *sch = NULL; @@ -1282,8 +1283,8 @@ parse_range(int ac, char *av[], uint32_t av--; } if (v[1] < v[0] || - v[1] < 0 || v[1] >= DN_MAX_ID-1 || - v[0] < 0 || v[1] >= DN_MAX_ID-1) { + v[1] >= DN_MAX_ID-1 || + v[1] >= DN_MAX_ID-1) { continue; /* invalid entry */ } n++; @@ -1310,11 +1311,12 @@ void dummynet_list(int ac, char *av[], int show_counters) { struct dn_id *oid, *x = NULL; - int ret, i, l; + int ret, i; int n; /* # of ranges */ - int buflen; - int max_size; /* largest obj passed up */ + u_int buflen, l; + u_int max_size; /* largest obj passed up */ + (void)show_counters; // XXX unused, but we should use it. ac--; av++; /* skip 'list' | 'show' word */ Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Jul 30 10:14:37 2012 (r238899) +++ head/sbin/ipfw/ipfw2.c Mon Jul 30 10:55:23 2012 (r238900) @@ -412,7 +412,7 @@ do_cmd(int optname, void *optval, uintpt * and calls setsockopt(). * Function returns 0 on success or -1 otherwise. */ -int +static int do_setcmd3(int optname, void *optval, socklen_t optlen) { socklen_t len; @@ -3930,6 +3930,7 @@ ipfw_table_handler(int ac, char *av[]) uint32_t a, type, mask, addrlen; uint32_t tables_max; + mask = 0; // XXX uninitialized ? len = sizeof(tables_max); if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, NULL, 0) == -1) @@ -4135,7 +4136,7 @@ table_list(uint16_t num, int need_header if (sz < xent->len) break; sz -= xent->len; - xent = (void *)xent + xent->len; + xent = (ipfw_table_xentry *)((char *)xent + xent->len); } free(tbl); Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Mon Jul 30 10:14:37 2012 (r238899) +++ head/sbin/ipfw/nat.c Mon Jul 30 10:55:23 2012 (r238900) @@ -318,6 +318,7 @@ estimate_redir_addr(int *ac, char ***av) char *sep = **av; u_int c = 0; + (void)ac; /* UNUSED */ while ((sep = strchr(sep, ',')) != NULL) { c++; sep++; @@ -379,6 +380,7 @@ estimate_redir_port(int *ac, char ***av) char *sep = **av; u_int c = 0; + (void)ac; /* UNUSED */ while ((sep = strchr(sep, ',')) != NULL) { c++; sep++;