From owner-p4-projects@FreeBSD.ORG Tue Sep 4 11:24:27 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D43D16A41A; Tue, 4 Sep 2007 11:24:27 +0000 (UTC) Delivered-To: perforce@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 627EE16A418 for ; Tue, 4 Sep 2007 11:24:27 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.freebsd.org (Postfix) with ESMTP id 14A7513C45E for ; Tue, 4 Sep 2007 11:24:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id ABC08EB459A; Tue, 4 Sep 2007 19:05:09 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id HMEdkjfhYz43; Tue, 4 Sep 2007 19:04:39 +0800 (CST) Received: from LI-Xins-MacBook.local (sina152-194.staff.sina.com.cn [61.135.152.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 35621EB4592; Tue, 4 Sep 2007 19:04:07 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=vjc1nOqA9DydQxLmr1MK7Ry0miNwlM9WECRthVqUJcDCFKo7vAZ2/qs5Zm47P6cvI oWzZvjB54En+VqTHcy9Og== Message-ID: <46DD3B97.1020205@delphij.net> Date: Tue, 04 Sep 2007 19:03:51 +0800 From: LI Xin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Hans Petter Selasky References: <200709040755.l847tPbn003371@repoman.freebsd.org> <200709041121.45990.hselasky@c2i.net> In-Reply-To: <200709041121.45990.hselasky@c2i.net> X-Enigmail-Version: 0.95.3 OpenPGP: url=http://www.delphij.net/delphij.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7CBE5F8D6D5880C3862BF559" Cc: freebsd-hackers , Perforce Change Reviews , Xin LI Subject: Re: PERFORCE change 126033 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2007 11:24:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7CBE5F8D6D5880C3862BF559 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Hans, Hans Petter Selasky wrote: > Hi, >=20 > In my opinion you should keep braces around single line if's . >=20 > if (xxx) { > yyy; > } >=20 > This will reduce the chance of error next time you add a statement to a= n if. I think I have some different understanding. My opinion is that with excessive use of these { and }'s the code could be sometimes confusing to human reader, especially if there are a lot of consecutive single line if's that can not be easily converted to case (e.g. in case we wanted to test bit masks, etc). Also to quote style(9): %%%%%%%%%%%%%%%%% No braces (`{' and `}') are used for control statements with zero or only a single statement unless that statement is more than a single line in which case they are permitted. Forever loops are done with for's, not while's. %%%%%%%%%%%%%%%%% Because msdosfs is considered as our own code (e.g. we don't want to sync it with a foreign vendor who has different style guidelines), I think it would be more appropriate to obey style(9)'s rules. Cheers, --=20 Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! --------------enig7CBE5F8D6D5880C3862BF559 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3TuXOfuToMruuMARCvlbAJ9NPZr+Jbq/KoczUPGog+jyTwtlCQCfYD5y TclNtgRdzWFkUwqn0UYpgi8= =9PP6 -----END PGP SIGNATURE----- --------------enig7CBE5F8D6D5880C3862BF559--