comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Stream_Element_Array
Date: Wed, 14 Sep 2011 17:20:11 +0100
Date: 2011-09-14T17:20:11+01:00	[thread overview]
Message-ID: <m2y5xr2j0k.fsf@pushface.org> (raw)
In-Reply-To: 17a3fc710wyy6$.rfujippaxo99.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On Wed, 14 Sep 2011 11:18:30 +0100, Simon Wright wrote:
>
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>> 
>>> On Wed, 14 Sep 2011 11:40:01 +0200, Dmitry A. Kazakov wrote:
>>>
>>>>       -- Little endian implementation of Get for Unsigned_16
>>>>    procedure Get
>>>>              (  Source : Stream_Element_Array;
>>>>                 Index  : in out Stream_Element_Offset;
>>>>                 Data   : out Unsigned_16
>>>>              )  is
>>>>    begin
>>>>       Data := Stream_Element'Pos (Source (Index)) +
>>>>               Stream_Element'Pos (Source (Index + 1));
>>>
>>> Rather:
>>>
>>>        Stream_Element'Pos (Source (Index + 1)) * 256;
>> 
>> That's an implementation where both the stream and the processor are
>> little-endian.
>
> It is an implementation when the format of unsigned 16 is little
> endian.  The processor endianness can be any, which is the point of
> doing it this way.

I agree about the processor endianness, I was wrong. However, to call it
the "format of Unsigned_16" could be a little misleading, it's the
format of Unsigned_16 *on the wire* that's little-endian.



  reply	other threads:[~2011-09-14 16:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14  3:13 Stream_Element_Array Alexander Korolev
2011-09-14  5:29 ` Stream_Element_Array Per Sandberg
2011-09-14  8:34   ` Stream_Element_Array Alexander Korolev
2011-09-14  8:31 ` Stream_Element_Array Simon Wright
2011-09-14  9:09   ` Stream_Element_Array Alexander Korolev
2011-09-14  9:40     ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14  9:41       ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 10:18         ` Stream_Element_Array Simon Wright
2011-09-14 12:42           ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 16:20             ` Simon Wright [this message]
2011-09-14 19:53               ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 10:53       ` Stream_Element_Array Simon Wright
2011-09-14 12:48         ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 14:48           ` Stream_Element_Array Alexander Korolev
2011-09-14 15:08             ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 17:16               ` Stream_Element_Array Alexander Korolev
2011-09-14 20:13                 ` Stream_Element_Array Dmitry A. Kazakov
2011-09-14 21:29                   ` Stream_Element_Array Alexander Korolev
2011-09-15  8:20                     ` Stream_Element_Array Dmitry A. Kazakov
2011-09-15 18:58                       ` Stream_Element_Array Alexander Korolev
2011-09-15 20:48                         ` Stream_Element_Array Dmitry A. Kazakov
2011-09-16  0:20                           ` Stream_Element_Array Alexander Korolev
2011-09-15 19:15                       ` Stream_Element_Array Alexander Korolev
2011-09-15 20:11                         ` Stream_Element_Array Simon Wright
2011-09-15 20:34                           ` Stream_Element_Array Alexander Korolev
2011-09-15 21:42                             ` Stream_Element_Array Simon Wright
2011-09-15 21:50                               ` Stream_Element_Array Simon Wright
2011-09-16  0:01                                 ` Stream_Element_Array Alexander Korolev
2011-09-16  0:18                               ` Stream_Element_Array Adam Beneschan
2011-09-16  7:22                                 ` Stream_Element_Array Dmitry A. Kazakov
2011-09-16 10:21                                   ` Stream_Element_Array Simon Wright
2011-09-16 12:13                                     ` Stream_Element_Array Dmitry A. Kazakov
2011-09-16 17:20                                       ` Stream_Element_Array Simon Wright
2011-09-16 19:32                                         ` Stream_Element_Array Dmitry A. Kazakov
2011-09-16 22:18                                           ` Stream_Element_Array Simon Wright
2011-09-17  8:18                                             ` Stream_Element_Array Dmitry A. Kazakov
2011-09-19 23:22                                   ` Stream_Element_Array Randy Brukardt
2011-09-15 21:28                           ` Stream_Element_Array Alexander Korolev
2011-09-15  2:33                   ` Stream_Element_Array Alexander Korolev
2011-09-19 23:11           ` Stream_Element_Array Randy Brukardt
2011-09-14 12:19 ` Stream_Element_Array Gautier write-only
2011-09-16 11:17 ` Stream_Element_Array anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox