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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d4226ffde2290b0c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v30g2000yqm.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Performance of the Streams 'Read and 'Write Date: Sun, 1 Nov 2009 13:38:44 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <0554a812-076a-4d89-8ec4-fcbc27e25804@v30g2000yqm.googlegroups.com> NNTP-Posting-Host: 81.62.207.83 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1257111531 4096 127.0.0.1 (1 Nov 2009 21:38:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 1 Nov 2009 21:38:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v30g2000yqm.googlegroups.com; posting-host=81.62.207.83; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8937 Date: 2009-11-01T13:38:44-08:00 List-Id: Jeffrey R. Carter: > If you're > really paranoid, you can add a test that Unsigned_8'Size = Stream_Element'Size, > which you seem to be assuming. Yet a bit more paranoid: checking the size of arrays! workaround_possible: Boolean; procedure Check_workaround is test_a: constant Byte_Buffer(1..10):= (others => 0); test_b: constant Ada.Streams.Stream_Element_Array(1..10):= (others => 0); begin workaround_possible:= test_a'Size = test_b'Size; end Check_workaround; It's the code I've put into Zip-Ada - big success! :-) _________________________________________________________ Gautier's Ada programming -- http://sf.net/users/gdemont/ NB: For a direct answer, e-mail address on the Web site!