Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2001 11:07:59 -0700
From:      Warner Losh <imp@harmony.village.org>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/pccbb pccbb.c 
Message-ID:  <200111261807.fAQI7xM04832@harmony.village.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>  

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111261807.fAQI7xM04832>