comp.lang.ada
 help / color / mirror / Atom feed
From: James Thomas <jaimiethomas@earthlink.net>
Subject: X11Ada - Is Unchecked_Conversion commonly required?
Date: 1997/07/14
Date: 1997-07-14T00:00:00+00:00	[thread overview]
Message-ID: <33CAE473.4079@earthlink.net> (raw)


I've recently inherited a workload from a former associate who was
converting source code to use GNAT Ada95 with the Intermetrics X
bindings (he had been using Telesoft Ada 83 w/ their bindings).

What I've noticed is an apparent requirement to use Unchecked_Conversion
an *awful* lot. Examples (I'll try to keep these succinct)follow. What I
need to know is this - Am I just missing something here - or is this
prevalent use of UC really needed with the Intermetrics bindings?

1. When calling XtOpenDisplay, and passing X.Args.Argc to the argc
parameter, it is necessary (?) to use UC to convert the type of the
object to the type of the formal (X.Int_Access), although this is *not*
required for many other Intrinsics functions which take an argc
parameter (they use a type which is compatible with X.Args.Argc).

2. More commonly - it is not uncommon to pass a widget to XtAddCallback
as the "closure" parameter.  This was done rather simply when using 
Telesoft's bindings, w/o using UC.  However, the type Widget in 
Intermetrics' bindings is declared private, so UC appears to be
the only way to go ("closure" is of type XtPointer).

3. When using old-style args (not Va args), which is still required
for some subprograms, it is necessary to use UC to stuff data into
the XtArg.  UC was not needed in Telesoft's bindings.

I am finding more examples every day.  I am new to Ada 95 (but I'm an
Ada 83 veteran) and I've already learned about general access types,
aliased views and the like.  However, UC seems to be the only answer
in many cases.

-- 
jct  <jaimie.thomas@lmco.com>
     <jaimiethomas@earthlink.net>

"The greatest glory of the American Revolution was that it combined in
one indissoluble bond, the principles of civil government and
Christianity."
                                           - John Quincy Adams




             reply	other threads:[~1997-07-14  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-14  0:00 James Thomas [this message]
1997-07-17  0:00 ` X11Ada - Is Unchecked_Conversion commonly required? Jon S Anthony
replies disabled

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