From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9c274893e2f7e55 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!news.cs.univ-paris8.fr!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Ada to C Interface: Passing Pointers Via System.Address Date: Thu, 13 Jan 2005 18:14:40 +0100 Organization: None Message-ID: <14560892.2aEnmtv4B3@linux1.krischik.com> References: <8e19522cfe30bb2ccbfe1393fdd6b235@localhost.talkaboutprogramming.com> <5_SdnaIyCMxrCXncRVn-qg@comcast.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1105637195 03 20766 Ml-XrU5LODySSxS9 050113 17:26:35 X-Complaints-To: usenet-abuse@t-online.de X-ID: XNVSO0ZGgeYhm-BM7S9aQzSPvo2JvAK0-W0LeS0-h5pQlSepxMRiQf User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7720 Date: 2005-01-13T18:14:40+01:00 List-Id: 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