comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Dispatching callback handed over to C
Date: Thu, 5 Apr 2012 00:28:25 -0700 (PDT)
Date: 2012-04-05T00:28:25-07:00	[thread overview]
Message-ID: <a236ccdb-e8b8-4b13-9e93-a2596f54ddcb@l7g2000vbw.googlegroups.com> (raw)
In-Reply-To: jli6n9$5up$1@munin.nbi.dk

On 4 Kwi, 21:16, "Randy Brukardt" <ra...@rrsoftware.com> 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



  reply	other threads:[~2012-04-05  7:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03  7:19 Dispatching callback handed over to C Natasha Kerensikova
2012-04-03  9:04 ` Brian Drummond
2012-04-03  9:21   ` Thomas Locke
2012-04-03  9:37 ` Maciej Sobczak
2012-04-03 12:02   ` Natasha Kerensikova
2012-04-03 14:42     ` Maciej Sobczak
2012-04-03 20:20       ` Randy Brukardt
2012-04-04  7:26         ` Georg Bauhaus
2012-04-04  7:56         ` Natasha Kerensikova
2012-04-04 19:28           ` Randy Brukardt
2012-04-05  8:59             ` Natasha Kerensikova
2012-04-05 21:04               ` Randy Brukardt
2012-04-04 19:55           ` Simon Wright
2012-04-04 11:34         ` Maciej Sobczak
2012-04-04 19:16           ` Randy Brukardt
2012-04-05  7:28             ` Maciej Sobczak [this message]
2012-04-05 21:32               ` Randy Brukardt
2012-04-07  8:55                 ` Natasha Kerensikova
2012-04-07 11:32                   ` Simon Wright
2012-04-07 13:28                     ` Robert A Duff
2012-04-05  9:13             ` Natasha Kerensikova
2012-04-05 21:06               ` Randy Brukardt
2012-04-06  7:30               ` Maciej Sobczak
2012-04-06 11:41                 ` Simon Wright
2012-04-10  7:15                   ` Maciej Sobczak
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox