comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: Ada to C Interface: Passing Pointers Via System.Address
Date: Thu, 13 Jan 2005 18:14:40 +0100
Date: 2005-01-13T18:14:40+01:00	[thread overview]
Message-ID: <14560892.2aEnmtv4B3@linux1.krischik.com> (raw)
In-Reply-To: 5_SdnaIyCMxrCXncRVn-qg@comcast.com

tmoran@acm.org wrote:

>> My C functions return pointers to data structures (very large
>> structures). I need to then pass the pointer to the data struct to the
>> Ada code and
>> back into other C functions.  There is no interaction with the data
>> structure in the Ada code except to pass the pointer from one C function
>> to another.
>   If the data being passed through Ada is a black box to Ada, why not
> just declare a type of the appropriate size, eg
>   type C_Thing is range 0 .. 2**32-1;
>   for C_Thing'size use 32;

The World is on the dawn of 64bit CPUs. Better be prepared:

type C_Thing is mod System.Memory_Size;
for C_Thing'Size use System.Word_Size;

Martin

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



  parent reply	other threads:[~2005-01-13 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-12  2:16 Ada to C Interface: Passing Pointers Via System.Address ReversedBias
2005-01-12  3:09 ` tmoran
2005-01-12  7:36   ` ReversedBias
2005-01-12  8:38     ` tmoran
2005-01-12 15:50       ` Mark Lorenzen
2005-01-13 17:14   ` Martin Krischik [this message]
2005-01-13  1:25 ` Jeffrey Carter
2005-01-13  3:05 ` Steve
replies disabled

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