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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f798c20ee494262a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!news-FFM2.ecrc.net!newsfeed.vmunix.org!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.news-service.com!post.news-service.com!news1.surfino.com!not-for-mail Message-ID: <1390368.LNTfKyOIbW@linux1.krischik.com> From: Martin Krischik Subject: Re: setting 'Size and unchecked conversion safe here? Newsgroups: comp.lang.ada Reply-To: martin@krischik.com Date: Sat, 12 Feb 2005 15:57:18 +0100 References: <4692490.U9hXl7fFM7@linux1.krischik.com> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@surfino.com NNTP-Posting-Host: 83.169.148.166 (83.169.148.166) NNTP-Posting-Date: Sat, 12 Feb 2005 16:00:10 +0100 X-Trace: d8acd420e19faf60c310329603 Xref: g2news1.google.com comp.lang.ada:8281 Date: 2005-02-12T15:57:18+01:00 List-Id: Marius Amado Alves wrote: > > On 12 Feb 2005, at 06:55, Martin Krischik wrote: > >> Marius Amado Alves wrote: >> >>>> ARM 13.9(5 .. 11) says >>>> "If all of the following are true, >>>> ... >>>> S'Size = Target'Size >>> >>> I know. This happens, because I forced the access type to be 64-bit, >>> same as the modular. What I'm not sure about is whether the unused 32 >>> bits are harmless or not (by definition). Thanks. >> >> There are not harmless since there is no requironment to set them to >> 16#0000000#. > If there were such a requirement is there a simple way to specify it? A combination of checked and unchecked convertions. First an unchecked convertion to an access compatible modular type: http://en.wikibooks.org/wiki/Programming:Ada:Types:access#where_is_void.2A.3F then a checked convertion to the 64 bit type. >> In order to help you we have to know why it is that the access is 32 >> bit and >> the modular 64. I can only guess it is for some compatiblity reason - >> but >> what do you need to keep compatible? > > The access type is 32 bits because the compiler says so. > The modular 64 is my choice to represent small values (integers, > floats, tiny strings, access values) in the vertices of a Mneson graph: > > type Vertex is record > Tip : Natural_16; > Cue : Modular_64; > end record; > for Vertex'Size use 80; > pragma Pack (Vertex); > > I know this might be incompatible with some unusual architectures but > I'm prepared to deal with that when and if the time comes. I would use a variant record: http://en.wikibooks.org/wiki/Programming:Ada:Types:record#Variant_Record But that's is just me - and may not be suitable for your database. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com