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-12 18:25:41 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!wn51feed!worldnet.att.net!216.168.1.162!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Access type conversions, how? Date: Mon, 12 Apr 2004 20:25:23 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <107mgcjspsour11@corp.supernews.com> References: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:7028 Date: 2004-04-12T20:25:23-05:00 List-Id: "Luke A. Guest" wrote in message news:pan.2004.04.13.00.32.33.603741@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co. uk... > Hi, > > We have the following in our GL package: > > package C renames Interfaces.C; > ... > type GLfloat is new C.C_float; > ... > type GLfloatPtr is access all GLfloat; > ... > procedure glMultMatrixf(M : in GLfloatPtr); > > Now, in my code, I've created a Matrix package which has as it's type: > > type Object is array(Integer range 0 .. 15) of aliased Float; > > Now, I've made it aliased because I want to pass this to glMultMatrixf, > but for some reason I cannot work out exactly how to do it. > > I've tried all sorts, like: > > GL.glMultMatrixf(M(M'First)'Unchecked_Access); -- Wrong type > > I've tried casting it to GL.GLfloat and GL.GLfloatPtr, but nothing's > working. Can anyone help? Ready for a head slapping moment? :-) GLfloatPtr points at a GLFloat (a C.C_Float), the 'Unchecked_Access points at a (Standard.)Float. These aren't the same type! They don't even need to be the same size (although they will be in practice), so you can't convert the access type. If Object was declared "... of aliased GLFloat" everything should be fine. (You can slap your head and go "Duh!" now. :-) Randy.