From owner-freebsd-chat Thu Jan 25 14: 5: 8 2001 Delivered-To: freebsd-chat@freebsd.org Received: from mooseriver.com (erie.mooseriver.com [205.166.121.26]) by hub.freebsd.org (Postfix) with ESMTP id 8518137B400 for ; Thu, 25 Jan 2001 14:04:48 -0800 (PST) Received: (from jgrosch@localhost) by mooseriver.com (8.11.1/8.9.3) id f0PM4GM12641; Thu, 25 Jan 2001 14:04:16 -0800 (PST) (envelope-from jgrosch) Date: Thu, 25 Jan 2001 14:04:16 -0800 From: Josef Grosch To: Terry Lambert Cc: Stephen McKay , Iain Templeton , chat@FreeBSD.ORG Subject: Re: silly C style question Message-ID: <20010125140416.A12493@mooseriver.com> Reply-To: jgrosch@mooseriver.com References: <200101241124.f0OBOgm22341@dungeon.home> <200101252134.OAA28804@usr08.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200101252134.OAA28804@usr08.primenet.com>; from tlambert@primenet.com on Thu, Jan 25, 2001 at 09:32:57PM +0000 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Jan 25, 2001 at 09:32:57PM +0000, Terry Lambert wrote: > > if > > ( > > (id->id_type == NULL) > > || > > ( > > (id->id_type->x_what == xt_arrayof) > > && > > (item->x_left->x_what == xt_arrayof) > > && > > (id->id_type->x_subtype == item->x_left->x_subtype) > > && > > (id->id_type->x_flags & XIS_DIMLESS) > > ) > > ) > > ... > > > > Try that one any other way. :-) > > if( ( id->id_type == NULL) || > ( ( id->id_type->x_what == xt_arrayof) && > ( item->x_left->x_what == xt_arrayof) && > ( id->id_type->x_subtype == item->x_left->x_subtype) && > ( id->id_type->x_flags & XIS_DIMLESS))) > hmmm, I would have done the following: if ((id->id_type == NULL) || ((id->id_type->x_what == xt_arrayof) && (item->x_left->x_what == xt_arrayof) && (id->id_type->x_subtype == item->x_left->x_subtype) && (id->id_type->x_flags & XIS_DIMLESS))) The lack of a space between the if and the first parenthesis is unclean and violates style(9) and the space after each opening parenthesis and the lack of space before each closing parenthesis is also unclean and inconsistent. If one were being consistent it should be done like this : if ( ( id->id_type == NULL ) || ( ( id->id_type->x_what == xt_arrayof ) && ( item->x_left->x_what == xt_arrayof ) && ( id->id_type->x_subtype == item->x_left->x_subtype ) && ( id->id_type->x_flags & XIS_DIMLESS ) ) ) my $0.02 Josef -- Josef Grosch | Another day closer to a | FreeBSD 4.2 jgrosch@MooseRiver.com | Micro$oft free world | www.bafug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message