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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5d708145f98f6273 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-14 00:45:07 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: martin.dowie@btopenworld.com (Martin Dowie) Newsgroups: comp.lang.ada Subject: Re: Access type conversions, how? Date: 14 Apr 2004 00:45:06 -0700 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 20.138.254.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1081928707 31937 127.0.0.1 (14 Apr 2004 07:45:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Apr 2004 07:45:07 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:7073 Date: 2004-04-14T00:45:06-07:00 List-Id: zhenglonggen wrote in message news:... > with Ada.Text_Io; > use Ada.Text_Io; > with System; > use System; ^^^^^^^^^^^^^^ Not required > with Interfaces.C; > use Interfaces.C; > procedure Test_access2address is > type GLFloat is new C_Float; > type GLFloat_Ptr is access all GLFloat; > type Object is array(0..15) of aliased GLFloat; ^^^^^^^ The OP wants this to be 'Float' - but this can just be changed an it will still work > type Object_Ptr is access all Object; > function Access2address(An_Object_Ptr:Object_Ptr) return GLFloat_Ptr ^^^^^^^^^^^^^^ To get the real benefits, this subprogram needs to be 'inlined'. I'm totally paranoid, so I'd be adding some 'C_Float is the same as Float' assertions! Cheers, -- Martin