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,826cd690cb6a7585 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!s8g2000vbx.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Address and bit mask Date: Mon, 29 Aug 2011 10:54:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: <90fa6456-c4e6-4894-92c4-c11ac470091b@s8g2000vbx.googlegroups.com> References: <71159ccc-bf20-4fcf-a7f1-3b90629c1ecb@l4g2000vbv.googlegroups.com> <4b8745d2-11fa-4cd4-bfc3-127501bef0aa@eb1g2000vbb.googlegroups.com> <80d7ce1b-8621-47aa-8d03-4d168fd52b30@o9g2000vbo.googlegroups.com> NNTP-Posting-Host: 86.132.4.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1314640458 14464 127.0.0.1 (29 Aug 2011 17:54:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 29 Aug 2011 17:54:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s8g2000vbx.googlegroups.com; posting-host=86.132.4.178; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0) Gecko/20100101 Firefox/7.0,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21692 Date: 2011-08-29T10:54:18-07:00 List-Id: On Aug 29, 5:33=A0pm, milouz wrote: > > To start with, check out package System.Storage_Elements. It at least > > has To_Address/To_Integer subprograms. > > As far as I understand, your solution is to convert the address in > address_integer, manipulating it, and then converting it in address. > And all that stuff is because Address type is defined as private. > Am I right ? > > > Size/range of addresses are rather target dependent, so I'm curious as > > to what you wish to make 'portable'?... > > I mean a solution that works with the Address type without the need to > redefine everything. Maybe, without know what you actually want to do, it's hard to say. I'd definitely be littering the code that did the manipulation with all sorts of "pragma Assert"s. Things under System.* are, well, system specific - the language makes no guarantee about the format of the integer address (signed or modular?). Perhaps you 'know' that 32-bit addresses are all you are ever going to use - so you could Assert that knowledge. It'll come in handy the day someone else decides to port it to a 64-bit cpu. -- Martin