From owner-cvs-all Fri Jul 20 3: 8:20 2001 Delivered-To: cvs-all@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id C154C37B401; Fri, 20 Jul 2001 03:08:09 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.4/8.11.4) with ESMTP id f6KA87l23790; Fri, 20 Jul 2001 11:08:07 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.4/8.11.4) with ESMTP id f6KA86g00843; Fri, 20 Jul 2001 11:08:06 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200107201008.f6KA86g00843@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Bruce Evans , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 style.9 In-Reply-To: Message from Ruslan Ermilov of "Fri, 20 Jul 2001 11:33:10 +0300." <20010720113310.C30828@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Jul 2001 11:08:06 +0100 From: Brian Somers 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 > What about this block? > > if (mylevel == SLC_DEFAULT) { > slctab[(int)func].current.flag = flag; > slctab[(int)func].current.val = val; > flag |= SLC_ACK; > } else if (hislevel == SLC_CANTCHANGE && > mylevel == SLC_CANTCHANGE) { > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > flag &= ~SLC_LEVELBITS; > flag |= SLC_NOSUPPORT; > slctab[(int)func].current.flag = flag; > } > > This is using style(9)'s second-level of four indents rule. > But, strictly speaking, `else if' is not an operator, this > is `else' operator followed by the `if' operator. So if we > would use the second-level indent of four spaces relatively > to the `if' operator, we would get: > > if (mylevel == SLC_DEFAULT) { > slctab[(int)func].current.flag = flag; > slctab[(int)func].current.val = val; > flag |= SLC_ACK; > } else if (hislevel == SLC_CANTCHANGE && > mylevel == SLC_CANTCHANGE) { > flag &= ~SLC_LEVELBITS; > flag |= SLC_NOSUPPORT; > slctab[(int)func].current.flag = flag; > } > > Which is much better, no? Hell, but then, I guess, we would need > to indent lines within `else if' block relative to `if' as well. > > Just wanted to clear this point out, preferably with an example > in style(9). This should be } else if (hislevel == SLC_CANTCHANGE && mylevel == SLC_CANTCHANGE) { flag &= ~SLC_LEVELBITS; flag |= SLC_NOSUPPORT; slctab[(int)func].current.flag = flag; } > Cheers, > -- > Ruslan Ermilov Oracle Developer/DBA, > ru@sunbay.com Sunbay Software AG, > ru@FreeBSD.org FreeBSD committer, > +380.652.512.251 Simferopol, Ukraine > > http://www.FreeBSD.org The Power To Serve > http://www.oracle.com Enabling The Information Age -- Brian http://www.freebsd-services.com/ Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message