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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2abd26ae990a7289 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Record rep-clauses Date: 1996/01/08 Message-ID: #1/1 X-Deja-AN: 134676224 references: <30F1418B.33CB@kiemw.ericsson.se> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-01-08T00:00:00+00:00 List-Id: In article <30F1418B.33CB@kiemw.ericsson.se>, Magnus Ericson wrote: >I believe I have seen a paper (or article) about how to best write >record-rep clauses when you need to port your software between little- >and big-endian system but I don't know where! Sorry, I don't know of the article. But one technique for Ada 83 is to define a bunch of subtypes representing the ranges (e.g. all possible subranges of 0..31), and write all your rep clauses in terms of those. Then, when you switch to a machine with different endian-ness, change the subtypes, but not the rep clauses. (I.e. keep two different versions of the same package, defining all the subtypes.) It's a lot of subtypes, but if you're writing many rep clauses, it might be worth it. >I am not using Ada 95 but information about how to solve it with this >revision of the language is also of interest (at least in order to plan >for transitioning the software we are writing now to Ada 95 later on). Look at RM95-13.5.3, "Bit Ordering". - Bob