From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner)
Subject: Re: More C
Date: 2000/01/28
Date: 2000-01-28T00:00:00+00:00 [thread overview]
Message-ID: <86rbgm$9ic1@news.cis.okstate.edu> (raw)
In-Reply-To: 3B9k4.122$Ro5.7388@nnrp3-w.snfc21.pbi.net
On Fri, 28 Jan 2000 05:14:39 GMT, tmoran@bix.com <tmoran@bix.com> wrote:
>type SDL_Palette is record
> Number_Of_Colors: C.Int;
> Colors: Color_List_Access;
>end record;
>
>I presume you really want Colors to point to a Color_List, not to a
>single color. Note that Colors will point to a list of N colors,
>where N may, or may not, equal Number_Of_Colors. So you can either
>ignore Number_Of_Colors (using Palette.Colors.all'length if you need
>the count of colors in the list) or you can have your "Indexed"
>function do a check that "Index in 1 .. Number_Of_Colors" or
>"Index in 0 .. Number_Of_Colors-1" or whatever, in addition to the
>automatic index check.
This seems wrong. What gives Ada the information about how long that
list is? Looking at the C structure, the reason why Number_Of_Colors
was stored there is so that the length is known, and it is not
stored anywhere else.
--
David Starner - dstarner98@aasaa.ofe.org
If you wish to strive for peace of soul then believe;
if you wish to be a devotee of truth, then inquire.
-- Friedrich Nietzsche
next prev parent reply other threads:[~2000-01-28 0:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <vhizotrc4x7.fsf@grotte.ifi.uio.no>
2000-01-28 0:00 ` More C tmoran
2000-01-28 0:00 ` David Starner [this message]
2000-01-28 0:00 ` Pascal Obry
2000-01-28 0:00 ` David Starner
2000-01-28 0:00 ` tmoran
2000-01-28 0:00 ` Jeff Carter
2000-01-28 0:00 ` Gautier
2000-01-30 0:00 ` Nick Roberts
[not found] ` <vhioga1r2j8.fsf@grotte.ifi.uio.no>
2000-02-01 0:00 ` tmoran
2000-02-02 0:00 ` Nick Roberts
2000-02-03 0:00 ` Keith Thompson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox