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.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no 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.180.75.8 with SMTP id y8mr734557wiv.1.1360922603367; Fri, 15 Feb 2013 02:03:23 -0800 (PST) Path: g1ni12261wig.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.meeh.mikalv.net!aioe.org!rt.uk.eu.org!feed.xsnews.nl!border-1.ams.xsnews.nl!post-feeder-02.xsnews.nl!frontend-F10-19.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <51192116$0$30527$703f8584@news.kpn.nl> In-Reply-To: Subject: Re: Converting a C/C++ statement to Ada Date: Tue, 12 Feb 2013 09:53:07 +0100 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 Message-ID: <511a0336$0$9247$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1360659254 news.kpn.nl 9247 77.168.179.107@kpn/77.168.179.107:50470 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Date: 2013-02-12T09:53:07+01:00 List-Id: I am happy with this answer, thanks L. Dries "Adam Beneschan" schreef in bericht news:eff6a8c1-f589-46b1-9a4e-d4d9a17d9e16@googlegroups.com... On Monday, February 11, 2013 9:14:25 AM UTC-8, Simon Wright wrote: > "ldries46" writes: > > > Can anyone tell me the Ada equivalent for the following C/C++ > > statement > > > typedef void (*Apple) (Pair *two_side, pointer_type user_data, > > Error_type *error); > > I think it's something like > > type Apple is access procedure (two_side : access Pair; > user_data : ?; > error : access Error_type); > > but of course the parameters may well not need to be accesses. Right. Unless the C/C++ code actually does something with the pointer values themselves (such as copying two_side or error into some global pointer variable that gets used later), then they probably should not be accesses, but rather just "in Pair", "out Pair", or "in out Pair" (and similarly for Error_type) depending on whether the Pair or its components are read, written, or both. -- Adam