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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e490a18b9688bd9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.28.231 with SMTP id e7mr2370586pbh.5.1316004153536; Wed, 14 Sep 2011 05:42:33 -0700 (PDT) Path: m9ni6096pbd.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Stream_Element_Array Date: Wed, 14 Sep 2011 14:42:47 +0200 Organization: cbb software GmbH Message-ID: <17a3fc710wyy6$.rfujippaxo99.dlg@40tude.net> References: <1e6rw4vto3ldb.i8d7fxixapx4.dlg@40tude.net> <12t67nj6zlq5u$.f0bz4sdy17te.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:17962 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-09-14T14:42:47+02:00 List-Id: On Wed, 14 Sep 2011 11:18:30 +0100, Simon Wright wrote: > "Dmitry A. Kazakov" 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de