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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:130c:: with SMTP id e12mr10844446qtj.233.1581586934065; Thu, 13 Feb 2020 01:42:14 -0800 (PST) X-Received: by 2002:a9d:7f98:: with SMTP id t24mr13165273otp.338.1581586933854; Thu, 13 Feb 2020 01:42:13 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 13 Feb 2020 01:42:13 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.126.240.2; posting-account=712tRAoAAACnDXFE0pDj2tY2pIU_Msv4 NNTP-Posting-Host: 94.126.240.2 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2a19cdb1-6f01-4b1d-8597-b6ee21ed60ed@googlegroups.com> Subject: Simple Data Endianness From: guijarrockguijarro@gmail.com Injection-Date: Thu, 13 Feb 2020 09:42:14 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58042 Date: 2020-02-13T01:42:13-08:00 List-Id: Hi, The problem I present today is related to the coexistence between big-endian and little-endian application data. I have found a way that structures (records) are stored in memory according to one criterion or another (big-endian or little-endian). Assuming that 'Date' is a structure type, I can use the following statements to indicate that I want them to be stored in memory as big-endian: for Date'Bit_Order use System.High_Order_First; for Date'Scalar_Storage_Order use System.High_Order_First; My question appears when I have a simple type, such as an enumerated or an integer that occupies more than one byte and I need to instruct the compiler to store it in memory as a big-endian. Like this example: type Colour is (BLACK,YELLOW,WHITE,RED); for Colour'SIZE use 32; Is there any analogous way of doing this as in the case of compound types? Thank you so much.