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,1ea59bb198e88f9f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!feed.cgocable.net!read1.cgocable.net.POSTED!53ab2750!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT Ada.Streams Bug? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 27 Nov 2004 09:42:52 -0500 NNTP-Posting-Host: 24.150.168.167 X-Complaints-To: abuse@cogeco.ca X-Trace: read1.cgocable.net 1101566575 24.150.168.167 (Sat, 27 Nov 2004 09:42:55 EST) NNTP-Posting-Date: Sat, 27 Nov 2004 09:42:55 EST Organization: Cogeco Cable Xref: g2news1.google.com comp.lang.ada:6552 Date: 2004-11-27T09:42:52-05:00 List-Id: Simon Wright wrote: > "Warren W. Gay VE3WWG" writes: >>I am not concerned at all about the efficiency of this case, as you >>read the partition 4 times at boot time (less if you have fewer >>disks). I know however, that you were stating the more general >>case. >> >>It is disappointing to learn that basically Ada95 is "portability >>busted" when it comes to Ada.Streams. As Randy (I think) mentioned >>in the AI link, it is very difficult to adapt a stream to external >>formats - more impossible to be compiler independent at the same >>time. Since I am trying to interface a stream to the boot sector, >>this becomes a real problem that I'll have to "work around". > > So the AI lets you make the streaming portable provided that > everything is a multiple of Stream_Element'Size (and, I guess, all the > participants are of the same endianness). I suppose I have always considered everything to be a multiple of Stream_Element'Size anyway. But you are right in that you could have types in odd bitwise sizes. My expectations were set lower than yours ;-) > If those conditions are met, you have what looks like a more > convenient way of expressing representations. Otherwise, it'll have to > be the hard way .. I must say it wouldn't have occurred to me to > expect a Stream to meet your requirements. But we progress by meeting > needs, and someone has to express them! With GNAT, I simply need to stick to multiples of 2,4,8 etc., and then their streams I/O works fine (apart from arrays of bytes). I got around my problem by separating the head from sector & cylinder (24 bits => 8 + 16). This works fine, since we're dealing with a 1 and 2 byte values. Warren.