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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,76813f0de9a78c61 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-03 10:39:45 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: How can you convert..... Date: 03 Oct 2001 13:38:32 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <9pedqp$m5l$1@newstoo.ericsson.se> <9peieq$5kd$1@newstoo.ericsson.se> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1002130799 662 128.183.220.71 (3 Oct 2001 17:39:59 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 3 Oct 2001 17:39:59 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:13684 Date: 2001-10-03T17:39:59+00:00 List-Id: "Petter Fryklund" writes: > If it is convertiable, by > > with Ada.Unchecked_Conversion; > with System; > with Interfaces; > ... > ... > function "+" is new Ada.Unchecked_Conversion (Source => System.Adress, > Target => Interfaces.Unsigned_32); > Adr : System.Address; > U : Interfaces.Unsigned_32; > begin > > .... > ..... > U := + Adr; > This will probably work, but there is a better way, which is guarranteed by the compiler. See System.Storage_Elements.To_Integer. This function converts an address into an appropriate integer type. Note that on some systems, an address has less than 32 bits, and on others, it has more. -- -- Stephe