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-Thread: a07f3367d7,d4984245154c8ef1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Interfacing C type, unconstrained array with record Date: Sat, 16 Oct 2010 23:34:01 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: J4HSNf9Eqj44wTz1J3b8lQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Xref: g2news2.google.com comp.lang.ada:15548 Date: 2010-10-16T23:34:01+00:00 List-Id: In this particular simple (and common) case, how about translating > typedef struct { > int ncolors; > SDL_Color colors[]; // Actually is SDL_Color *colors but this is how > it is laid out in memory > } SDL_Palette; to type SDL_Palette(ncolors : interfaces.c.int) is record colors : SDL_Color_Array(1 .. ncolors); end record; for SDL_Palette use record ncolors at 0 range 0 .. 31; end record; I don't understand the following comment. "colors" here is actually an array, not a pointer, right? > SDL_Color colors[]; // Actually is SDL_Color *colors but this is how > it is laid out in memory