From: dmarshal@netcom.com (Dave Marshall)
Subject: Re: Record -> Array in Ada
Date: 1996/08/20
Date: 1996-08-20T00:00:00+00:00 [thread overview]
Message-ID: <dmarshalDwFow7.4Fx@netcom.com> (raw)
In-Reply-To: 321991BE.41C67EA6@mailgw.sanders.lockheed.com
Mike Roske <mroske@mailgw.sanders.lockheed.com> writes:
[snipped the introduction: need to transmit a record as a number of
16-bit values.]
>I have identified the following options:
>1) Unchecked_Conversion into a fixed size array. (And if I do this, how
>do I get the array bounds set correctly?)
I've done this rather frequently. The number of words is computed
thusly, use whatever stylistics you like:
Number_Of_Words : constant := (My_Record_Type'Size + 15) / 16;
>2) Pass Record'Address and Record'Size into a subprogram. Inside the
>subprogram, declare an array of the appropriate size, located at the
>appropriate address. (have prototyped this one, and it works.)
*FROWNERZ*, sometimes we are prevented from doing the cool things that
work. LRM 13.5(8):
"Address clauses should not be used to achieve overlays of objects or
overlays or program units. Nor should a given interrupt be linked to
more than one entry. Any program using address clauses to achieve
such effects is erroneous."
--
Dave Marshall
dmarshal@netcom.com
next prev parent reply other threads:[~1996-08-20 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-20 0:00 Record -> Array in Ada Mike Roske
1996-08-20 0:00 ` Ted Dennison
1996-08-20 0:00 ` Robert Dewar
1996-08-20 0:00 ` Dave Marshall [this message]
1996-08-20 0:00 ` Robert I. Eachus
1996-08-20 0:00 ` George Haddad
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox