Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 2002 01:38:06 -0600
From:      "Mike Meyer" <mwm-dated-1015832287.8470f8@mired.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        "Mike Meyer" <mwm-dated-1015831171.a21ab0@mired.org>, obrien@FreeBSD.ORG, Giorgos Keramidas <keramida@FreeBSD.ORG>, hackers@FreeBSD.ORG
Subject:   Re: RFC: style(9) isn't explicit about booleans for testing. 
Message-ID:  <15493.51038.957711.450030@guru.mired.org>
In-Reply-To: <88752.1015400044@critter.freebsd.dk>
References:  <15493.49923.458997.98416@guru.mired.org> <88752.1015400044@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp <phk@critter.freebsd.dk> types:
> In message <15493.49923.458997.98416@guru.mired.org>, "Mike Meyer" writes:
> >David O'Brien <obrien@freebsd.org> types:
> >> On Wed, Mar 06, 2002 at 02:08:07AM +0200, Giorgos Keramidas wrote:
> Now, IFF the C language had a type called "boolean" that would make
> a lot of sense.

So you're advocating that the rule be dropped.

> I belive the overall purpose of style(9) is to make the code readable,
> and I happen to think that
> 
> 	if (somerandomfunction(argthis, functionthat(something), onemore)) {
> 		chugchugchug(argthisa;
> 	}
> 
> is just a tiny bit more readable than
> 
> 	if ((somerandomfunction(argthis, functionthat(something), onemore)
> 	    != 0) {
> 		chugchugchug(argthisa;
> 	}

I agree with you. Under the rules as they exist now, the first form
would only be valid if somerandomfunctoin returned either 0 or <true>.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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