From owner-svn-src-user@FreeBSD.ORG Mon Dec 28 23:33:08 2009 Return-Path: <owner-svn-src-user@FreeBSD.ORG> Delivered-To: svn-src-user@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74CB61065693 for <svn-src-user@FreeBSD.org>; Mon, 28 Dec 2009 23:33:08 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7458FC19 for <svn-src-user@FreeBSD.org>; Mon, 28 Dec 2009 23:33:08 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C497C73098; Tue, 29 Dec 2009 00:21:51 +0100 (CET) Date: Tue, 29 Dec 2009 00:21:51 +0100 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Bruce Evans <brde@optusnet.com.au> Message-ID: <20091228232151.GA39294@onelab2.iet.unipi.it> References: <200912272213.nBRMDJAC069043@svn.freebsd.org> <20091229021846.U46429@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091229021846.U46429@delplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: Luigi Rizzo <luigi@FreeBSD.org>, src-committers@FreeBSD.org, svn-src-user@FreeBSD.org Subject: Re: svn commit: r201063 - user/luigi/ipfw3-head/sys/netinet/ipfw X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" <svn-src-user.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>, <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user> List-Post: <mailto:svn-src-user@freebsd.org> List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>, <mailto:svn-src-user-request@freebsd.org?subject=subscribe> X-List-Received-Date: Mon, 28 Dec 2009 23:33:08 -0000 On Tue, Dec 29, 2009 at 02:38:15AM +1100, Bruce Evans wrote: > On Sun, 27 Dec 2009, Luigi Rizzo wrote: > > >Log: > > use a less obfuscated construct to call the hook/unhook functions > > > >Modified: > > user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c > > Better unobfuscation: > > >Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c > >============================================================================== > >--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c Sun Dec 27 > >21:58:48 2009 (r201062) > >+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c Sun Dec 27 > >22:13:19 2009 (r201063) > >@@ -329,18 +329,17 @@ ipfw_divert(struct mbuf **m0, int incomi > >static int > >ipfw_hook(int onoff, int pf) > >{ > >+ const int arg = PFIL_IN | PFIL_OUT | PFIL_WAITOK; > > Don't add this obfuscation (a constant used only once stored in a variable > used only once, just to avoid 2 long lines (1 after my change). It is not just that. I want to tell humans reading the code that the value used in the two calls is exactly the same, beyond any chance of misspelling or misreading the two long lines. Then whether or not to store it in a variable is compiler's business, same as if i use the constant FOO ( #define FOO 0x11122334455667788LL ) 20 times in a piece of code. cheers luigi