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,79db4ff72bff9422 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-25 22:45:36 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!wn1feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3BD8F891.BD8792B1@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to convert record? References: <80d2e34.0110210156.7918cd3d@posting.google.com> <3bd402f9.8783319@news.demon.co.uk> <80d2e34.0110250340.155ae0b7@posting.google.com> <3BD7FE89.53BF8436@earthlink.net> <%oWB7.96$xS6.155@www.newsranger.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 26 Oct 2001 05:45:36 GMT NNTP-Posting-Host: 12.86.33.221 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 1004075136 12.86.33.221 (Fri, 26 Oct 2001 05:45:36 GMT) NNTP-Posting-Date: Fri, 26 Oct 2001 05:45:36 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:15214 Date: 2001-10-26T05:45:36+00:00 List-Id: Smark wrote: > > Well, would you worry about it with a type like this: > > type Bubba_Type is record > C : Character; -- one byte > I : Integer; -- 4 bytes > end record; > > Bubba : Bubba_Type; > > Suppose that Integers must align on 4-byte boundaries. Then you might get: > > Bubba_Type'Size = 40 (= 5 bytes) > > (Typename'size + System.Storage_Unit - 1) / System.Storage_Unit > = ( 40 + 8 - 1)/8 = 47/8 = 6 (bytes) > > But actually: > > Bubba'Size = 64 (= 8 bytes) > Of course, you might be able to fix the problem by simply reordering the components. The soundest way to do this is via a representation clause. type Bubba_Type is record I : Integer; C : Character; end record; for Bubba_Type use record I : at 0 range 0..31; C : at 4 range 0..7; end record; Jim Rogers Colorado Springs, Colorado USA