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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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 Received: by 10.68.59.38 with SMTP id w6mr43984pbq.23.1316011733498; Wed, 14 Sep 2011 07:48:53 -0700 (PDT) Path: m9ni6161pbd.0!nntp.google.com!news1.google.com!postnews.google.com!x29g2000prh.googlegroups.com!not-for-mail From: Alexander Korolev Newsgroups: comp.lang.ada Subject: Re: Stream_Element_Array Date: Wed, 14 Sep 2011 07:48:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1e6rw4vto3ldb.i8d7fxixapx4.dlg@40tude.net> NNTP-Posting-Host: 96.49.119.210 Mime-Version: 1.0 X-Trace: posting.google.com 1316011729 8531 127.0.0.1 (14 Sep 2011 14:48:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Sep 2011 14:48:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x29g2000prh.googlegroups.com; posting-host=96.49.119.210; posting-account=9aAl4woAAACPkuvNJOQxyBXxG_5lfu_0 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUARLECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; ru-ru) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5,gzip(gfe) Xref: news1.google.com comp.lang.ada:17965 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-09-14T07:48:47-07:00 List-Id: On Sep 14, 4:48=A0pm, "Dmitry A. Kazakov" wrote: > On Wed, 14 Sep 2011 11:53:13 +0100, Simon Wright wrote: > > I know the RM doesn't specify this, and goes out of its way to allow > > 9-bit bytes and 36-bit storage units. But how many real-life situations > > are there where Stream_Element'Size isn't 8? > > Why not to mandate it 8-bit then? Even if the machine does not support > memory access to octets, I think it would be worth the efforts to have th= e > compiler doing packing/unpacking stuff, rather than the programmer. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Thanks a lot Dmitry, Just a note: "Stream element might be not the best choice if you are communicating with the external world" I am talking to serial port via GNAT.Serial_Communication. The Buffer it offers is Stream_Element_Array. And I need to do computations (implemented assuming that the buffer is ok :) ) over the buffer before do the call.One of the formats receiving part expects is: |Start(8bit|Length - 16 bit|Element1-8bit|Element-16bit|Checksum| Write (S_Port,Buffer)