Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2001 11:08:06 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        Bruce Evans <bde@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/share/man/man9 style.9 
Message-ID:  <200107201008.f6KA86g00843@hak.lan.Awfulhak.org>
In-Reply-To: Message from Ruslan Ermilov <ru@FreeBSD.org>  of "Fri, 20 Jul 2001 11:33:10 %2B0300." <20010720113310.C30828@sunbay.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <brian@freebsd-services.com>                <brian@Awfulhak.org>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>



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?200107201008.f6KA86g00843>