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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,73975695cdfcb86f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.125.233 with SMTP id mt9mr2111003pbb.5.1333610905534; Thu, 05 Apr 2012 00:28:25 -0700 (PDT) Path: r9ni20554pbh.0!nntp.google.com!news1.google.com!postnews.google.com!l7g2000vbw.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Dispatching callback handed over to C Date: Thu, 5 Apr 2012 00:28:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <6fb83c74-b2a4-4ae8-9c89-d755b737198f@v22g2000vby.googlegroups.com> <85d1ad51-c02b-44fa-87b6-02aa1d8ba1b2@x17g2000vba.googlegroups.com> <62246369-6b9f-4a96-9c67-fd1774c02e78@k24g2000yqe.googlegroups.com> NNTP-Posting-Host: 213.77.7.66 Mime-Version: 1.0 X-Trace: posting.google.com 1333610905 16378 127.0.0.1 (5 Apr 2012 07:28:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 Apr 2012 07:28:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l7g2000vbw.googlegroups.com; posting-host=213.77.7.66; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-05T00:28:25-07:00 List-Id: On 4 Kwi, 21:16, "Randy Brukardt" wrote: > > Interestingly, this is also the intent of void*. > > But that's impossible. In general, data memory and code memory are different > things and require different access. But we are talking about using void* as a data pointer here (a class- wide object). > If all you want to do is store them, just stick them in the record as > "access-to-class-wide" and don't even worry about having a C counterpart. > You need some c-compatible type in the C-side, but it is just a > "bucket-of-bits". I use void* as bit bucket with the indication that what is inside is, well, a pointer. Ironically, contrary to your insistence of using type information correctly, I find my use of void* as a bit bucket for a pointer value somewhat more typed (at least in the sense of being self-documenting) than your DWORD, which is a bit bucket completely devoid of any self description and even exposing wrong set of operations (arithmetic? bit shifting? silent integer conversion? is it a set of flags or something?). Sorry, you are not convincing. I'll stick to void* when pointers are involved. > System.Address is the wrong type to use for a "bucket-of-bits". It is a proper type to use for a "bucket-of-pointer-bits" in the sense that I have no doubts about the intent when I see it later in code. -- Maciej Sobczak * http://www.inspirel.com