comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: Java wrappers around Ada?
Date: Sat, 25 Mar 2006 00:37:18 GMT
Date: 2006-03-25T00:37:18+00:00	[thread overview]
Message-ID: <2h0Vf.47877$oL.14733@attbi_s71> (raw)
In-Reply-To: <442466a1_1@newsfeed.slurp.net>

James Alan Farrell wrote:
> On the C side things are a bit messy.  Out and in/out parameters become 
> pointers.  This works rather better than I would've thought (probably 
> the pragma forces such parameters to be pointers where they would not 
> always be otherwise).  But even so, we have a lot of C functions with 
> void * parameters instead of typed pointers and ints instead of Boolean, 
> etc.

ARM B.3 defines how parameters should be passed to a convention-C subprogram.

> One interesting problem we had was converting Ada access types to C 
> pointers.  An Ada access type is a higher level construct than a C 
> pointer, which means it may or might not actually "point" to the desired 
> location in memory.  What we found in practice is that arrays that are 
> sized dynamically have a 64 bit entity in which the first 32 bits do 
> point to the object of interest.

You can apply pragma Convention (C, ...); to an Ada access type to ensure that 
it is C compatible.

-- 
Jeff Carter
"Ditto, you provincial putz?"
Blazing Saddles
86



      reply	other threads:[~2006-03-25  0:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-22 13:01 Java wrappers around Ada? kk_oop
2006-03-22 13:33 ` Larry Kilgallen
2006-03-23  6:57   ` Anders Wirzenius
2006-03-23 13:10     ` Larry Kilgallen
2006-03-22 13:33 ` Georg Bauhaus
2006-03-22 23:25 ` Jeffrey R. Carter
2006-03-23 22:24 ` James Alan Farrell
2006-03-23 22:59   ` kk_oop
2006-03-24 21:40     ` James Alan Farrell
2006-03-25  0:37       ` Jeffrey R. Carter [this message]
replies disabled

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