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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2aaba1527862ef22 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada Date: Sat, 03 Feb 2007 12:13:15 +0000 Organization: Pushface Message-ID: References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <45bf9b8b$0$22527$39db0f71@news.song.fi> <45c25ddf$0$22513$39db0f71@news.song.fi> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1170504794 21322 62.49.19.209 (3 Feb 2007 12:13:14 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 3 Feb 2007 12:13:14 +0000 (UTC) Cancel-Lock: sha1:jHChre4u2QLysG0gQS6eG3LH75g= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:8873 Date: 2007-02-03T12:13:15+00:00 List-Id: Niklas Holsti writes: > I think the best method is to use Streams, but that takes some study > to get started. And endianness-handling isn't easy and (on GNAT) isn't on by default. You can build your own GNAT RTL with XDR support on streaming by replacing s-stratt.adb with the supplied s-strxdr.adb -- and then streams Just Work across platforms. Well, all the platforms I'm interested in. We need to stream betweem PowerPC and x86, and would much prefer to work with AdaCore's supplied RTL than one we rebuilt ourselves, so we shall be using the standard RTL on the deliverable PPC target and a modified one on the Intel host (we can't use AdaCore's, because it streams one data type (Wide_Character???) in 4 bytes where the native code streams in 2).