comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank Randolph CIV" <frank.beard@navy.mil>
To: <comp.lang.ada@ada-france.org>
Subject: RE: Byte Swapping Constrained Data Types
Date: Mon, 20 Oct 2003 17:01:53 -0400
Date: 2003-10-20T17:01:53-04:00	[thread overview]
Message-ID: <mailman.124.1066683751.25614.comp.lang.ada@ada-france.org> (raw)

-----Original Message-----
From: Brian Barker [mailto:bbarker@ball.com]

> Is Unchecked_Conversion an expensive operation? I will be converting a good
> bit of data over a periodic rate.

Unchecked_Conversion is typically very fast.  We've never had it impact
our performance that we've noticed.  You could create some timing tests
just to check, but I wouldn't worry about it unless you are not meeting
some reasonable performance criteria.

> Also, will the compiler generate an error on the following line if the size
> of Terminal changes (say from 32 bits down to 16), but not
> Intermediate_Type?

The VAX Ada compiler would let you get away with differing sizes for
Unchecked_Conversion.  IIRC, you could convert a smaller size into a
larger size, but not the other way around.

Currently, I can only address the Aonix OA compiler, but that just happens
to be the one you're working with.  I haven't tried it since OA v7.1.2a and
we're currently on OA v7.2.2.  Assuming it still works the same, you will
get a compiler error that tells you they must be the same size.

Someone else would have to tell you about GNAT, if you're interested.

Frank



             reply	other threads:[~2003-10-20 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-20 21:01 Beard, Frank Randolph CIV [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-20 18:25 Byte Swapping Constrained Data Types Beard, Frank Randolph CIV
2003-10-20 19:21 ` Brian Barker
2003-10-20 16:52 Brian Barker
2003-10-21  1:00 ` Jeffrey Carter
replies disabled

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