comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: Thick Ada bindings to C Win32
Date: Fri, 26 Nov 2004 10:50:16 +0100
Date: 2004-11-26T10:50:16+01:00	[thread overview]
Message-ID: <1810244.ahSE8CPTEK@linux1.krischik.com> (raw)
In-Reply-To: sa4vfbty0rk.fsf@snoopy.apana.org.au

Brian May wrote:

>>>>>> "Jeffrey" == Jeffrey Carter <spam@spam.com> writes:
> 
>     Jeffrey> Assuming that Lp[c?]void is a convention-C access type,
>     Jeffrey> you can safely convert between convention-C access types
>     Jeffrey> using Unchecked_Conversion. Your best bet may be to
>     Jeffrey> declare such an access type designating a Byte_Array
>     Jeffrey> (maybe you want Storage_Array here?), declare Item_Buffer
>     Jeffrey> aliased, store its 'Unchecked_Access in a variable of the
>     Jeffrey> appropriate type, and convert it to the Win32 access
>     Jeffrey> type.
> 
> The most obvious problem is as soon as I make Item_Buffer aliased, I
> need to make a complete copy of it.
> 
> Question:
> 
> Is S'Address the same as S(S'First)'Address?

Depends on the compiler used and if the array is definite or indefinite.
Remember: Indefinite Arrays need to store 'First and 'Last.

With GNAT I have succesfully converted definite arrays from C to Ada using
'Address.
 
With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



  reply	other threads:[~2004-11-26  9:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10  2:41 Thick Ada bindings to C Win32 Brian May
2004-11-10  4:36 ` tmoran
2004-11-10 19:31 ` Jeffrey Carter
2004-11-12  1:51   ` Brian May
2004-11-12 12:09 ` Nick Roberts
2004-11-12 17:57   ` tmoran
2004-11-12 18:50     ` Martin Krischik
2004-11-12 23:29   ` Brian May
2004-11-13  0:51     ` Jeffrey Carter
2004-11-25 23:19       ` Brian May
2004-11-26  9:50         ` Martin Krischik [this message]
2004-11-26 12:23           ` Frank J. Lhota
2004-11-26 19:19         ` Jeffrey Carter
2004-11-27 23:56           ` Brian May
2004-11-28 18:57             ` Jeffrey Carter
2004-11-28 23:45             ` Brian May
2004-11-29  7:50               ` Message-ID: <sa4vfbpzgfu.fsf@snoo tmoran
2004-11-29 14:34               ` Thick Ada bindings to C Win32 Frank J. Lhota
replies disabled

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