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: 103376,565ddc0e6b80e338 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: copying data between memory locations References: <1188809968.217323.145640@r29g2000hsg.googlegroups.com> <46dbe442$1@news.post.ch> <1188921451.460758.74670@r34g2000hsd.googlegroups.com> <1188929814.160464.273080@g4g2000hsf.googlegroups.com> In-Reply-To: <1188929814.160464.273080@g4g2000hsf.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1188936745 12.201.97.213 (Tue, 04 Sep 2007 20:12:25 GMT) NNTP-Posting-Date: Tue, 04 Sep 2007 20:12:25 GMT Organization: AT&T ASP.att.net Date: Tue, 04 Sep 2007 20:12:25 GMT Xref: g2news2.google.com comp.lang.ada:1740 Date: 2007-09-04T20:12:25+00:00 List-Id: jef.mangelschots@gmail.com wrote: > > It is an Ada83 project with a very short deadline. This section of > code is non-vital. Hopefully our last new Ada83 project (Ada83 is > dictated by the compiler we use. not because we want it). Next > projects will be Ada95/2005 on a new platform with new compilers. > The reason why I ask the question is because we typically never do > this kind of stuff and do it in ways suggested in your replies, hence > my question. Thanks for the answers though. If you were using Ada 95, the low-level approach might be the best way to meet your deadline. But in Ada 83 this sort of thing is so compiler dependent and often unclear and difficult that I would be surprised if I weren't done sooner taking the Ada approach than the one you're trying to use. > The fact that Ada95 has a feature that could help us out means that it > isn't an unreasonable request. This doesn't follow. Unreasonable things were added in Ada 95. Which they are depends on the individual. Ada 07 added some more. > The difficulty is in maintaining a reference to these buffers, which > are located and maintained elsewhere, in an array of structures, and > access them via these references in a generic way rather than directly > via their implementation-specific interfaces. References in Ada are best done through access values. The language provides a mechanism for accessing things via access values. Your compiler probably provides a (non-portable) way to convert your existing addresses to access values. "An array of structures" implies array indices and a common implementation. Could you use the index into the array as the reference and a common operation that takes the index as a parameter to access them? That would seem to be simple and clear. -- Jeff Carter "What I wouldn't give for a large sock with horse manure in it." Annie Hall 42