comp.lang.ada
 help / color / mirror / Atom feed
From: chris <spamoff.danx@ntlworld.com>
Subject: Re: C Integers -> Booleans: shortcut?
Date: Sun, 28 Sep 2003 19:17:16 +0100
Date: 2003-09-28T19:17:16+01:00	[thread overview]
Message-ID: <3wFdb.2005$QH3.1319@newsfep4-winn.server.ntli.net> (raw)
In-Reply-To: <x7vpthkrg0h.fsf@smaug.pushface.org>

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!




  reply	other threads:[~2003-09-28 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-28 16:46 C Integers -> Booleans: shortcut? chris
2003-09-28 17:15 ` Simon Wright
2003-09-28 18:17   ` chris [this message]
2003-09-29 20:19   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox