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.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Wed, 12 May 2010 13:33:40 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <58bc837c-16b5-4a9d-af74-40417ad538c5@k29g2000yqh.googlegroups.com> Injection-Date: Wed, 12 May 2010 13:33:40 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="13876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19w772/Bwzn0CLt4VqF7N0zCGmwyh+wmVw=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:p0mIzct5QwvomR6av0wT+i4POj0= Xref: g2news2.google.com comp.lang.ada:11550 Date: 2010-05-12T13:33:40+00:00 List-Id: Gautier write-only expounded in news:58bc837c-16b5-4a9d-af74-40417ad538c5@k29g2000yqh.googlegroups.com: > On May 11, 12:39�am, Yannick Duch�ne (Hibou57) > wrote: > > [...] >> Well, to be honest, this is not exactly the same as with C, as � >> Ada.Streams.Stream_Element is implementation defined (which is good, >> � because this is indeed platform dependent), so you will need an >> Assert > � >> pragma somewhere is your application, which ensures � >> Ada.Streams.Stream_Element is 8 bits or at least 8 bits (this is, in >> most > � >> of case), and then convert from Ada.Streams.Stream_Element to your � >> Byte_Type or anything your application defined as such. .. > You can make a size check (even a compile-time one!). Here, for > arrays: > subtype Size_test_a is Byte_Array(1..19); > subtype Size_test_b is Ada.Streams.Stream_Element_Array(1..19); > -- > is_mapping_possible: constant Boolean: Size_test_a'Size = > Size_test_b'Size and then > Size_test_a'Alignment = Size_test_b'Alignment; I suspect that Ada.Streams.Stream_Element being > 1 byte, is probably academic for my purposes. However, if a posix platform made a stream element 2 or 4 bytes, then the "whole gig is off". Which is what my OP was about. Should that happen, I'd be forced to look at bindings to something else. But this is probably academic. Warren