From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,693c0db9fd624c1d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-28 11:12:15 PST Path: news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-winn.server.ntli.net.POSTED!53ab2750!not-for-mail From: chris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: C Integers -> Booleans: shortcut? References: <7bEdb.1944$QH3.1487@newsfep4-winn.server.ntli.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3wFdb.2005$QH3.1319@newsfep4-winn.server.ntli.net> Date: Sun, 28 Sep 2003 19:17:16 +0100 NNTP-Posting-Host: 81.98.236.164 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-winn.server.ntli.net 1064772735 81.98.236.164 (Sun, 28 Sep 2003 19:12:15 BST) NNTP-Posting-Date: Sun, 28 Sep 2003 19:12:15 BST Organization: ntl Cablemodem News Service Xref: news1.google.com comp.lang.ada:80 Date: 2003-09-28T19:17:16+01:00 List-Id: Simon Wright wrote: > With GNAT you would say > > type C_Boolean is new Boolean; > pragma Convention (C, C_Boolean); > > with the meaning that 0 => False, anything else => True. I thought GNAT would do that, but hoped other compilers would too since it's the convention in C for 0 to be treated like false and anything else as true. > For other compilers I would think you'd be better off specifying > Interfaces.C.int and comparing to 0. Will do! Thanks!