From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Record initialisation question Date: Thu, 14 Jan 2021 15:07:54 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <5ff9779d$0$24281$426a74cc@news.free.fr> <5ffb311f$0$16185$426a74cc@news.free.fr> <5ffb7135$0$24247$426a74cc@news.free.fr> <5ffc8efd$0$8957$426a74cc@news.free.fr> <60004212$0$13563$426a34cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 14 Jan 2021 14:07:56 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6b4057ac66baa89617cc8858f74d9532"; logging-data="20680"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dMFooGGAdIlKs+ARPO19+SYRVU3aOKkQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:GKJnNjFj8uXRtwnq6wzIHG0Ldio= In-Reply-To: <60004212$0$13563$426a34cc@news.free.fr> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61125 List-Id: On 1/14/21 2:07 PM, DrPi wrote: > > I can redefine the records with UInt32 instead of System.Address. The problem is > : What is the expression to convert from Address to UInt32 without using a > function ? You can use an overlay (usually not recommended): Addr : constant Address := ...; U32 : constant Unsigned_32 with Import, Convention => Ada, Address => Addr; You can also use an untagged union (also not usually recommended), which I would need to look up. -- Jeff Carter "Nobody expects the Spanish Inquisition!" Monty Python's Flying Circus 22