comp.lang.ada
 help / color / mirror / Atom feed
* C Integers -> Booleans: shortcut?
@ 2003-09-28 16:46 chris
  2003-09-28 17:15 ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: chris @ 2003-09-28 16:46 UTC (permalink / raw)


Hi,

Can you (in general) import a function taking/returning a C integer and 
treat it like a boolean for import?  Let the compiler deal with the 
difference?

Like say,

function is_broke (something : sometype) return Boolean;


pragma Import (C, Is_Broke, "is_broke");

with is_broke actually,

int is_broke (sometype something);


instead of going through

function is_broke (something : sometype) return Boolean is
begin
    return c_is_broke (something) /= 0;
end is_broke;


Cheers,
Chris




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-29 20:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 16:46 C Integers -> Booleans: shortcut? chris
2003-09-28 17:15 ` Simon Wright
2003-09-28 18:17   ` chris
2003-09-29 20:19   ` Randy Brukardt

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