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,febd9e55846c9556 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-05 09:47:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Endianness independance Date: 05 Mar 2003 12:37:13 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <5115eb96.0303010248.1b2b8d37@posting.google.com> <3E641073.8030600@acm.org> <3E655DF5.5020702@acm.org> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1046886673 26939 128.183.235.92 (5 Mar 2003 17:51:13 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 5 Mar 2003 17:51:13 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:34924 Date: 2003-03-05T17:51:13+00:00 List-Id: Jeffrey Carter writes: > Stephen Leake wrote: > > Jeffrey Carter writes: > > > >>You can make this system independent by using > >>System.Default_Bit_Order, which, thanks to an AI (I don't remember > >>which, but you can look it up) is static. > > What do you mean by "system independent"? This code is already > > portable without change across targets that differ in endianness; > > that's whay I mean by "system independent". > > Exactly how would I use System.Default_Bit_Order for this purpose? > > I can check that System.Default_Bit_Order has a particular value, and > > only provide a rep clause that is correct for that value. But I don't > > see how to use System.Default_Bit_Order in the rep clause; it does not > > provide enough information. > > You said your package was "system dependent" because you have to > change it for different platforms. Hmm. Maybe you mean the SAL.Endianness package (I posted two packages; SAL.Endianness and Foo - please be specific!). Yes, that has to be different for different platforms. But, you only have to write it once for each platform, and I already have. So I don't have to edit code when I change platforms; I just have to change which code is included in the compilation. > Using Default_Bit_Order you can make it work without change on all > platforms. You can use 'Pos of Default_Bit_Order to calculate all of > the named numbers in your package. You can then continue to use your > package as before, but without changing it when you change > platforms. Well, maybe. I'm comfortable with the package as it is. If you'd like to contribute, feel free to post your version :). -- -- Stephe