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,e2be1c8e99a1c994 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Adding offset to 'Address Date: Fri, 12 Sep 2008 17:40:53 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1221255654 10024 192.74.137.71 (12 Sep 2008 21:40:54 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 12 Sep 2008 21:40:54 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:z+4v5Dv2wEl5feJompX/myicq0c= Xref: g2news2.google.com comp.lang.ada:7734 Date: 2008-09-12T17:40:53-04:00 List-Id: Adam Beneschan writes: > (Ethernet_Header'Size + System.Storage_Unit - 1) / > System.Storage_Unit > > which rounds the size in bits up to the next multiple of > System.Storage_Unit. [System.Storage_Unit will equal 8 on most > systems.] It seems to me that this sort of thing won't work unless System.Storage_Unit is 8 bits. So you don't want rounding up. It seems better to say: pragma Assert (System.Storage_Unit = 8); ... Raw_Bytes.all'Address + Ethernet_Header'Size/8 ... If you really need to do this sort of thing, that is. - Bob