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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ceb82769e7e23b X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: Help needed in port to GNAT95 from verdix Date: 1998/05/14 Message-ID: <355B319B.BAFDC332@earthling.net>#1/1 X-Deja-AN: 353280637 Content-Transfer-Encoding: 7bit References: <6jcvoc$drd$1@plug.news.pipex.net> <355B227D.2858F2BD@elca-matrix.ch> To: Mats.Weber@elca-matrix.ch Content-Type: text/plain; charset=us-ascii Organization: http://extra.newsguy.com Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-05-14T00:00:00+00:00 List-Id: It seems to me that I have been reading that it should be: type Byte is -128..127; or it won't fit into 8 bits, which certainly seems to be what you are planning here. Something about values requiring symmetry around 0? Please let me know if I'm confused, as Ada is by no means my primary language. Mats Weber wrote: > > 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. -- Charles Hixson charleshixson@earthling.net (510) 464-7733 or chixso@mtc.dst.ca.us