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,a1ce307c10055549 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-19 00:47:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: calenday (was Re: IBM Acquires Rational Ada References: X-Newsreader: Tom's custom newsreader Message-ID: <5JfM9.395655$P31.145145@rwcrnsc53> NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1040287681 12.234.13.56 (Thu, 19 Dec 2002 08:48:01 GMT) NNTP-Posting-Date: Thu, 19 Dec 2002 08:48:01 GMT Organization: AT&T Broadband Date: Thu, 19 Dec 2002 08:48:01 GMT Xref: archiver1.google.com comp.lang.ada:32066 Date: 2002-12-19T08:48:01+00:00 List-Id: > deal with the data and you discover your compiler is going to whine and > snivel about being asked to span things across unusual boundaries. What's wrong with the routine to align things, followed by an Unchecked_Conversion to something with an acceptable rep spec, approach? type Bit_Width_Lists is array(Integer range <>) of Positive; procedure Align (Source : in Packed_Data; Control: in Bit_Width_Lists; Target : out Ada.Streams.Stream_Element_Array); -- Copy sequential bit strings, inserting padding as needed to ensure -- that each starts on an alignment boundary in Target. Unless only a few of the resultant fields are accessed, this won't be much slower than having the compiler do the shifting and masking, and if some fields are accessed a lot, it will actually be faster. This doesn't help with endianness or foreign floating point etc, but those are semantic level things that a rep spec can't describe anyway.