From owner-cvs-all Mon Nov 26 10: 8:10 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 A482D37B405; Mon, 26 Nov 2001 10:08:01 -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 fAQI80a00491; Mon, 26 Nov 2001 11:08:00 -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 fAQI7xM04832; Mon, 26 Nov 2001 11:07:59 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200111261807.fAQI7xM04832@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 09:39:43 MST." <200111261639.fAQGdhY45463@aslan.scsiguy.com> References: <200111261639.fAQGdhY45463@aslan.scsiguy.com> Date: Mon, 26 Nov 2001 11:07:59 -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 <200111261639.fAQGdhY45463@aslan.scsiguy.com> "Justin T. Gibbs" writes: : >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. : : Complex is in the eyes of the programmer. In this case, I might agree : with the removal of the local variable, but not for reasons specified : in style(9). If your example is accurate, the block in question was : not a "natureal block" (the body of a conditional statement), and is : rarely appropriate. In most cases it indicates that a subsection of : the fuction should be broken out into an separate function (perhaps : inline). Anyway, style(9) cannot handle all situations. Style(9) : has to allow the programmer to use their brain. That is why the above : is not a hard and fast rule. Right. There's a lot of cut-n-paste going on in pccbb right now, and this is one result. I think the functions in question were clearer after than before. There are a few I left that looked like #ifdef DO_DEBUG if (am_whining) { uint8_t r1, r2, r3, r4; ... } #endif /* DO_DEBUG */ which were clearer where they were rather than moving. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message