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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,1488a75895e849b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.190.193 with SMTP id dj1mr9563947qab.6.1360608816473; Mon, 11 Feb 2013 10:53:36 -0800 (PST) X-Received: by 10.49.116.115 with SMTP id jv19mr1064523qeb.21.1360608816451; Mon, 11 Feb 2013 10:53:36 -0800 (PST) Path: k2ni21154qap.0!nntp.google.com!p13no8687088qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 11 Feb 2013 10:53:36 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <51192116$0$30527$703f8584@news.kpn.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Converting a C/C++ statement to Ada From: Adam Beneschan Injection-Date: Mon, 11 Feb 2013 18:53:36 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-02-11T10:53:36-08:00 List-Id: On Monday, February 11, 2013 9:14:25 AM UTC-8, Simon Wright wrote: > "ldries46" writes: >=20 > > Can anyone tell me the Ada equivalent for the following C/C++ > > statement >=20 > > typedef void (*Apple) (Pair *two_side, pointer_type user_data, > > Error_type *error); >=20 > I think it's something like >=20 > type Apple is access procedure (two_side : access Pair;=20 > user_data : ?;=20 > error : access Error_type); >=20 > but of course the parameters may well not need to be accesses. Right. Unless the C/C++ code actually does something with the pointer valu= es themselves (such as copying two_side or error into some global pointer v= ariable that gets used later), then they probably should not be accesses, b= ut rather just "in Pair", "out Pair", or "in out Pair" (and similarly for E= rror_type) depending on whether the Pair or its components are read, writte= n, or both. -- Adam