From owner-cvs-all Mon Nov 26 8:27:50 2001 Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id BA03137B405; Mon, 26 Nov 2001 08:27:42 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id fAQGRfa99962; Mon, 26 Nov 2001 09:27:41 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id fAQGRfM04124; Mon, 26 Nov 2001 09:27:41 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200111261627.fAQGRfM04124@harmony.village.org> To: "Justin T. Gibbs" Subject: Re: cvs commit: src/sys/dev/pccbb pccbb.c Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-reply-to: Your message of "Mon, 26 Nov 2001 08:51:23 MST." <200111261551.fAQFpNY44638@aslan.scsiguy.com> References: <200111261551.fAQFpNY44638@aslan.scsiguy.com> Date: Mon, 26 Nov 2001 09:27:41 -0700 From: Warner Losh 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 In message <200111261551.fAQFpNY44638@aslan.scsiguy.com> "Justin T. Gibbs" writes: : >imp 2001/11/25 21:42:46 PST : > : > Modified files: : > sys/dev/pccbb pccbb.c : > Log: : > style(9) fixes: : > o declare variables at the start of the function, not the start of : > a block. : : This is not a requirement of style(9) (at least not in -stable). : C allows variables to have block only scope and we should allow : the use of this feature of the language. Yes it is a requirement of style(9), even in -stable: Parts of a for loop may be left empty. Don't put declarations inside blocks unless the routine is unusually complicated. None of the functions were anywhere near complex enough. Also, there were several of the form: foo(); bar(); { char *baz; baz = somefunc(...); otherfunc(baz, ...); } which is just wrong. The "safety" of limiting the scope like this is offset by the pita factor of wrapping the function calls. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message