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,47957cb8c33729e5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.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: Thick Ada bindings to C Win32 Date: Fri, 26 Nov 2004 10:50:16 +0100 Organization: None Message-ID: <1810244.ahSE8CPTEK@linux1.krischik.com> References: <2vjnfbF2lioiaU1@uni-berlin.de> <1Ucld.25101$KJ6.2286@newsread1.news.pas.earthlink.net> 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 1101463322 05 8471 vla3Xd56NarW68O 041126 10:02:02 X-Complaints-To: usenet-abuse@t-online.de X-ID: GzhnQZZBge7Lx-zRM+GptOgeSQOPanqaoLyCOYwX8IjwXEkZsfrpsW User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6499 Date: 2004-11-26T10:50:16+01:00 List-Id: Brian May wrote: >>>>>> "Jeffrey" == Jeffrey Carter 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