comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <amado.alves@netcabo.pt>
To: Robert A Duff <bobduff@shell01.TheWorld.com>
Cc: comp.lang.ada@ada-france.org
Subject: Re: setting 'Size and unchecked conversion safe here?
Date: Sat, 12 Feb 2005 19:48:18 +0000
Date: 2005-02-12T19:48:18+00:00	[thread overview]
Message-ID: <mailman.143.1108237557.527.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <wcc650xmvzd.fsf@shell01.TheWorld.com>

"A combination of checked and unchecked convertions. First an unchecked
convertion to an access compatible modular type." (Martin)

>     X: Acc_To_Subp;
>     type Modular_32 is mod 2**32;
>     function Cast is new Unchecked_Conversion(Acc_To_Subp, Modular_32);
>     V: constant Vertex := (Tip => 0, Cue => Modular_64(Cast(X)));
(Bob)

This is a great idea. Bob's example made me understand Martin's 
suggestion. I think I'll do this. Thanks a lot.

> ... you
> could use a variant record.  See Unchecked_Union for C compatibility.

I'll check. Thanks.




      reply	other threads:[~2005-02-12 19:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-11 18:52 setting 'Size and unchecked conversion safe here? Marius Amado Alves
2005-02-11 19:08 ` Martin Krischik
2005-02-11 20:34 ` tmoran
2005-02-11 22:37   ` Marius Amado Alves
2005-02-11 23:49     ` tmoran
2005-02-12 13:10       ` Marius Amado Alves
2005-02-12  6:55     ` Martin Krischik
2005-02-12 13:30       ` Marius Amado Alves
2005-02-12 14:57         ` Martin Krischik
2005-02-12 16:03           ` Marius Amado Alves
2005-02-12 16:04           ` Marius Amado Alves
2005-02-11 23:38 ` Robert A Duff
2005-02-12 12:46   ` Marius Amado Alves
2005-02-12 18:05     ` tmoran
2005-02-12 18:29       ` Marius Amado Alves
2005-02-12 19:14     ` Robert A Duff
2005-02-12 19:48       ` Marius Amado Alves [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox