comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Help needed in port to GNAT95 from verdix
Date: 1998/05/14
Date: 1998-05-14T00:00:00+00:00	[thread overview]
Message-ID: <355B227D.2858F2BD@elca-matrix.ch> (raw)
In-Reply-To: 6jcvoc$drd$1@plug.news.pipex.net


Paul Hussein wrote:
> 
> I do not understand  why a piece of code that works on verdix will not now
> work an gnat95, and this is an important piece of code. If anyone could help
> it would be most appreciated.

Because it contains assumptions about the 'Size of Float, and
unchecked_conversion to/from an array of floats. Consider yourself lucky if
this ports between different versions of the Verdix compiler.

> When I run this code sample, and the code itself  in our system I get a
> constraint error.
> This code endeavours to turn any type into an array of floats for passing
> over the network.

A very bad idea. Not any sequence of bits is a valid float.

If you really have to convert to something, then use 

   type Byte is 0 .. 255;
   for Byte'Size use 8;
   type Byte_Array is array (Positive range <>) of Byte;
   pragma Pack(Byte_Array);

where any sequence of bits is a valid value.




  reply	other threads:[~1998-05-14  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-13  0:00 Help needed in port to GNAT95 from verdix Paul Hussein
1998-05-14  0:00 ` Mats Weber [this message]
1998-05-14  0:00   ` Charles Hixson
1998-05-14  0:00     ` Matthew Heaney
     [not found]     ` <Esyp0E.5q0@world.std.com>
1998-05-14  0:00       ` Robert Dewar
1998-05-15  0:00         ` Larry Kilgallen
1998-05-19  0:00           ` John McCabe
1998-05-15  0:00         ` Jean-Pierre Rosen
1998-05-16  0:00           ` Robert Dewar
1998-05-15  0:00 ` Niklas Holsti
replies disabled

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