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,350146ee5962eb2b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-20 04:50:09 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Update of SAL Date: 20 Nov 2001 07:24:47 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3BF83DFF.52C85B1D@erols.com> <3bfa43f6@pull.gecm.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1006259237 28191 128.183.220.71 (20 Nov 2001 12:27:17 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 20 Nov 2001 12:27:17 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16713 Date: 2001-11-20T12:27:17+00:00 List-Id: "Martin Dowie" writes: > "LeakyStain" wrote in message > news:3BF83DFF.52C85B1D@erols.com... > > I've posted a new version of SAL to my website: > > > > http://users.erols.com/leakstan/Stephe/Ada/sal.html > > > > There are a couple new packages, and the sorted tree now supports three > > options for duplicate keys; error, allow, ignore. > > Got a quick URL to 'Endianness'? I'm sure I could regenerate > it to get the SAL to compile but if you have a quick link > that would obviously save some effort. Hmm. There seems to be a problem with my quality control! I apparently added sal-gen-word_order_convert without adding a test for it, so I never actually compiled it, so I didn't notice I left out Endianness. Sigh. Below is the version for GNAT on x86; this package is compiler and CPU specific. Obviously, I should rename it to SAL.Endianness or something. Let me know if this doesn't work. -- -- Stephe -- -- Define constants to reflect hardware bit and word endianness in record -- representation clauses. Obviously, this file is highly system-dependent. -- with System; package Endianness is pragma Pure; -- this is for gnat on an Intel 386 compatible processor System_Name : constant System.Name := System.SYSTEM_NAME_GNAT; Endianness_Error : exception; Bit_Order : constant := 1; -- 1 or -1 High_Bit_First : constant := 0; -- 0 or 1 Low_Bit_First : constant := 1; -- opposite of High_Bit_First LSBit : constant := 0; -- 0 or 7 or 15 (for word machines) -- typical usage of these constants, to make record spec independent of -- bit-endianness: -- -- for Foo_Type use record -- User_Ephemeris_Needed at 0 range LSBit + Bit_Order * 0 .. LSBit + Bit_Order * 0; -- -- Operational_Status at 0 range -- Low_Bit_First * (LSBit + Bit_Order * 4) + High_Bit_First * (LSBit + Bit_Order * 7) .. -- High_Bit_First * (LSBit + Bit_Order * 4) + Low_Bit_First * (LSBit + Bit_Order * 7); -- end record; type Byte_Order_Type is (Big_Endian, Little_Endian); Byte_Order : constant Byte_Order_Type := Little_Endian; end Endianness;