From owner-cvs-all Sun Oct 28 21:23:59 2001 Delivered-To: cvs-all@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id AB87F37B401; Sun, 28 Oct 2001 21:23:55 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9T5KQO94942; Sun, 28 Oct 2001 21:20:26 -0800 (PST) (envelope-from rizzo) Date: Sun, 28 Oct 2001 21:20:26 -0800 From: Luigi Rizzo To: "Andrew R. Reiter" Cc: Josef Karthauser , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: ipfw.c -- (was: cvs commit: src/sys/netinet ip_fw.h) Message-ID: <20011028212026.A94510@iguana.aciri.org> References: <200110290441.f9T4fSY68423@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Oct 29, 2001 at 12:11:24AM -0500, Andrew R. Reiter wrote: > > Sorry to reply to ipfw.c commits this way, but while there have been style > fixes, I don't think all have been fixed. For example, in show_ipfw(), > there is char timestr[30]; which is found in the middle of an if block. > IIRC, isn't this a style problem as well? Also, I would imagine that it's > just poor design to have to declare variables in the middle of a block, > whether it be an if-block, for-block, etc.. actually it is _good_ design to declare variables as local as possible, because it enables the compiler to detect more erroneous use of the same. I also fail to understand why style says Be careful to not obfuscate the code by initializing variables in the declarations. Use this feature only thoughtfully. DO NOT use function calls in initializers! as the above seems one of the safest way to make sure that variables are properly initialized. cheers luigi ----------------------------------+----------------------------------------- Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 Phone: (510) 666 2927 ----------------------------------+----------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message