From: "Warren W. Gay VE3WWG" <ve3wwg@NoSpam.cogeco.ca>
Subject: Re: GNAT Ada.Streams Bug?
Date: Sat, 27 Nov 2004 09:42:52 -0500
Date: 2004-11-27T09:42:52-05:00 [thread overview]
Message-ID: <Pn0qd.16373$14.12905@read1.cgocable.net> (raw)
In-Reply-To: <x7v4qjc5it5.fsf@smaug.pushface.org>
Simon Wright wrote:
> "Warren W. Gay VE3WWG" <ve3wwg@NoSpam.cogeco.ca> 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.
next prev parent reply other threads:[~2004-11-27 14:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-25 17:41 GNAT Ada.Streams Bug? Warren W. Gay VE3WWG
2004-11-25 19:40 ` Jeff C r e e.m
2004-11-26 4:11 ` Warren W. Gay VE3WWG
2004-11-26 9:49 ` Georg Bauhaus
2004-11-26 17:30 ` Warren W. Gay VE3WWG
2004-11-27 7:34 ` Martin Krischik
2004-11-28 1:10 ` Warren W. Gay VE3WWG
2004-11-29 7:50 ` tmoran
2004-11-29 17:47 ` Warren W. Gay VE3WWG
2004-11-26 22:47 ` Simon Wright
2004-11-27 14:42 ` Warren W. Gay VE3WWG [this message]
2004-11-27 17:25 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox