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,e91f674b5db5e2b2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-15 23:22:55 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3BA44537.59C9F118@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [Different Topic] Endianess? References: <09Oo7.12082$mj6.1852826@news6-win.server.ntlworld.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 16 Sep 2001 06:22:54 GMT NNTP-Posting-Host: 206.133.140.136 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1000621374 206.133.140.136 (Sat, 15 Sep 2001 23:22:54 PDT) NNTP-Posting-Date: Sat, 15 Sep 2001 23:22:54 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Sat, 15 Sep 2001 23:19:37 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:13100 Date: 2001-09-16T06:22:54+00:00 List-Id: "chris.danx" wrote: > > How could one detect Endianess with Ada 95? > > I've seen some C snippets which exploit C arrays, but can see no obvious > mapping to Ada 95. The C snippet says that for a union of a number and an > array of 4 bytes, setting the number to one will have a one in the zeroth > byte of the array for little endian, and zero for a big endian. How do I > map this to Ada? Use an unchecked conversion perhaps? > > Is there another portable (simpler) way? One way is to use System.Default_Bit_Order. Although technically not the same as endianness, in practice the two are related. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail