From owner-freebsd-hackers Sat Sep 25 4:33:14 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 6CF5614F01 for ; Sat, 25 Sep 1999 04:33:10 -0700 (PDT) (envelope-from des@flood.ping.uio.no) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id NAA92833; Sat, 25 Sep 1999 13:32:58 +0200 (CEST) (envelope-from des) To: Neil Blakey-Milner Cc: Gregory Bond , hackers@FreeBSD.ORG Subject: Re: "style" question References: <199909170821.SAA15276@lightning.itga.com.au> <19990917141510.A85883@rucus.ru.ac.za> From: Dag-Erling Smorgrav Date: 25 Sep 1999 13:32:57 +0200 In-Reply-To: Neil Blakey-Milner's message of "Fri, 17 Sep 1999 14:15:10 +0200" Message-ID: Lines: 31 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Neil Blakey-Milner writes: > On Fri 1999-09-17 (18:21), Gregory Bond wrote: > > I'm looking at cleaning up a few compile nits and I'm wondering what the > > officially approved way of silencing "may not be used" warnings: > > > > int > > foo(int flag) > > { > > int j; > j = 0; > > if (flag) > > j = 1; > > > return j; > > } Hmf, I just realized: int foo(int flag) { return !!flag; } or #define foo(x) (!!(x)) DES -- Dag-Erling Smorgrav - des@flood.ping.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message