comp.lang.ada
 help / color / mirror / Atom feed
From: David Bolen <db3l@fitlinxx.com>
Subject: Re: Another problem with stream reading.
Date: 27 Mar 2002 19:18:20 -0500
Date: 2002-03-27T19:18:20-05:00	[thread overview]
Message-ID: <ud6xpwnn7.fsf@ctwd0143.fitlinxx.com> (raw)
In-Reply-To: ua4mt7p1nif778@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> writes:

> Janus/Ada, at least, will generate code for your type byte as if it is
> unsigned (that has necessary for Ada 83, which had no unsigned types at
> all), with all of the checking. But where the language requires the base
> type (such as in streams), we have to use signed 16-bits.
> 
> The place this matters, of course, is for the largest unsigned type. If
> you declare
>             type Unsigned is range 0 .. (2**32)-1;
> in Janus/Ada for Windows, you'll get an error, because there is no
> signed base type large enough to fit it.

How would you typically work around this, if you really wanted to be
working with 32-bit unsigned quantities in your code?  If there's no
signed base type large enough (sans 64-bit support presumably) would
you have to implement your own set of operations on, say, a data type
made out of two 16-bit values?

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l@fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



  reply	other threads:[~2002-03-28  0:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-25 18:53 Another problem with stream reading Erik Sigra
2002-03-25 19:01 ` Dan Andreatta
2002-03-25 19:14   ` Erik Sigra
2002-03-25 22:20     ` Jeffrey Carter
2002-03-25 22:28     ` Stephen Leake
2002-03-26 17:54 ` Warren W. Gay VE3WWG
2002-03-27 15:53   ` Erik Sigra
2002-03-27 21:22     ` Warren W. Gay VE3WWG
2002-03-27 22:50     ` Dan Andreatta
2002-03-27 23:55     ` Randy Brukardt
2002-03-28  0:18       ` David Bolen [this message]
2002-03-28 22:30         ` Randy Brukardt
2002-03-28  0:33       ` tmoran
2002-03-28 15:21       ` Marin David Condic
2002-03-29 11:30         ` Larry Kilgallen
2002-03-29 14:33           ` Marin David Condic
replies disabled

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