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-Thread: 103376,2aaba1527862ef22 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sat, 03 Feb 2007 15:59:28 +0100 From: Gautier User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <45bf9b8b$0$22527$39db0f71@news.song.fi> <45c25ddf$0$22513$39db0f71@news.song.fi> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.77.181.84 X-Original-NNTP-Posting-Host: 83.77.181.84 Message-ID: <45c4a332$1_1@news.bluewin.ch> X-Trace: news.bluewin.ch 1170514738 83.77.181.84 (3 Feb 2007 15:58:58 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news1.google.com!news.germany.com!ecngs!feeder.ecngs.de!130.59.10.21.MISMATCH!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:8875 Date: 2007-02-03T15:59:28+01:00 List-Id: Simon Wright: > 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). It seems complicated, depends on GNAT and furthermore needs modifying its RTL. What about a deterministic way where data is sliced into bytes in the Ada code ? You can take a look at GLOBE_3D-IO.adb in GLOBE_3D ( http://www.mysunrise.ch/users/gdm/g3d.htm ), it's working fine: a .g3d object can be written on a PowerPC machine with a GLOBE_3D engine compiled by GNAT, then read on a PC with a GLOBE_3D compiled by ObjectAda (succesfully tested). A single source, no tweak, no compiler dependence... BTW, there is also a portable way (single-source) of transferring Floats use by GLOBE_3D.IO. G.