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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,34437e7a9afa5f65,start X-Google-Attributes: gid103376,public From: James Thomas Subject: X11Ada - Is Unchecked_Conversion commonly required? Date: 1997/07/14 Message-ID: <33CAE473.4079@earthlink.net>#1/1 X-Deja-AN: 256913473 Organization: EarthLink Network, Inc. Reply-To: jaimiethomas@earthlink.net Newsgroups: comp.lang.ada Date: 1997-07-14T00:00:00+00:00 List-Id: 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 "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