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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,19b0bf5b6906d2e7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.stueberl.de!feed.news.tiscali.de!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Using GNAT.Sockets with Streams and Byte Swapping Date: Thu, 26 May 2005 21:29:12 +0100 Organization: Pushface Message-ID: References: <1117014486.871500.288200@g44g2000cwa.googlegroups.com> <1117099711.738704.120930@g47g2000cwa.googlegroups.com> <1117107317.975801.33390@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1117139353 18705 62.49.19.209 (26 May 2005 20:29:13 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 26 May 2005 20:29:13 +0000 (UTC) Cancel-Lock: sha1:lzQQjViHXGXF40ALqjf5DKI5jbc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:11173 Date: 2005-05-26T21:29:12+01:00 List-Id: "markp" writes: > We found the answer to our problem. We have types such as > > type x is range 1..5; > > We then make records including these types. In the rep specs, we define > them to be 32 bits. Apparently, GNAT ignores the rep spec when doing > the 'Write, so we are not sending the correct number of bits. The fix The rep spec is about layout in memory, not on the stream. > is: > > type x is range 1..5; > for x'size use 32; > > This fixes our problem. > > Thanks very much for your help. You're welcome (and I'm glad it didn't turn out to be so difficult after all!)