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,64599bfe530783cd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-19 13:47:21 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Any examples of Byte Ordering Functions References: <1066243458.911546@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sun, 19 Oct 2003 20:47:20 GMT NNTP-Posting-Host: 63.184.17.97 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1066596440 63.184.17.97 (Sun, 19 Oct 2003 13:47:20 PDT) jrcarter010@earthlink.net NNTP-Posting-Date: Sun, 19 Oct 2003 13:47:20 PDT Xref: archiver1.google.com comp.lang.ada:1151 Date: 2003-10-19T20:47:20+00:00 List-Id: chris wrote: > procedure Write_Little_Endian > (Stream : access Root_Stream_Type'Class; > W : in Word) is > A, B : Byte; > begin > A := Byte (W and 16#00FF#); > B := Byte (Shift_Right (Unsigned_32(W), 8)); > Byte'Write (Stream, B); > Byte'Write (Stream, A); > end Write_Little_Endian; B contains the MSB, so you should write A 1st for little endian. > and this will work whatever the platform we compile on? With this correction, yes. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail 14